-
-
Notifications
You must be signed in to change notification settings - Fork 357
Do not overwrite OPENMS_DATA_PATH in PyOpenMS if it is already set #5562
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
* Do not overwrite OPENMS_DATA_PATH if it is already set * Update CHANGELOG * Update AUTHORS
@jpfeuffer looks reasonable. We often have both OpenMS and pyOpenMS installed so if versions differ this might lead to problems. E.g., new OpenMS version with Elements.xml removed and old version of pyOpenMS that expects the file to exist in share. Do you think we need to cover that case? |
Hmm yes, I am not sure. Maybe we should print an info message that the path is set from outside and will be used? |
I agree. Outputting a warning like: |
That sounds very reasonable, apologies for the accidental merge commit - I didn't mean to push when I did. I have a slight edit to make to make the line length more reasonable if that's okay with you. I also added in the default path in the error message and used variables + |
Regardless of whether or not you accept my stylistic change, thank you very much for being open to this small contribution! This makes my life just a littttle bit easier :) |
An alternative that I just thought about would be to have a different environment variable that is specific to PyOpenMS eg. default_openms_data_path = os.path.join(here, "share/OpenMS")
pyopenms_openms_data_path = os.environ.get("PYOPENMS_DATA_PATH")
os.environ["OPENMS_DATA_PATH"] = pyopenms_openms_data_path or default_openms_data_path or default_openms_data_path = os.path.join(here, "share/OpenMS")
os.environ["OPENMS_DATA_PATH"] = os.environ.get("PYOPENMS_DATA_PATH", default_openms_data_path) This probably wouldn't necessitate a warning, just some documentation about |
Nice. Thanks for the cleanup. From my side this PR is good to go! |
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.
Looks good!
Description
I've got a lot of customizations (mostly to
unimod.xml
) that I've set in a new directory that is referenced byOPENMS_DATA_PATH
but PyOpenMS clobbers that on initialization. This simple modification should prevent it from doing so, if there is a path already set.Checklist:
How can I get additional information on failed tests during CI:
If your PR is failing you can check out
Note: