-
Notifications
You must be signed in to change notification settings - Fork 44
Liquid liquid extractor #91
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
Conversation
andrewlee94
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a number of specific comments, but an overall question is whether this should be done using the MSContactor model instead of 2 control volumes.
idaes_examples/notebooks/docs/unit_models/custom_unit_models/Aq_property.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/Aq_property.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/Aq_property.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/Aq_property.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/Liq_property.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/liquid_extraction.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/liquid_extraction.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/liquid_extraction.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/liquid_extraction.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/liquid_extraction.py
Outdated
Show resolved
Hide resolved
|
General comments:
|
|
Hi @JavalVyas2000, I can review this PR today if it's ready. The branch is significantly behind I'm curious why |
|
Hi @bpaul4, the branch is ready to be reviewed. The reason why test_browse.py was deleted becasue the CI has issues with PySimpleGUI and it was failing tests. I just wanted to make sure that the integration was fine and passed all the tests. I believe we can update the branch. |
bpaul4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nicely done! The property packages and notebook files are very comprehensive.
I have a number of comments, mostly minor suggestions to improve the readability of the code and notebook. Also, in general when referencing other code features in our toolsets it's most helpful to link to documentation or notebook examples if they exist, and Python code files if more readable sources are not available.
idaes_examples/notebooks/docs/unit_models/custom_unit_models/Aq_property.py
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/LiqLiqExtractor.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/LiqLiqExtractor.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/LiqLiqExtractor.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/LiqLiqExtractor.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
| "------------------------------------------------------------------------------------\n", | ||
| "Suggested next steps:\n", | ||
| "\n", | ||
| " Try to initialize/solve your model and then call report_numerical_issues()\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, only include solver output from after the diagnostics tips are fixed so that there is only one, clean solver output. The goal of this notebook is to demonstrate creating a custom unit model, not the diagnostics tool itself. If we have an example of using the diagnostics, you can add a link to that notebook.
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Show resolved
Hide resolved
andrewlee94
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some additional to @bpaul4's comments plus a number of other requests (pretty much all are minor implementation issues rather than modeling issues).
idaes_examples/notebooks/docs/unit_models/custom_unit_models/LiqLiqExtractor.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/LiqLiqExtractor.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/LiqLiqExtractor.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/LiqLiqExtractor.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/LiqLiqExtractor.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/LiqLiqExtractor.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/Org_property.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/liquid_extraction.py
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/liquid_extraction.py
Outdated
Show resolved
Hide resolved
|
@JavalVyas2000 any news here? |
andrewlee94
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more things to fix. Some general questions/issues:
- I did a very quick skim of the notebooks and I did not see any test cells in them. Whilst you do have a section on how to write tests for a model, I do not think you have any cell that actually calls these tests to check that they (and the model code) runs as expected.
- Do we need the separate copies of the various modules? The issue with these is that they are currently untested as well, and that by effectively duplicating the code in the notebooks you open the door for them to drift out of sync.
| from idaes_examples import browse | ||
|
|
||
|
|
||
| @pytest.mark.unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about how the testing of the notebooks is done, but is this test module necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lbianchi-lbl could you please help with this question.
pyproject.toml
Outdated
| keywords = ["IDAES", "energy systems", "chemical engineering", "process modeling"] | ||
|
|
||
| [project.optional-dependencies] | ||
| gui = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this appearing in this PR?
...s/notebooks/docs/unit_models/custom_unit_models/liquid_extraction/liquid_liquid_extractor.py
Show resolved
Hide resolved
...tebooks/docs/unit_models/custom_unit_models/liquid_extraction/liq_liq_extractor_flowsheet.py
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
MarcusHolly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of minor comments and suggestions
...s/notebooks/docs/unit_models/custom_unit_models/liquid_extraction/liquid_liquid_extractor.py
Outdated
Show resolved
Hide resolved
| "# Creating Custom Unit Model\n", | ||
| "Author: Javal Vyas \n", | ||
| "Maintainer: Javal Vyas \n", | ||
| "Updated: 2023-02-20\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this does not need to be updated. I should remove the updated field.
| "- Steady-state only\n", | ||
| "- Organic phase property package has a single phase named Org\n", | ||
| "- Aqueous phase property package has a single phase named Aq\n", | ||
| "- Organic and Aqueous phase properties need not have the same component list. \n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to mention the caveat (here and in the unit model file) that they should share at least one component?
...examples/notebooks/docs/unit_models/custom_unit_models/liquid_extraction/organic_property.py
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Show resolved
Hide resolved
idaes_examples/notebooks/docs/unit_models/custom_unit_models/creating_unit_model.ipynb
Outdated
Show resolved
Hide resolved
MarcusHolly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - one more minor suggestion
agarciadiego
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…reating_unit_model.ipynb Co-authored-by: MarcusHolly <[email protected]>
Liquid liquid extractor example
This PR is a comprehensive tutorial on how to create a unit model from scratch, including a property package and unit model. It also includes how to write the tests for both. This unit model also tackles two phases and has two inlet and outlet ports, thereby giving an example for the user to create a new unit model that has multiple phases with multiple ports for inlet and outlet.
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution:
📚 Documentation preview 📚: https://idaes-examples--91.org.readthedocs.build/en/91/