Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default simulation setup #157

Open
benbovy opened this issue Nov 19, 2020 · 1 comment
Open

Default simulation setup #157

benbovy opened this issue Nov 19, 2020 · 1 comment

Comments

@benbovy
Copy link
Member

benbovy commented Nov 19, 2020

Related to #21

This would be useful to create full, self-contained simulation setups that don't require any user input, e.g., using the %create_setup magic command or later when a command-line interface is available.

@benbovy benbovy changed the title Add default clocks and output variables to a Model object Default simulation setup Nov 23, 2020
@benbovy
Copy link
Member Author

benbovy commented Nov 23, 2020

xsimlab.Model could provide a default_setup argument that accepts a dictionary with the exact same structure than the xsimlab.create_setup arguments (i.e., clocks, input_vars, output_vars).

If default_setup is provided, then xsimlab.create_setup is called at model creation and the resulting dataset is attached to the new Model object. This dataset could be accessible, e.g., with the Model.default_setup property.

Pros:

This would allow something like:

with model:
    out_ds = (
        model.default_setup
        .xsimlab.update_vars(input_vars={...})
        .xsimlab.run()
    )

Cons:

Default setup would likely break when creating new models with update_processes or drop_processes. It would be tricky to propagate the default setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant