Skip to content

groegercesg/CovidEnforcementScotland

Repository files navigation

CovidEnforcementScotland

Binder

Help

"Arrgh this is taking forever"

  • This takes 70 seconds to load
  • Check "Build Logs", if it says: failed to connect to event stream then reload the website.
  • Be a bit more patient, it does naturally take a while - there's a lot of data to crunch and metre accurate maps to create.

Todo

  • Do we have to remake the map twice, as we do not, triggered once by selection and again by final resting point
  • Recency of data, we talk about when the range of the data, we can do this programmatically
    • Redo the description
    • Make better reference of the classifications
  • Absolute handling:
    • Turn all mentions of absolute, into "Total"
    • Do it in the RHS text as well
  • First release
    • Update readme
    • Binder setup
    • Finalise description on side bar of HTML
    • Change title
  • Pull in data about police numbers
  • Average number of "enforcement type" per day
    • take Number of "enforcement type" in period given by slider
    • divide by number of days
    • to get average
  • Implement a darkmode
    • Maybe we could use --theme=dark and then make the Cartopy output background transparent
  • Check and download new data
    • Every time this runs, it should check to see if there's new data.
    • For the CVI enforcement
    • Maybe it should have always been transparent?
  • Make text for the date range not be cut off

Updating Packages

We have packages required for the deployment on Binder, but due to the complexities of Cartopy being difficult we need to list our packages in two different ways: Conda and requirements.txt

For Conda

Updating conda

$ conda update -n MAIN --all

From our conda environment (my local one is called: MAIN), we can export the requirements to environment.yml using the command:

  • $ conda env export -n MAIN > environment.yml
  • Next add the following line to the file:
    ...
    pip:
        ...
        voila==0.2.10
    

For Requirements.txt

Updating PIP

$ pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U

Requirements are stored in requirements.in these are then generated into a frozen: requirements.txt file to be used by Binder. To Update Requirements:

  • Take the new module and put into requirements.in
  • Next add the following line to the file:
    ...
    voila
    
  • Then run the console command: $ pip-compile requirements.in

Visualisation Explanations

Officer Numbers

Police Scotland supplement local police officer resources by specialist resources that are organised at a regional and national level. As such exact numbers of individual officers within a Division may fluctuate due to operational demands. These allocations, understandably, aren't published and hence the decision has been taken to not include these supplemental regional and national resources in our officer numbers.

File List

Data Providence

Covid Enforcement Data:

Police Scotland Divisions: