You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some suggestions that I think it will improve code maintenance and debugging. None of this is exactly needed at this point, but if time becomes available, it would be nice to have.
Exception handling. When the code checks if a file already exists in order to load it (instead of downloading or computing it again), it is done in a try/except way. The exceptions are also caught generically, on a catch-all umbrella (e.g. except Exception as _).
I think we should first check if the file exists, then read it if it does. Only then, we can handle exceptions if something goes wrong. We should not fall into an exception if the file does not exist, since that will happen the first time running it. These functions should return some False/True, instead of carrying over a generic exception. In some other instances, computations are performed within a try/except block and I think that should really be removed. When something goes bad, the actual exception is never given to the user.
We should really consider moving grid data to an xarray format. The rasterio operations can probably be handled by rioxarray . Problems with orientation of aspect and wind direction conventions are handled ad-hoc. For example, this should be removed:
I have some suggestions that I think it will improve code maintenance and debugging. None of this is exactly needed at this point, but if time becomes available, it would be nice to have.
Exception handling. When the code checks if a file already exists in order to load it (instead of downloading or computing it again), it is done in a
try
/except
way. The exceptions are also caught generically, on a catch-all umbrella (e.g.except Exception as _
).SSRS/ssrs/simulator.py
Lines 161 to 165 in 1cda662
I think we should first check if the file exists, then read it if it does. Only then, we can handle exceptions if something goes wrong. We should not fall into an exception if the file does not exist, since that will happen the first time running it. These functions should return some
False
/True
, instead of carrying over a generic exception. In some other instances, computations are performed within atry
/except
block and I think that should really be removed. When something goes bad, the actual exception is never given to the user.We should really consider moving grid data to an
xarray
format. Therasterio
operations can probably be handled byrioxarray
. Problems with orientation of aspect and wind direction conventions are handled ad-hoc. For example, this should be removed:SSRS/ssrs/layers.py
Line 560 in 1cda662
SSRS/ssrs/layers.py
Line 579 in 1cda662
The
simulator
class has too many methods that should not be there. For example, all the plotting routines should be moved to another file/class.kwargs
keywords should be added to plotting functions, which are then passed to the actualpcolormesh
calls.The text was updated successfully, but these errors were encountered: