cyipt / actdev

ActDev - Active travel provision and potential in planned and proposed development sites
https://actdev.cyipt.bike
7 stars 3 forks source link

Update aggregate mode-split data for new sites #153

Closed Siequnu closed 3 years ago

Siequnu commented 3 years ago

In order to display the national-level view mode-split data I hacked together a Python script that loops through all the site data and generates an aggregate csv file containing data for all sites for each scenario (current and goactive).

I chose not to run this kind of script live in Javascript on page load as we would have to AJAX load dozens of mode-split CSVs.

This is an important weakness to fix, as it means that unless someone runs this script manually to refresh the numbers, the national-level view will be out of sync with the main data files, in the case that these change.

I'd propose someone from the data side create some sort of aggregate file, or add the mode-split.csv data to each site's properties in all-sites.geojson.

Once that's done I can hook up the national-level chart to the new data source.

mvl22 commented 3 years ago

Just to stress the importance of this - we'd really like to get rid of the Python script as it's a source of potential significant confusion and is a bit of technical debt that must be cleared up. Hopefully this will be a reasonably quick job on the R side.

mvl22 commented 3 years ago

The two files copied over to the actdev (non-UI) repo by @Robinlovelace in 40b80fdfb98990c9c63f902389b2a43b5e72a3b6.

I will adjust the website to point to these new files.

Next work is for the R people side of the project to generate the file directly. NB Those two files were generated with this script, so you can see the derivation of the values: https://github.com/cyipt/actdev-ui/blob/8e1c49f0b1988c1cb1266d782aa729e7414874ba/small_site_stats.py

Robinlovelace commented 3 years ago

Heads-up I've updated the issue and assigned @natesheehan - any issues you have on this let me know.

natesheehan commented 3 years ago

PR https://github.com/cyipt/actdev/pull/160