Open taylorbell57 opened 2 years ago
I wanted to see if this was an issue with just this newest version of starry, so I went back and tried older versions of starry. Simply doing pip install starry==version with version spanning all the releases between 1.1.0 and 1.2.0 after doing the above installation, I get the same error messages with limb darkening.
I was unable to even import starry==1.0.0 after a fresh install:
silurian:notebooks tjbell1$ conda create -n starry2 python==3.9.7 mkl-service -y
silurian:notebooks tjbell1$ conda activate starry2
silurian:notebooks tjbell1$ pip install starry==1.0.0 'numpy<1.22'
silurian:notebooks tjbell1$ ipython
In [1]: import starry
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The installed Theano(-PyMC) version (1.0.5) does not match the PyMC3 requirements.
It was imported from ['/Users/tjbell1/miniconda3/envs/starry2/lib/python3.9/site-packages/theano']
For PyMC3 to work, a compatible Theano-PyMC backend version must be installed.
See https://github.com/pymc-devs/pymc3/wiki for installation instructions.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 import starry
File ~/miniconda3/envs/starry2/lib/python3.9/site-packages/starry/__init__.py:19, in <module>
17 # Import the main interface
18 from ._config import config
---> 19 from . import kepler, linalg, maps
20 from .maps import Map
21 from .kepler import Primary, Secondary, System
File ~/miniconda3/envs/starry2/lib/python3.9/site-packages/starry/kepler.py:4, in <module>
2 from . import config
3 from ._constants import *
----> 4 from .maps import MapBase, RVBase, ReflectedBase
5 from ._core import OpsSystem, math, linalg
6 import numpy as np
File ~/miniconda3/envs/starry2/lib/python3.9/site-packages/starry/maps.py:4, in <module>
2 from . import config
3 from ._constants import *
----> 4 from ._core import OpsYlm, OpsLD, OpsReflected, OpsRV, linalg, math
5 from ._indices import integers, get_ylm_inds, get_ul_inds, get_ylmw_inds
6 from ._plotting import (
7 get_ortho_latitude_lines,
8 get_ortho_longitude_lines,
9 get_projection,
10 )
File ~/miniconda3/envs/starry2/lib/python3.9/site-packages/starry/_core/__init__.py:2, in <module>
1 # -*- coding: utf-8 -*-
----> 2 from . import core, ops, utils
4 from .core import *
5 from .math import math, linalg
File ~/miniconda3/envs/starry2/lib/python3.9/site-packages/starry/_core/core.py:33, in <module>
30 try: # pragma: no cover
31 # starry requires exoplanet >= v0.2.0
32 from packaging import version
---> 33 import exoplanet
35 if version.parse(exoplanet.__version__) < version.parse("0.2.0"):
36 exoplanet = None
File ~/miniconda3/envs/starry2/lib/python3.9/site-packages/exoplanet/__init__.py:5, in <module>
1 # -*- coding: utf-8 -*-
3 __all__ = ["__version__", "distributions", "orbits", "interp"]
----> 5 from . import distributions, interp, orbits
6 from .citations import CITATIONS
7 from .distributions import * # NOQA
File ~/miniconda3/envs/starry2/lib/python3.9/site-packages/exoplanet/distributions/__init__.py:5, in <module>
1 # -*- coding: utf-8 -*-
3 __all__ = ["QuadLimbDark", "ImpactParameter", "eccentricity"]
----> 5 from . import eccentricity
6 from .physical import ImpactParameter, QuadLimbDark
File ~/miniconda3/envs/starry2/lib/python3.9/site-packages/exoplanet/distributions/eccentricity.py:7, in <module>
5 import aesara_theano_fallback.tensor as tt
6 import numpy as np
----> 7 import pymc3 as pm
9 from ..citations import add_citations_to_model
12 def kipping13(
13 name, fixed=False, long=None, lower=None, upper=None, model=None, **kwargs
14 ):
File ~/miniconda3/envs/starry2/lib/python3.9/site-packages/pymc3/__init__.py:112, in <module>
108 pass
111 _check_backend_version()
--> 112 __set_compiler_flags()
113 _hotfix_theano_printing()
115 from pymc3 import gp, ode, sampling
File ~/miniconda3/envs/starry2/lib/python3.9/site-packages/pymc3/__init__.py:83, in __set_compiler_flags()
81 def __set_compiler_flags():
82 # Workarounds for Theano compiler problems on various platforms
---> 83 current = theano.config.gcc__cxxflags
84 augmented = f"{current} -Wno-c++11-narrowing"
86 # Work around compiler bug in GCC < 8.4 related to structured exception
87 # handling registers on Windows.
88 # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782 for details.
89 # First disable C++ exception handling altogether since it's not needed
90 # for the C extensions that we generate.
AttributeError: 'TheanoConfigParser' object has no attribute 'gcc__cxxflags'
I know I was able to use limb darkening with some version of starry>0.3 before on my old Ubuntu laptop, but I can't now on macOS. I do have gcc and the other CommandLineTools packages installed FYI.
Gaaah. Sorry about this. It's all in one way or another related to the fact that Theano is no longer maintained and is quickly becoming incompatible as its dependencies evolve (numpy, clang, etc). Thanks for all the debugging info -- that really helps. I'll look into this on Monday.
(BTW, if I ever have free time again I would like to re-write starry in jax...)
I can reproduce the original error is related to the fact that with recent versions of numpy(maybe?) -fno-exceptions
is included as a gcc compile argument. I can get this to work by adding before running any starry commands:
import theano
theano.config.gcc__cxxflags += " -fexceptions"
Older versions of starry/pymc/theano are probably a lost cause...
That indeed works for me - added that line just before importing starry! Thanks @dfm!
This is a bit of a tangent and I agree it's probably a lost cause to go to older versions, but I was able to install Starry 1.0 on a Silicon M1 mac with the following environment file (I was trying to compare some older results.) The instructions I wrote to myself are:
Set up a x86 environment (https://github.com/Haydnspass/miniforge#rosetta-on-mac-with-apple-silicon-hardware)
CONDA_SUBDIR=osx-64 conda env create -n Starry1p0 -f environment_starry1p0.yaml
conda activate Starry1p0
conda env config vars set CONDA_SUBDIR=osx-64
Deactivate and reactivate to make sure the changes take hold:
conda deactivate
conda activate Starry1p0
Describe the bug Trying to compute the flux of any star or system with a star that includes non-uniform limb darkening (any udeg > 0) gives me a lengthy traceback that says "Elliptic integral CEL did not converge." along with "error: cannot use \'throw\' with exceptions disabled.".
To Reproduce Any time I try to compute the flux of a limb-darkened star or system with a limb-darkened star (such as the cell below the comment "The effect of limb darkening is clear! Let's plot a transit across this object:" in the Basics.ipynb notebook) I get the following traceback. I get a similar such error for any udeg > 0 regardless of what I set the limb darkening parameters to. I also get errors anytime ffmpeg is called in the notebook but I just didn't bother to install that and am not worried about those errors.
Expected behavior A clear and concise description of what you expected to happen.
Your setup (please complete the following information):
Additional context
I have also attached the theano_compilation_error_rlmejtd5 file mentioned in the traceback (as a .txt file so I can upload it)
theano_compilation_error_rlmejtd5.txt