inbo / niche_vlaanderen

Python package to run the NICHE Vlaanderen model
https://inbo.github.io/niche_vlaanderen/
MIT License
5 stars 2 forks source link

Standard warnings vs custom warnings #103

Closed cecileherr closed 6 years ago

cecileherr commented 6 years ago

Niche Python Package question

(low-priority)

Running a niche model or a deviation still (using strict_checks=False) produces warnings with my test dataset Grobbendonk. I suppose they are related to incorrect mhw vs mlw vs msw values, but it might be cleaner not to display the standard warnings (and their frightening red frame in jupyter nb ;-)), but to display only the custom version instead. What do you think?

C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\niche.py:314: RuntimeWarning: invalid value encountered in greater & (input_array[b] != -99)): C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\niche.py:316: RuntimeWarning: invalid value encountered in greater bad_points = np.where(input_array[a] > input_array[b])

C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\vegetation.py:153: RuntimeWarning: invalid value encountered in less_equal & (row.mlw_min >= mlw) & (row.mlw_max <= mlw)) C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\vegetation.py:153: RuntimeWarning: invalid value encountered in greater_equal & (row.mlw_min >= mlw) & (row.mlw_max <= mlw))

For deviation I also get these warnings:

C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\vegetation.py:210: RuntimeWarning: invalid value encountered in less sel = (row.soil_code == soil_code) & (row.mhw_max > mhw) C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\vegetation.py:214: RuntimeWarning: invalid value encountered in greater sel = (row.soil_code == soil_code) & (row.mhw_min < mhw) C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\vegetation.py:219: RuntimeWarning: invalid value encountered in less_equal & (row.mhw_max <= mhw)) C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\vegetation.py:219: RuntimeWarning: invalid value encountered in greater_equal & (row.mhw_max <= mhw)) C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\vegetation.py:223: RuntimeWarning: invalid value encountered in less sel = (row.soil_code == soil_code) & (row.mlw_max > mlw) C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\vegetation.py:227: RuntimeWarning: invalid value encountered in greater sel = (row.soil_code == soil_code) & (row.mlw_min < mlw) C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\vegetation.py:232: RuntimeWarning: invalid value encountered in less_equal & (row.mlw_max <= mlw)) C:\Users\cecile_herr\AppData\Local\Continuum\anaconda3\envs\niche\lib\site-packages\niche_vlaanderen\vegetation.py:232: RuntimeWarning: invalid value encountered in greater_equal & (row.mlw_max <= mlw))

johanvdw commented 6 years ago

Are you sure you use version 1.0b2?

johanvdw commented 6 years ago

Confirmed - I will fix this.