rom-py / rompy

Relocatable Ocean Modelling in PYthon (rompy) combines templated cookie-cutter model configuration with various xarray extensions to assist in the setup and evaluation of coastal ocean model
https://rom-py.github.io/rompy/
BSD 3-Clause "New" or "Revised" License
3 stars 9 forks source link

92 sourcedataset breaks the schema #104

Closed tomdurrant closed 3 months ago

tomdurrant commented 3 months ago

Just repeating last comment from the issue here as its not linked...

Implementing a custom serialiser will not work. While this will allow the model to be dumped, the specification will still be broken due to the fact that the binary blob input cannot be specified.

I have taken a different approach of implementing a settings module that allows users to specify which datasources they would like to use. At the momeent, it defaults to to all the existing datasets and the current behavior is unchanged, however it is now easy to exlcude SourceDataset with an environment variable setting, which will result in a valid specification

export DATA_SOURCE_TYPES="SourceFile:rompy.core.data,SourceIntake:rompy.core.data,SourceDatamesh:rompy.core.data" 

We may want to think about replacing this with some sort of plugin machanism along the lines of #96, but for now, this is quite an elegant way of solving the issue

tomdurrant commented 3 months ago

Slight change to settings specification:

export DATA_SOURCE_TYPES="rompy.core.data.SourceFile,rompy.core.data.SourceIntake,rompy.core.data.SourceDatamesh"