Skip to content

Add get_parameters() and copy() utilities to Scenario for easier experiment management #3159

@navneetkumaryadav207001

Description

What's the problem this feature will solve?
Currently, when working with Scenario instances, there is no simple way to:

  • retrieve only the scenario parameters while excluding internal metadata (model, _scenario_id)
  • create a modified copy of an existing scenario with updated parameters

This makes experiment sweeps, logging, and reproducibility cumbersome and error-prone.

Describe the solution you'd like
Add two small utility methods to the Scenario class:

  1. get_parameters() – returns scenario parameters excluding metadata.
  2. copy(**updates) – creates a new scenario instance with optional parameter updates:
    • assigns a new _scenario_id
    • does not copy the model reference
    • shares the same RNG object by reference

These additions would simplify scenario management and improve usability for experiments.

Additional context

  • A PR implementing this already exists: Add parameter access and copy support to Scenario #3158
  • The copy() method is useful for creating slightly modified scenarios for sweeps or testing different parameters without affecting the original instance.
  • The RNG sharing behavior is documented to prevent confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions