-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetching GeoJSON file from Pyro-Risk release #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pechouc ! Thank you for this PR, seems great !!
I've had a look at this issue given by Codacy. This is that there are security issues with urllib
, especially due to the permitted schemes (SO thread). I guess that the security risk is not that important in our case, but we should try to have as many best practices as possible. Maybe we should use another library such as requests
which do not face the same issue ? or make sure that the transfer protocol is http or https if you want to use urllib
?
Thanks for the heads-up, I had missed the Codacy check! I have moved to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is great !
Merging master following the merge of Adel's Pull Request.
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?