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

Fix set_parameter_path in Helmholtz Property Package #1530

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bertkdowns
Copy link

Fixes

Fix the set_parameter_path() function in helmholtz.
update helmholtz_functions.py and helmholtz_state.py to use the latest cfg variable rather than storing a copy

Summary/Motivation:

the set_parameter_path function does not properly update the helmholtz parameter file path, because it sets idaes.properties.helmholtz.parameter_file_path rather than idaes.cfg.properties.parameter_file_path (note .cfg).

Also, helmholtz_functions.py makes a copy of the cfg variable into _data_dir, which also is not updated with set_parameter_path.

This involves needing to do some hacky workarounds to specify a different directory to load helmholtz data from (e.g see my register_compounds function.

Changes proposed in this PR:

  • The _data_dir variable is replaced with a function that gets the config variable
  • The set_parameter_path function is fixed to update the config variable correctly
  • the compounds are auto-registered, as specified in the set_parameter_path documentation

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.

@dallan-keylogic
Copy link
Contributor

@bertkdowns Could you please format your PR with Black? I'd like to see if it breaks the CI.

@bertkdowns
Copy link
Author

bertkdowns commented Nov 13, 2024

@bertkdowns Could you please format your PR with Black? I'd like to see if it breaks the CI.

done, and the pytest tests passed on my machine, except for the ones that required the petsc solver as I didn't have it installed

@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Nov 14, 2024
@dallan-keylogic
Copy link
Contributor

Looks like tests are passing, random Keras/multithreading errors nonwithstanding. @eslickj , if you get a chance, could you take a look to see if this breaks anything? At any rate, we should probably wait until after the 2.7 release to merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Normal Normal Priority Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants