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

Consider renaming "model_type" discriminator #120

Open rafa-guedes opened 1 month ago

rafa-guedes commented 1 month ago

/home/rguedes/.virtualenvs/xbeach/lib/python3.10/site-packages/pydantic/_internal/_fields.py:132: UserWarning: Field "modeltype" in BaseInterpolator has conflict with protected namespace "model".

rafa-guedes commented 1 month ago

This is linked to https://github.com/pydantic/pydantic/discussions/7121. We are actually already setting the protected_namespaces parameter in RompyBaseModel, this particular warning was just because I didn't inherit BaseInterpolator from RompyBaseClass.

We may still want to consider renaming model_type though, up for discussion.

rafa-guedes commented 1 month ago

Still on this topic of confusing / conflicting namespaces, we use in rompy "model" and "config" broadly which have specific meaning in pydantic itself. Should we consider changing these to something a bit more distinguishable? For example, config in rompy could be renamed into setup. Thoughts @tomdurrant @benjaminleighton ?