Skip to content

Simplify setting up big models #190

@rjplevin

Description

@rjplevin
  1. Instead of having to include all the components "manually", we can have a "components" directory from which all .jl files are included. I'm already doing this in the the core with a func defined in Mimi.jl load_comps(dirname::String="./components").

  2. @defcomp adds all components to a global registry. For the (presumably majority of) cases where this registry is exactly the list you want loaded, we can define something like add_all_components(model) which does just that. I've already added a topological sort function based on internal connection dependencies. It probably needs some refinement, but it's close. This avoids having to manually add comps in a right order. (Are there any dependency loops where we would have to indicate dependence on the prior timestep? If not we can postpone solving that.) [See also Think about option to create model from all comps in a module #166]

  3. For data loading, we can add a little structure to the data directory so that the paths to files are data/$(comp_name)/$(param_name).csv. Then a common load_all_data(model, my_validation_func) could load and test everything as required.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions