pyaerocom icon indicating copy to clipboard operation
pyaerocom copied to clipboard

Implement ColocationSetup, ObsCollection, and ModelCollection classes with Pydantic

Open lewisblake opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

EvalSetup is being implemented with pydantic in #1017. However, these three attributes of EvalSetup are not based on Pydantic's BaseModel and therefore are not subject to its parsing and validation.

Describe the solution you would like to see A clear and concise description of what you want to happen.

I would like to see the classes ObsCollection, ModelCollection, and ColocationSetup be based on pydantic's BaseModel so that everything in the config interface EvalSetup is based on pydantic and gets its validation and parsing.

  • Would you be able to work on this solution yourself? Yes, perhaps. Or someone else could pick this up.
  • How can the Pyaerocom development team assist you? Dicussions on the structure of these classes. Whether they should be split into classes which hold data and classes which manipulate data.

Additional context Extends the work in #1017. Will likely need to rewrite some of the workarounds in that PR, which should simplify EvalSetup.

Target classes are:

https://github.com/metno/pyaerocom/blob/364120b5dd6487e909738c068fc3ea3458e015f3/pyaerocom/colocation_auto.py#L41

https://github.com/metno/pyaerocom/blob/364120b5dd6487e909738c068fc3ea3458e015f3/pyaerocom/aeroval/collections.py#L80

https://github.com/metno/pyaerocom/blob/364120b5dd6487e909738c068fc3ea3458e015f3/pyaerocom/aeroval/collections.py#L173

NB: Arguably ObsCollection and ModelCollection could be dealt with in one PR where as ColocationSetup could be dealt which in another.

lewisblake avatar Apr 02 '24 20:04 lewisblake