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

ST_Version.py does work with case-insenstive MacOS filesystem #162

Open
mstrzys opened this issue Apr 4, 2024 · 2 comments
Open

ST_Version.py does work with case-insenstive MacOS filesystem #162

mstrzys opened this issue Apr 4, 2024 · 2 comments
Assignees

Comments

@mstrzys
Copy link

mstrzys commented Apr 4, 2024

Bug
Fermipy uses the ST_Version.py module at:
mambaforge/base/pkgs/fermitools-2.2.0-py39h10ad0fb_0/lib/python3.9/site-packages/fermitools/ST_Version.py

When launched for the first time the scrips function:
write_release_version(rel_version)
is triggered, which is supposed to write the release version into a file at the same path with the name:
st_version.py

Since the MacOS filesystem (APFS) is case-insensitive the ST_Version.py file is overwritten. This basically cases fermipy to raise an error when launched a second time. As linux filesystem are case-sensitive the bug is not triggered on linux OSs.

Moreover, the version number is read incorrectly e.g.:

In [1]: from fermipy.gtanalysis import GTAnalysis

In [2]: gta = GTAnalysis('analysis_conf.yaml', logging={'verbosity' : 3})
2024-04-04 18:36:42 INFO    GTAnalysis.__init__():
--------------------------------------------------------------------------------
fermipy version 4.2.16
ScienceTools version 4.2.16

Instead of the expected 2.2.0

Suggestion
Simplest solution might be to use a different filename for the written output file. I can confirm that is solves the issue on MacOS with the error raised. Still the wrong version number remains.

@donhorner donhorner self-assigned this Apr 12, 2024
@donhorner
Copy link

This seems like a Fermipy issue and should be reported on the Fermipy tracker. They are a separate organization from the Fermi Science Support Center which distributes the Fermitools.

@mstrzys
Copy link
Author

mstrzys commented Apr 21, 2024

I do use the science tools in combination with fermipy and the example code highlighting the issue is from fermipy. However, the origin of the issue seems to be the file
https://github.com/fermi-lat/pyLikelihood/blob/master/python/ST_Version.py
more specifically the function
def write_release_version(rel_version):

In a case insensitive filesystem, this function will overwrite the program file itself, whereas it is only intended to write a file containing the version number.

Maybe I am mistaken but pylikelihood is part of the science tools not fermipy, isn't it? Or shall I move it to the issue tracker of the pylikelihood subroutines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants