-
Notifications
You must be signed in to change notification settings - Fork 2
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
Defining the CoreComponents, LayerStructure and ModelTiming classes #374
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #374 +/- ##
===========================================
- Coverage 93.30% 93.18% -0.13%
===========================================
Files 59 60 +1
Lines 2866 2918 +52
===========================================
+ Hits 2674 2719 +45
- Misses 192 199 +7 ☔ View full report in Codecov by Sentry. |
Something odd going on with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible to me, just one small query.
Also I can't work out why codecov
is claiming that your changes have 0% test coverage, despite the fact you've written quite a few unit tests?
…ious fixture_layer_roles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. My only concern is that we maybe overdo it with the wrapping and lose transparency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
config: A Config instance. | ||
""" | ||
|
||
timing = config["core"]["timing"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the time this is called, the config has already validated to ensure there's a core
and a timing
, right? I think so, but just cross checking.
Adopting the new BaseModel structure in the model files.
I've merged #375 into this branch, ready to merge the whole thing down into |
Description
Following the discussion in #369, we've aligned on a solution that tries to strike a balance between the original completely identical
BaseModel
subclass signatures and something that retains some of the model to model differences. See#369 (comment) for a sketch of this solution.
That requires a dataclass of core details that can be created once and then passed to all model initialisations. Models will then share a genuine single copy of those details - not individual identical copies - and model signatures can avoid the more opaque
Config
objects while still inheriting core components.This PR implements that by creating
CoreComponents
which includes nested classes forLayerStructure
andModelTiming
. Those borrow heavily from existing code for generatinglayer_roles
and theextract_timing_details
function. Once this is accepted, those functions will disappear and an instance ofCoreComponents
can be used in their place.Issue #369 is not completed by this PR, but it would be good to agree on this structure and I can then adopt this structure in a second PR onto this, so we can break up the review a little bit!
Edited to add: That second WIP PR (#375) is now in progress - I wanted to see if implementing the changes here threw up anything unexpected. They did not.
Type of change
Key checklist
pre-commit
checks:$ pre-commit run -a
$ poetry run pytest
Further checks