Add SetOf domain; improve config's mock yaml dumper#3872
Conversation
- enable testing - generate improved output for types (avoid the generic "<class 'type'>" output)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3872 +/- ##
==========================================
- Coverage 89.67% 89.52% -0.16%
==========================================
Files 908 908
Lines 106735 106746 +11
==========================================
- Hits 95717 95563 -154
- Misses 11018 11183 +165
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
My original problem was the result of me failing to use a domain validator for I'm not sure adding When working on SOC dynamics, I ended up with an extremely obscure bug. I was specifying the phases in a certain property package as the set The way we specified the initial condition was to solve the steady state flowsheet, dump it to a So, in short, I think the user should be discouraged from providing items using unordered objects because it sets the stage for code either failing intermittently, or succeeding in one version of Python and failing in the other. |
Fixes # .
Summary/Motivation:
@dallan-keylogic requested that Pyomo's config system had a
SubsetOfdomain that paralleled theListOfdomain. This PR refactorsListOfso thatSetOfis a trivial extension.SubsetOfcan be easily acomplished using a combination ofSetOfandIn(and is documented in the SetOf docs).While I was messing with config, I refactored the mock yaml dumper so that we could reliably test it (even on systems with yaml). This included a subtle change to the dumper so that types are more intelligently dumped (that is, we will consistently dump the actual type and not "<class 'type'>"), and so that
Noneis output in proper YAML (asnull).Changes proposed in this PR:
SetOfLegal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: