IDAES / idaes-pse

The IDAES Process Systems Engineering Framework
https://idaes-pse.readthedocs.io/
Other
206 stars 228 forks source link

Adding attributes to hold units used by MSContactor #1396

Closed andrewlee94 closed 2 months ago

andrewlee94 commented 2 months ago

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:

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.
bpaul4 commented 2 months ago

@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 commented 2 months ago

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

codecov[bot] commented 2 months ago

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 :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.