Repository navigation
Add CLI flag to prune network nodes without country_code key - #126
Conversation
…info_staging.gml. Does not check for other node keys (yet)
country_code key
robgjansen
left a comment
There was a problem hiding this comment.
I wonder if the pruning should be done upstream, on the code that generates the input that is passed to the staging command?
If we merge this, I'd ask for some minor changes first.
By default,
Done. |
robgjansen
left a comment
There was a problem hiding this comment.
OK, this looks good.
Note, I think the upstream scripts are in our atlas repo. And I think the script that outputs the final graph file is here.
I have not inspected the above script to see how it would need to change so that it does not output empty country codes, but I think in any case it makes sense to have a defensive check here so I'm approving this PR.
Thank you for your contribution!
(I will inspect the CI issue before merging.)
Description
A single node in
networkinfo_staging.gmlgraph doesn't contain thecountry_codekey in its dictionary - node284. Contents of the nodedict:{'ip_address': '185.243.20.232', 'bandwidth_down': '35408 Kibit', 'bandwidth_up': '21936 Kibit'}In the rare case that this particular node is then used to construct the network graph for the
shadowsimulation, I encounter an error in a geographical analysis I'm running on subsequent simulation output. This PR creates a optional flag for thestagesubcommand which removes a node from this graph if it doesn't contain acountry_codekey.Flag Usage
Testing
I smoke tested this on my local simulation / analysis pipeline but I haven't created any unit tests or integration tests, etc.