Open mstrzys opened 3 months ago
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.
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?
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(relversion) 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.:
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.