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

Naming clash due to duplicate REGULAR objects in swan.components inpgrid and cgrid #114

Open pbranson opened 2 months ago

pbranson commented 2 months ago

When working with Alson on a SWAN model setup we started getting validation errors on our previously working CGRID because we had combined imports to the top of the module/notebook so had inadvertently ended up with:

from rompy.swan.components.cgrid import REGULAR
.
.
.
from rompy.swan.components.inpgrid import REGULAR

Propose that we should maybe rename them to INPREGULAR and CGRIDREGULAR given that their definition string has different parameters in SWAN also. Thoughts @rafa-guedes?

pbranson commented 2 months ago

cc @alsonathif

rafa-guedes commented 2 months ago

@pbranson yes I think you are right - It is possible to import ... as but I agree we could avoid this namespace issue altogether by renaming them as you suggest. I can look into it

pbranson commented 2 months ago

Thanks @rafa-guedes, we added the as to work around it also, also narrowing the scope of imports is also option.