Closed pechouc closed 3 years ago
Thanks for the heads-up, I had missed the Codacy check! I have moved to requests
in a new commit, which presents the additional advantage of harmonising these few lines with the process already used for getting the risk score.
Just updated @chloeskt access to the repo, you now have write access :ok_hand: So @pechouc, you can move ahead with the merge if everything looks alright to you :)
Thanks @frgfm ☺️
Wonderful, thanks a lot!
Hello everyone!
Following #35, here is a very light PR to switch from reading the local GeoJSON file in the
data
folder to fetching the file online, from a release in the Pyro-Risk repository.The first commit thus changes:
alerts.py
file to (i) move the file reading procedure outside of thebuild_departments_geojson
function, (ii) modify this process from a local reading to the online one and (iii) adapt imports and comments as needed;risks.py
file in which the file reading procedure was already outside of the function;config.py
file, so as to store the URL towards the release in a clean way.The second commit simply consists in eliminating the unnecessary local file.
My only interrogation is the following. Because the file is the same for both alerts and risks views, we could theoretically fetch the file only once for both, which would be more efficient. But at the same time, in
risks.py
, we are also fetching the estimated risk scores from the data science team and use them to modify thedepartments
variable. So, it seems that it would require some work to merge both requests to the online file and it feels as a bit of an overkill to me.What is your opinion on this? Should we absolutely read the file only once for both maps?