Update imports of native_types and pyomo_constant_types in scaling module#1366
Merged
lbianchi-lbl merged 4 commits intoIDAES:mainfrom Mar 13, 2024
Merged
Update imports of native_types and pyomo_constant_types in scaling module#1366lbianchi-lbl merged 4 commits intoIDAES:mainfrom
native_types and pyomo_constant_types in scaling module#1366lbianchi-lbl merged 4 commits intoIDAES:mainfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1366 +/- ##
==========================================
- Coverage 77.60% 77.59% -0.01%
==========================================
Files 391 391
Lines 64330 64330
Branches 14244 14244
==========================================
- Hits 49923 49920 -3
- Misses 11831 11835 +4
+ Partials 2576 2575 -1 ☔ View full report in Codecov by Sentry. |
dallan-keylogic
approved these changes
Mar 11, 2024
Contributor
dallan-keylogic
left a comment
There was a problem hiding this comment.
Looks good to me. If pyomo_constant_types is deprecated, we probably should open an issue to move away from using it eventually.
Contributor
|
I would also recommend changing the following line (and removing the import of diff --git a/idaes/core/util/scaling.py b/idaes/core/util/scaling.py
index d4bd825..f3ee1cf 100644
--- a/idaes/core/util/scaling.py
+++ b/idaes/core/util/scaling.py
@@ -1509,7 +1509,7 @@ class NominalValueExtractionVisitor(EXPR.StreamBasedExpressionVisitor):
# first check if the node is a leaf
nodetype = type(node)
- if nodetype in native_types or nodetype in pyomo_constant_types:
+ if nodetype in native_types:
return [node]
node_func = self.node_type_method_map.get(nodetype, None) |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These should be imported from
pyomo.common.numeric_types. Also,pyomo_constant_typeswas deprecated last week (although I don't do anything about that). This PR is necessary to prevent import errors with pyomo/main, aspyomo_constant_typesno longer exists inpyomo.core.expr.numvalue.Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: