Skip to content

Introduce model collection - #523

Open
mabruzzo wants to merge 32 commits into
cholla-hydro:devfrom
mabruzzo:introduce-model-collection
Open

Introduce model collection#523
mabruzzo wants to merge 32 commits into
cholla-hydro:devfrom
mabruzzo:introduce-model-collection

Conversation

@mabruzzo

@mabruzzo mabruzzo commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

To be reviewed after #521 and #386 are merged (originally, the plan was to make this not depend on #386, but I changed my mind)


The goal is to introduce the ModelCollection type for tracking different types of Models. The primary example of a model is DiskGalaxy. However, for now, its something of a special case (more on that in a moment).

Overview

I've written up a primer about the purpose and motivation for the ModelCollection and I've included it in the internal doxygen-based API documentation. A preview of that documentation (prebuilt-by-readthedocs for this PR) can be found.

Let me know if you think parts of this discussion are incomplete.

As mentioned in the writeup, we currently track (behind the scenes) different kinds of models inside of a std::variant (this is simply a type-safe union). I generally think that it would be better to have different types of models inherit from a base class (perhaps BaseModel), but couldn't really do that while DiskGalaxy remains a special case. I'm happy to make a PR to change this (to follow up PR #524 where DiskGalaxy is made into a non-special case), but it's probably fine to leave things as they currently stand.

DiskGalaxy: a special case

As of right now, DiskGalaxy is a bit of a special case that is always constructed (with a fixed configuration). This is totally fine for the way that codebase currently works and doesn't interfere with non-galaxy problems. The followup PR (PR #524) makes it so that DiskGalaxy is constructed based upon parameters in a parameter file.

@mabruzzo mabruzzo mentioned this pull request Jun 30, 2026
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.

1 participant