Skip to content

g3_fit: Split up model-running and fit generation#43

Merged
willbutler42 merged 2 commits intomainfrom
split-acquire-generation
Aug 7, 2025
Merged

g3_fit: Split up model-running and fit generation#43
willbutler42 merged 2 commits intomainfrom
split-acquire-generation

Conversation

@lentinj
Copy link
Collaborator

@lentinj lentinj commented Jul 8, 2025

This splits off the model-running from the report generation in g3_fit(). This shouldn't really alter anything immediately, I mostly wanted to know if it was possible.

Given it seems to be, then it'd be worth keeping so it stays that way. This means we can do things like:

  1. Add tests with saved report output, feed that into g3_fit, and compare the output. We don't have to have an associated model to run a test. We can then use that to break up g3_fit_inner() into smaller chunks to ensure nothing gets broken.
  2. Run lots of projections, with the possibility of still using g3_fit() on the output afterwards. Ultimately being able to choose the output you want by invoking bits of g3_fit().

lentinj added 2 commits July 8, 2025 10:00
It's been a long while since this was necessary, as the reporint output
just includes it.
Break out the bulk of g3_fit() into g3_fit_inner(), which just
generates the fit report from report output.

More immediately, this helps with testing: g3_fit_inner() can now,
given a stored heap of arrays, compare the fit output to a baseline. A
model doesn't need to be constructed to test a scenario.

Long-term, the compartmentalisation helps the long-term goal of
breaking up g3_fit into discrete chunks, so we don't have to run the
full g3_fit output. Being separate functions means dependencies don't
sneak back in.
@willbutler42 willbutler42 merged commit 3f0a2ae into main Aug 7, 2025
1 check passed
@willbutler42
Copy link
Collaborator

Looks good, thanks.

@willbutler42 willbutler42 mentioned this pull request Aug 7, 2025
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