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
2 stars 9 forks source link

OutputLocs aren't rendered correctly into out.loc #44

Closed benjaminleighton closed 5 months ago

benjaminleighton commented 9 months ago

In OutputLocs the coords are a list of Coordinate objects see https://github.com/rom-py/rompy/blob/main/rompy/swan/config.py#L36. The comment on line 39 hints at the expected format and matches the default snippet supplied in the cookiecutter.json file at https://github.com/rom-py/rompy/blob/main/rompy/templates/swan/cookiecutter.json#L9. However when OutputLocs is used to build the cc_full dictionary prior to cookiecutting at https://github.com/rom-py/rompy/blob/main/rompy/swan/config.py#L245 the resulting format assigned to the cc_full dictionary is a dictionary keyed by 'coords' which has a value of a list of dictionaries keyed by 'lon' and 'lat'. At this point I think coords should have a value of a flat list of lon, lat pairs. A snippet from my debug looks like

ipdb>  cc_full['config']['output_locs'].dict()
{'coords': [{'lon': 115.4000015258789, 'lat': -32.11000061035156}, {'lon': 114.77999877929688, 'lat': -33.36000061035156}, {'lon': 115.69000244140625, 'lat': -31.979999542236328},
rafa-guedes commented 9 months ago

@benjaminleighton my idea is to use the components to define output locations. I have implemented all The Locations and Write components in the components branch, I'm finishing up fixing a few things and will then think of how to best connect these with the SwanConfig.

rafa-guedes commented 9 months ago

The components functionality for swan output has now been implemented since https://github.com/rom-py/rompy/pull/45, if everyone is happy with the new approach then I think we could remove these legacy objects including OutLocs and close these issue. Examples to define swan output using the components are provided in these notebooks. Docs are defined here.

rafa-guedes commented 5 months ago

The model output is now defined using the swan components, this has become obsolete.