-
Notifications
You must be signed in to change notification settings - Fork 526
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
Pickle transformed GDP models #2576
Conversation
…models can be pickled
…models can be pickled
…into fix-transformed-gdp-pickle
Codecov ReportBase: 86.76% // Head: 86.76% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2576 +/- ##
==========================================
- Coverage 86.76% 86.76% -0.01%
==========================================
Files 726 726
Lines 81228 81211 -17
==========================================
- Hits 70478 70459 -19
- Misses 10750 10752 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
A couple quick questions. Also, can we add a test somewhere to help with patch coverage?
@jsiirola, so, I think I was being a bit silly: Probably the patch coverage is low because we never actually make ScalarTransformedDisjuncts... Should we just not define it? Or I can make one in a test, but I don't really know what it's for. |
There really isn't a use case for the scalar, is there? It would have to be a model with a single 1-term disjunction? If that's the case, then I think the right thing is to remove the scalar class entirely. If there is only indexed, then you can also delete the |
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.
A couple (minor) questions, but this looks good!
Fixes #2417
Summary/Motivation:
The
bigm
andhull
transformations create Blocks for eachDisjunct
they transform, each with a weakref back to the original component. This PR makes those Blocks into a new component that defines an__autoslot_mappers__
dict so that the transformed model can be pickled.Changes proposed in this PR:
_TransformedDisjunct
class, which is just a Block with a weakref on it__autoslot_mappers__
dicts to Disjuncts and DisjunctionsLegal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: