C-Star is a python package for setting up and running ocean model simulations, with a particular focus on marine carbon dioxide removal (mCDR) applications.
The key goal here is to split ROMSComponent.input_datasets up into several more specific attributes, e.g. ROMSComponent.model_grid, closing #94 . This has implications in other places in the code.
It's already clear this is leading to a lot of reshuffling. I pondered for a good while yesterday how to split the various obstacles up, but they're pretty entangled, so I'm going to open this as a draft and push (non-working) commits to hopefully make it easier to follow along.
Problem 1
DescriptionCase.from_blueprint creates all the objects that go into a component, including InputDataset objects, before creating the Component object itself from those objects. As such it already has some nasty logic that is hyper-specific to, e.g. ROMSComponent. Implementing this change to ROMSComponent.input_datasets will involve rewriting large parts of Case.from_blueprint, and it would make sense to hand off component-specific aspects like this to the relevant Component subclasses.
Attempted solution
To start, I'm attempting to create a Component.from_dict class method, so that Case.from_blueprint can just call this method on each component in turn, passing the relevant subsection of the blueprint yaml file.
The key goal here is to split
ROMSComponent.input_datasets
up into several more specific attributes, e.g.ROMSComponent.model_grid
, closing #94 . This has implications in other places in the code.It's already clear this is leading to a lot of reshuffling. I pondered for a good while yesterday how to split the various obstacles up, but they're pretty entangled, so I'm going to open this as a draft and push (non-working) commits to hopefully make it easier to follow along.
Problem 1
Description
Case.from_blueprint
creates all the objects that go into a component, including InputDataset objects, before creating the Component object itself from those objects. As such it already has some nasty logic that is hyper-specific to, e.g. ROMSComponent. Implementing this change toROMSComponent.input_datasets
will involve rewriting large parts ofCase.from_blueprint
, and it would make sense to hand off component-specific aspects like this to the relevant Component subclasses.Component.from_dict
class method, so thatCase.from_blueprint
can just call this method on each component in turn, passing the relevant subsection of the blueprint yaml file.