Restructure Unit/Property Model Imports; Eliminate Duplicate Prop Model Names - #1693
Restructure Unit/Property Model Imports; Eliminate Duplicate Prop Model Names#1693kurbansitterley wants to merge 152 commits into
Conversation
| ====================== | ||
|
|
||
| .. index:: | ||
| pair: watertap.core.zero_order_properties;WaterParameterBlock |
There was a problem hiding this comment.
| pair: watertap.core.zero_order_properties;ZOParameterBlock |
SHould this pair be updated too?
There was a problem hiding this comment.
yeah docs are still a TO DO
|
|
||
| .. currentmodule:: watertap.core.zero_order_properties | ||
|
|
||
| The ideal water properties module contains a simple property package for saline waters which is intended for use with the WaterTap zero-order unit model library. The ideal water property package can be used in a flowsheet as shown below: |
There was a problem hiding this comment.
| The ideal water properties module (zero-order property model) contains a simple property package for saline waters which is intended for use with the WaterTap zero-order unit model library. The ideal water property package can be used in a flowsheet as shown below: |
Shouldn't we update the description a little bit?
There was a problem hiding this comment.
Yes definitely. I would argue we should drop the "ideal properties" language entirely
There was a problem hiding this comment.
This doc was re-written and moved.
| MCASParameterBlock, | ||
| ActivityCoefficientModel, | ||
| DensityCalculation, | ||
| MaterialFlowBasis, |
There was a problem hiding this comment.
No big deal, but I noticed that in another file change, you switched to importing MaterialFlowBasis from idaes.core. That said, I prefer having MaterialFlowBasis importable from watertap.property_models too for convenience.
There was a problem hiding this comment.
I agree and I was going to do this but thought I would get pushback because it would require doing from idaes.core import MaterialFlowBasis in the init and I am not sure if that is a packaging no-no. But I can add it
|
|
||
| from watertap.core.wt_database import Database | ||
| import watertap.core.zero_order_properties as prop_ZO | ||
| import watertap.property_models.zero_order_properties as prop_ZO |
There was a problem hiding this comment.
just a note on consistency---in other files, you do import ZOParameterBlock--but not here.
There was a problem hiding this comment.
Yeah haven't finished cleaning things up yet. I intend to be consistent across all files.
…to import-prop-packs
|
Probably want to come back to this soon since a new release cycle has just begun |
|
@kurbansitterley might you consider breaking this PR up into a few smaller ones? i.e. one for the import reorder, one for the renaming and one for changes in the way the imports are actually done. |
Fixes/Resolves:
NA
Summary/Motivation:
Currently importing a property model requires also knowing the name of the actual file the parameter block lives in, which is often non-intuitive and cumbersome. Additionally, we have several property models that have the same named parameter block, which is also non-intuitive and cumbersome (and confusing). The same is true for unit models.
This PR modifies the init so you can:
from watertap.property_models import __________Or for unit models:
from watertap.unit_models import ________We also have a few property models that share a name:
NaClParameterBlockis shared by three property modelsWaterParameterBlockis shared by two property modelsThis PR also renames them to the following:
NaClParameterBlockfor crystallizer isCrystallizerParameterBlockNaClParameterBlockfor the temperature dependent property model isNaClTDepParameterBlockWaterParameterBlockfor the ZO property model is nowZOParameterBlockThis PR also cleaned up and improves the import structure in many unit files to follow
THIS ORDER WOULD BE ENFORCED BY A TEST
test_import_order.pyImports are updated where necessary. Docs are updated where necessary.
Changes proposed in this PR:
zero_order_prop_packTO DO:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: