Skip to content

Define an ExperimentList class - #63

Draft
jbeilstenedmands wants to merge 7 commits into
mainfrom
experiment_list
Draft

jbeilstenedmands wants to merge 7 commits into
mainfrom
experiment_list

Conversation

@jbeilstenedmands

Copy link
Copy Markdown
Contributor

Experiment is simplified - it is a container for the models. These are now stored as shared pointers to instances of the model classes (Beam, Detector etc). But the API for users of the experiment class is still the same, i.e. you get a reference to the underlying object:

Beam& beam() { return *_models.beam; }
const Beam& beam() const { return *_models.beam; }

A Models struct is defined to help with clean construction.

Also, make the API simpler by only allowing setting of optional models that are discovered during processing e.g. the crystal model. Things like the Beam, Detector are defined at the start by the metadata - these models should therefore be updated by a relevant update method on those objects, if they are subsequently refined.

The ExperimentList class stores a vector of experiments and importantly handles (de)serialization to/from json, which enables it to correctly construct shared models.

I will add some tests for the ExperimentList (de)serialization round trip.

@jbeilstenedmands jbeilstenedmands self-assigned this Nov 13, 2026

@dimitrivlachos dimitrivlachos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Tests are useful.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

2 participants