unifhy-org / unifhy

A Unified Framework for Hydrology
https://unifhy-org.github.io/unifhy
BSD 3-Clause "New" or "Revised" License
11 stars 5 forks source link

Revise state design and associated documentation #71

Closed ThibHlln closed 2 years ago

ThibHlln commented 2 years ago

resolve #37, resolve #60, resolve #57

To avoid confusion between standard python/numpy indexing and the bespoke indexing of State, the dunder methods __getitem__ and __setitem__ are replaced with get_timestep and set_timestep methods, respectively (as per #37).

The existing way of indexing states to retrieve a particular timestep is preserved, i.e. t at index 0, t-1 at index -1, t-2 at index -2, etc.

This special indexing is now also documented in the contributor guide (as per #60).

Also, the shape of the variables that the component contributors should expect in their intialise/run/finalise methods, and the shape of the variables returned by these methods expected by the framework are better documented (namely as per #57).