Coder Social home page Coder Social logo

Comments (5)

dfm avatar dfm commented on July 18, 2024 1

Yeah - exoplanet does not work with PyMC v4. You'll need to stick with PyMC3!

from exoplanet.

dfm avatar dfm commented on July 18, 2024 1

Great question and this is a good place to ask!

So far, I have updated all the backend packages (exoplanet-core, and celerite2) to be compatible with PyMC v4. This means that in principle it shouldn't be too hard to get the main package updated, but I haven't had the bandwidth to work on it!

For my own work, I've mostly been hacking on the JAX implementation (which is really more of a separate project, name TBD :D), but I definitely want to make sure that this package stays up to date. Maybe it makes sense to open a separate issue or PR to track these changes...

from exoplanet.

catrionamurray avatar catrionamurray commented on July 18, 2024

Hi! I'm trying to use exoplanet with PyMC (v4) and I'm having trouble with defining the limb-darkening coeffs:
u_ld = xo.distributions.QuadLimbDark("u", testval=np.array(init_u))
Throws an error when defined under pm.Model() where pm is pyMC not pyMC3.


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
~/opt/anaconda3/envs/py38/lib/python3.8/site-packages/pymc3/model.py in get_context(cls, error_if_none)
    320         try:
--> 321             candidate = cls.get_contexts()[-1]  # type: Optional[T]
    322         except IndexError as e:

IndexError: list index out of range

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
~/opt/anaconda3/envs/py38/lib/python3.8/site-packages/pymc3/distributions/distribution.py in __new__(cls, name, *args, **kwargs)
     85         try:
---> 86             model = Model.get_context()
     87         except TypeError:

~/opt/anaconda3/envs/py38/lib/python3.8/site-packages/pymc3/model.py in get_context(cls, error_if_none)
    325             if error_if_none:
--> 326                 raise TypeError("No %s on context stack" % str(cls))
    327             return None

TypeError: No <class 'pymc3.model.Model'> on context stack

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
/var/folders/6k/5j78gjkn74b4xb382c27jzwr0000gn/T/ipykernel_64514/3843441120.py in <module>
     17 
     18 # fit MCMC transit
---> 19 map_soln, model,[period,r,t0,b_ip,u_ld,mean] = fit_transit(x,y,yerr,init_r,init_t0, init_period,init_b,init_mean,init_u,period_error)
     20 # plot the fit
     21 plot_fit(x,y,yerr,map_soln)

~/Documents/Postdoc/CUBoulder/chromatic_fitting/src/recover_transit.py in fit_transit(x, y, yerr, init_r, init_t0, init_period, init_b, init_mean, init_u, period_error, fixed_var)
     86             u_ld = xo.distributions.QuadLimbDark("u", testval=np.array(init_u), observed=np.array(init_u))
     87         else:
---> 88             u_ld = xo.distributions.QuadLimbDark("u", testval=np.array(init_u))
     89 
     90         #         r = pm.Uniform(

~/opt/anaconda3/envs/py38/lib/python3.8/site-packages/pymc3/distributions/distribution.py in __new__(cls, name, *args, **kwargs)
     86             model = Model.get_context()
     87         except TypeError:
---> 88             raise TypeError(
     89                 "No model on context stack, which is needed to "
     90                 "instantiate distributions. Add variable inside "

TypeError: No model on context stack, which is needed to instantiate distributions. Add variable inside a 'with model:' block, or use the '.dist' syntax for a standalone distribution. 

from exoplanet.

vandalt avatar vandalt commented on July 18, 2024

Hi, I'm not sure this is the best place to ask my question (sorry if it's not). I was wondering if there were plans to make exoplanet compatible with PyMC v4 or if the JAX backend (exo4jax I think?) was the main path forward in the future?

Thank you!

from exoplanet.

dfm avatar dfm commented on July 18, 2024

Quick update here that I'm working on the update to pymc v4 over here: #271

from exoplanet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.