ucl-exoplanets / TauREx3_public

Public release of TauREx3
https://taurex3-public.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
20 stars 11 forks source link

_inital_mu error during notebook example #13

Closed LucaNap closed 3 years ago

LucaNap commented 3 years ago

Hello, I get the following error on Windows 10 (Anaconda) after running the notebook in the example folder:

AttributeError Traceback (most recent call last)

in 15 tm.add_contribution(RayleighContribution()) 16 tm.build ---> 17 res = tm.model() 18 plt.figure() 19 D:\Anaconda3\lib\site-packages\taurex\model\simplemodel.py in model(self, wngrid, cutoff_grid) 388 389 # Setup profiles --> 390 self.initialize_profiles() 391 392 # Clip grid if necessary D:\Anaconda3\lib\site-packages\taurex\model\simplemodel.py in initialize_profiles(self) 137 # Initialize the atmosphere with a constant gas profile 138 if self._initialized is False: --> 139 self._inital_mu.initialize_chemistry(self.pressure.nLayers, 140 self.temperatureProfile, 141 self.pressureProfile, AttributeError: 'TransmissionModel' object has no attribute '_inital_mu'

Also all the "example" .par are not working, perhaps due to recent updates of taurex.

ahmed-f-alrefaie commented 3 years ago

Thanks for bringing it up. This error usually occurs when build hasn't been called before model. I'll take a look at it and see what the issue is.

I notice that in your exception stack that tm.build does not have any parenthesis. If you replace it with tm.build() does it work?

LucaNap commented 3 years ago

Thanks for bringing it up. This error usually occurs when build hasn't been called before model. I'll take a look at it and see what the issue is.

I notice that in your exception stack that tm.build does not have any parenthesis. If you replace it with tm.build() does it work?

Nope, still won't work... thank you for the quick response though! The following error pops out now, which is the same one I get with the .par examples:


TypeError Traceback (most recent call last)

in 15 tm.add_contribution(RayleighContribution()) 16 tm.build() ---> 17 tm.model() 18 plt.figure() 19

D:\Anaconda3\lib\site-packages\taurex\model\simplemodel.py in model(self, wngrid, cutoff_grid)

D:\Anaconda3\lib\site-packages\taurex\data\stellar\star.py in initialize(self, wngrid)

TypeError: expected dtype object, got 'numpy.dtype[float64]'

ahmed-f-alrefaie commented 3 years ago

Which version of numba and numpy are you using and were they installed using pip or conda? There is a related issue: https://github.com/numba/numba/issues/6041 caused by some incompatibility between versions

You can try uninstalling both and using the conda versions: pip uninstall numpy numba conda install numpy numba

LucaNap commented 3 years ago

They were installed with conda. But I have tried anyway to do what you have suggested and unfortunately the issue is still there.

Conda installed numba 0.50.1 and numpy 1.20.2

LucaNap commented 3 years ago

@ahmed-f-alrefaie I made it work by forcing conda to install the latest versions of astropy, numpy and numba (for some reason it wouldn't "update" to the newer versions). This is just to say that the issue was with the other packages, not Taurex... but yeah those parentheses are needed in the notebook! Thank you

ahmed-f-alrefaie commented 3 years ago

Thanks for bringing it up :) I'm glad it worked for you! I'll fix the notebook. Closing the issue