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
{{ message }}
Repository navigation
Visualisation expects all boundary conditions provided, even when the process in turned off #284
When running aeolis with the visualization-argument set to True, the function expects that the p-variable contains arrays for p['wind_file'], p['wave_file'], and p['tide_file']. However, when these files are not provided - e.g., because (part of) these processes are not enabled - this results in an IndexError.
Expected behaviour
The expected behaviour is that when (part of) these files are not provided - especially when the corresponding processes are disabled - the visualisation is not generated for these timeseries without raising an error; i.e., the visualisation should skip this boundary condition. PS. I can understand that the p['wind_file'] is considered mandatory, and thus should always be provided.
Code suggestion
Instead of the current if-statements (i.e., if np.shape(p['wave_file'])[1] == 3: and if np.shape(p['tide_file'])[1] == 2:), there is a check whether these processes are enabled and/or the entries are defined. Applying the np.shape()-function on a NoneType (i.e., undefined) results in an empty tuple (i.e., ()), which cannot be indexed (there are no entries after all). Thus instead, the above if-statements should be preceded by if p['wave_file'] is not None: and if p['tide_file'] is not None:.
Thus, e.g., the below code could replace the existing code:
This will result in empty plots, which could be accommodated for by setting the number of plots dynamically, based on the provided data; or, it can be left empty intentionally to highlight the missing timeseries.
Activity
Implemented code suggestion from openearth#284.