New port classes - #1785
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1785 +/- ##
==========================================
- Coverage 73.82% 73.79% -0.03%
==========================================
Files 419 420 +1
Lines 66392 66428 +36
Branches 11171 11175 +4
==========================================
+ Hits 49012 49022 +10
- Misses 14840 14863 +23
- Partials 2540 2543 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The CodeCov failure is due to the same issue getting coverage for functions, classes and import statements and consequently will be ignored. @andrewlee94 , let me know if you have any opinions about this change. |
|
An alternative to consider that might be a bit more robust would be to give ports the following properties: |
I thought about doing something like this, but 1) that would still require subtyping the full diamond structure of The other method I thought about using was to look for ports in an arc as the "destination" field and treating those as inlets and ports in "source" field of an arc to treat that as an outlet. However, that method is also vulnerable to user error, and users also like to fix boundary conditions directly on inlet ports without using a |
|
@dallan-keylogic if inlet/outlet information is mostly captured in the |
The problem is that there are multiple places where inlet/outlet information are added, but they do not necessarily agree with each other. The first is in the The second place that information is located is in the unit model's initialization method. Almost every initialization method ends up fixing variables on inlet ports. However, there's no class features that force the user to do this. The last resort for determining what's an inlet and what's an outlet is the port's name. In multiple places in the IDAES codebase, iterating over Most of these issues can be handled by experienced users, but new users can find them tricky. One of the motivations for this PR came from watertap-org/watertap#1757. It would be nice to tell the user which ports are inlets and which ports are outlets as part of a similar method in IDAES. |
Summary/Motivation:
A persistent problem in flowsheet visualization has been trying to determine whether a port corresponds to an inlet or outlet. The present "solution" has been to search for "inlet" or "outlet" in the port name. Here I added two subclasses of
Port, so we can verify if something is an inlet, outlet, or neither usingisinstance.Changes proposed in this PR:
InletPortandOutletPortclasses have been implementedLegal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: