Closed landriu closed 3 months ago
Thanks for reporting it. The FSSC is aware of this and hopefully it will be fixed in the next release. A temporary fix is to include the following at the beginning of each session:
import numpy as np np.float=float
Hi, this is working indeed. I just want to give the following precision that in AnalysisBase.py, from which is derived UnbinnedAnalysis.py, it was written "import numpy as num"
Thank you for your help
Hello,
when trying to generate a like object using unbinnedAnalysis() from UnbinnedAnalysis.py from fermitools-2.2.0 installation on SLAC machine, I get the following error :
(fermitools-2.2.0) [landriu@sdfiana009 testLike]$ python Python 3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 15:55:03) [GCC 10.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last): File "", line 1, in
File "/sdf/group/fermi/sw/conda/envs/fermitools-2.2.0/lib/python3.9/site-packages/fermitools/UnbinnedAnalysis.py", line 278, in unbinnedAnalysis
like = UnbinnedAnalysis(obs, pars['srcmdl'], pars['optimizer'], nee=nee)
File "/sdf/group/fermi/sw/conda/envs/fermitools-2.2.0/lib/python3.9/site-packages/fermitools/UnbinnedAnalysis.py", line 159, in init
self.energies = eMinnum.exp(estepnum.arange(nee, dtype=num.float))
File "/sdf/group/fermi/sw/conda/envs/fermitools-2.2.0/lib/python3.9/site-packages/numpy/init.py", line 284, in getattr
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'float'
And I have following settings :
(fermitools-2.2.0) [landriu@sdfiana009 testLike]$ conda env list
conda environments:
# base /sdf/group/fermi/sw/conda calibrator /sdf/group/fermi/sw/conda/envs/calibrator fermitools-2.2.0 * /sdf/group/fermi/sw/conda/envs/fermitools-2.2.0 flare-advocate /sdf/group/fermi/sw/conda/envs/flare-advocate threeML-2.4.0 /sdf/group/fermi/sw/conda/envs/threeML-2.4.0
(fermitools-2.2.0) [landriu@sdfiana009 testLike]$ conda list fermi
packages in environment at /sdf/group/fermi/sw/conda/envs/fermitools-2.2.0:
#
Name Version Build Channel
fermipy 1.2.0 pypi_0 pypi fermitools 2.2.0 py39h93a0a19_0 fermi fermitools-data 0.18 0 fermi (fermitools-2.2.0) [landriu@sdfiana009 testLike]$ conda list numpy
packages in environment at /sdf/group/fermi/sw/conda/envs/fermitools-2.2.0:
#
Name Version Build Channel
numpy 1.24.1 py39h223a676_0 conda-forge
Can you check please ? I guess this error can be easily reproduced with any other inputs, and if it is not the case: you should be allowed to use mine. Tell me if I forgot to mention anything .
David Landriu