pyronear / pyro-platform

Detection & monitoring platform of wildfires
https://platform.pyronear.org/
Apache License 2.0
10 stars 11 forks source link

Fetching GeoJSON file from Pyro-Risk release #39

Closed pechouc closed 3 years ago

pechouc commented 3 years ago

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:

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 the departments 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?

pechouc commented 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.

frgfm commented 3 years ago

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 :)

chloeskt commented 3 years ago

Thanks @frgfm ☺️

pechouc commented 3 years ago

Wonderful, thanks a lot!