codethechange / mobility_pipeline Goto Github PK
View Code? Open in Web Editor NEWMobility Data Pipeline for UNICEF
Home Page: https://unicef-mobility-pipeline.readthedocs.io
License: Other
Mobility Data Pipeline for UNICEF
Home Page: https://unicef-mobility-pipeline.readthedocs.io
License: Other
We should have code that at minimum spot-checks the data files to give some assurance they are in the expected format. We should validate:
MyPy does not appear to support type hinting shapely, so for now we will tell mypy to ignore shapely with # type: ignore
at the end of the import statement. Ideally, we will somehow add type hinting support for shapely by providing stub files. Related to #1.
MyPy does not appear to support type hinting numpy, so for now we will tell mypy to ignore numpy with # type: ignore
at the end of the import statement. Ideally, we will somehow add type hinting support for numpy by providing stub files. Here are some useful links:
Write a function to make the admin-to-admin matrix from:
The main purpose of this function is for clarity and documentation, not code reuse. Matrix multiplication can be done with numpy. Assume all input matrices are numpy matrices.
Write introductory documentation for our project to introduce developers to our codebase. Write in restructured text.
Example:
The documentation should include:
Toggle the visibility of an existing layer only when a particular province is clicked.
Add console.log()
statements to the setVisibleLayers
action to figure out what the IDs are. Specifically, we are looking for how the IDs relate to the contents of the JSON file.
Potential ways:
Loading data from filepaths and importing modules should work no matter how the script is run (i.e. from terminal or through PyCharm, from inside or outside the directory)
All of the lib
module should be covered by unit tests. Check at codecov.
Pick some layer that is already in the JSON and make it visible when any admin region is clicked. This might be possible by adding the layer ID to the list of currently visible layers (probably stored in state
) and passing the new list to setVisibleLayers
.
Write a function to compute the overlap between one polygon and a list of polygons
Parameters:
enclosing
: A MultiPolygon
polygons
: A list of MultiPolygon
objects, each of which may overlap with enclosing
Return: A list of percentages such that the percentage at index i
is the percent area of polygons[i]
that is within enclosing
.
It will be common for a user to want to compute admin-to-admin matrices for many days, but the current code requires that they re-compute the admin-to-tower and tower-to-admin matrices each time. This is the most inefficient part, and it only needs to happen once per country. The program should save off those files and let the user specify (or auto-detect) when they have already been generated.
Create one script to run once per country, which would:
identifier shapefile_path_prefix voronoi_path
shapefile_path_prefix
: The .shp
and .dbf
files should be at [shapefile_path_prefix].shp
and [shapefile_path_prefix].dbf
.shp
or .dbf
files, should strip extension[identifier]-shape.json
[identifier]-tower-to-admin.csv
[identifier]-admin-to-tower.csv
And a second script to run once for each day, which would:
identifier tower_prefix mobility_path
DATA_PATH
for the filenames defined above[identifier]-admin-to-admin.csv
All paths relative to the DATA_PATH
constant, except for command-line args.
Finally, create a wrapper script that caches the outputs from the first script
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.