Skip to content
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

Adding attributes to hold units used by MSContactor #1396

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

andrewlee94
Copy link
Member

Fixes None

Summary/Motivation:

For unit models deriving from the MSContactor, or using it a a building block, it is often necessary to know the units of measurement used for the unit model variables. This PR gets the MSContactor to store these as attributes so that deriving models can make use of them.

Changes proposed in this PR:

  • Adds two new attributes to the MSContactor to store the flow basis and units of measurement.

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@andrewlee94 andrewlee94 requested a review from bpaul4 as a code owner April 12, 2024 20:25
@andrewlee94 andrewlee94 self-assigned this Apr 12, 2024
@andrewlee94 andrewlee94 added enhancement New feature or request Priority:Normal Normal Priority Issue or PR unit models Issues dealing with the unit model libraries PrOMMiS Issues related to PrOMMiS activities labels Apr 12, 2024
@bpaul4
Copy link
Contributor

bpaul4 commented Apr 15, 2024

@andrewlee94 it looks like many tests directly call _build_state_blocks, and since self.flow_basis = None and self.uom = None are set in build these attributes don't exist in the tests. Should the tests call build instead?

@andrewlee94
Copy link
Member Author

@bpaul4 No - I just didn't think I'd need to update the tests.

@andrewlee94 andrewlee94 enabled auto-merge (squash) April 15, 2024 20:38
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

Attention: Patch coverage is 95.23810% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 77.62%. Comparing base (45c8ff0) to head (83ac3c3).

Files Patch % Lines
idaes/models/unit_models/mscontactor.py 95.23% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1396      +/-   ##
==========================================
- Coverage   77.63%   77.62%   -0.01%     
==========================================
  Files         391      391              
  Lines       64392    64391       -1     
  Branches    14264    14264              
==========================================
- Hits        49990    49986       -4     
- Misses      11830    11834       +4     
+ Partials     2572     2571       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrewlee94 andrewlee94 merged commit 3a1d54a into IDAES:main Apr 16, 2024
54 checks passed
@andrewlee94 andrewlee94 deleted the mscontactor_units branch April 16, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Priority:Normal Normal Priority Issue or PR PrOMMiS Issues related to PrOMMiS activities unit models Issues dealing with the unit model libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants