Closed geek-yang closed 1 year ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Ok...Linter fails because of another abstract class thingy, due to protocol
. Apparently the latest release of mypy
is quite picky about abstract class.
It would be nice to keep the type hint here though:
DATASETS: dict[str, type[dataset_protocol.Dataset]] = {
Perhaps use Union[type[dataset_protocol.Dataset], type[ECMWFDataset]]
? Then we get type checking in the recipe runner, otherwise the datasets there would resolve to Any
.
Although I would have thought we can just provide the protocol as type and things should work: https://mypy.readthedocs.io/en/stable/protocols.html#simple-user-defined-protocols
Perhaps ECMWFDataset needs to subclass protocol as well... see: https://mypy.readthedocs.io/en/stable/protocols.html#defining-subprotocols-and-subclassing-protocols :thinking:
Kudos, SonarCloud Quality Gate passed!
Support ERA5 land dataset in zampy.