rodluger / starry

Tools for mapping stars and planets.
https://starry.readthedocs.io
MIT License
144 stars 33 forks source link

Unable to use limb darkening #302

Open taylorbell57 opened 2 years ago

taylorbell57 commented 2 years ago

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.

You can find the C code in this temporary file: /var/folders/f3/_h5lxm511fv9sjb5d3xrj0jm0000gq/T/theano_compilation_error_rlmejtd5
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
Input In [37], in <cell line: 11>()
      9 # Compute and plot the light curve
     10 plt.figure(figsize=(12, 5))
---> 11 plt.plot(time, map.flux(xo=xo, yo=yo, ro=ro, zo=zo))
     12 plt.xlabel("Time [arbitrary]", fontsize=20)
     13 plt.ylabel("Flux [normalized]", fontsize=20)

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/starry/maps.py:1832, in LimbDarkenedBase.flux(self, **kwargs)
   1829 xo, yo, zo, ro = self._get_flux_kwargs(kwargs)
   1831 # Compute & return
-> 1832 return self.amp * self.ops.flux(xo, yo, zo, ro, self._u)

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/starry/_core/utils.py:161, in autocompile.<locals>.wrapper(instance, *args)
    159     with CompileLogMessage(func.__name__):
    160         with change_flags(compute_test_value="off"):
--> 161             compiled_func = theano.function(
    162                 [*dummy_args],
    163                 func(instance, *dummy_args),
    164                 on_unused_input="ignore",
    165                 profile=config.profile,
    166                 mode=config.mode,
    167             )
    168         setattr(instance, cname, compiled_func)
    170 # Return the compiled version

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/compile/function/__init__.py:337, in function(inputs, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input)
    331     fn = orig_function(
    332         inputs, outputs, mode=mode, accept_inplace=accept_inplace, name=name
    333     )
    334 else:
    335     # note: pfunc will also call orig_function -- orig_function is
    336     #      a choke point that all compilation must pass through
--> 337     fn = pfunc(
    338         params=inputs,
    339         outputs=outputs,
    340         mode=mode,
    341         updates=updates,
    342         givens=givens,
    343         no_default_updates=no_default_updates,
    344         accept_inplace=accept_inplace,
    345         name=name,
    346         rebuild_strict=rebuild_strict,
    347         allow_input_downcast=allow_input_downcast,
    348         on_unused_input=on_unused_input,
    349         profile=profile,
    350         output_keys=output_keys,
    351     )
    352 return fn

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/compile/function/pfunc.py:524, in pfunc(params, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input, output_keys)
    519         si = In(
    520             variable=sv, value=sv.container, mutable=False, borrow=True, shared=True
    521         )
    522     inputs.append(si)
--> 524 return orig_function(
    525     inputs,
    526     cloned_outputs,
    527     mode,
    528     accept_inplace=accept_inplace,
    529     name=name,
    530     profile=profile,
    531     on_unused_input=on_unused_input,
    532     output_keys=output_keys,
    533 )

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/compile/function/types.py:1981, in orig_function(inputs, outputs, mode, accept_inplace, name, profile, on_unused_input, output_keys)
   1970     m = Maker(
   1971         inputs,
   1972         outputs,
   (...)
   1978         name=name,
   1979     )
   1980     with config.change_flags(compute_test_value="off"):
-> 1981         fn = m.create(defaults)
   1982 finally:
   1983     t2 = time.time()

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/compile/function/types.py:1836, in FunctionMaker.create(self, input_storage, trustme, storage_map)
   1833 start_import_time = theano.link.c.cmodule.import_time
   1835 with config.change_flags(traceback__limit=config.traceback__compile_limit):
-> 1836     _fn, _i, _o = self.linker.make_thunk(
   1837         input_storage=input_storage_lists, storage_map=storage_map
   1838     )
   1840 end_linker = time.time()
   1842 linker_time = end_linker - start_linker

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/link/basic.py:266, in LocalLinker.make_thunk(self, input_storage, output_storage, storage_map)
    265 def make_thunk(self, input_storage=None, output_storage=None, storage_map=None):
--> 266     return self.make_all(
    267         input_storage=input_storage,
    268         output_storage=output_storage,
    269         storage_map=storage_map,
    270     )[:3]

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/link/vm.py:1131, in VMLinker.make_all(self, profiler, input_storage, output_storage, storage_map)
   1126 thunk_start = time.time()
   1127 # no-recycling is done at each VM.__call__ So there is
   1128 # no need to cause duplicate c code by passing
   1129 # no_recycling here.
   1130 thunks.append(
-> 1131     node.op.make_thunk(node, storage_map, compute_map, [], impl=impl)
   1132 )
   1133 linker_make_thunk_time[node] = time.time() - thunk_start
   1134 if not hasattr(thunks[-1], "lazy"):
   1135     # We don't want all ops maker to think about lazy Ops.
   1136     # So if they didn't specify that its lazy or not, it isn't.
   1137     # If this member isn't present, it will crash later.

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/graph/op.py:634, in COp.make_thunk(self, node, storage_map, compute_map, no_recycling, impl)
    630 self.prepare_node(
    631     node, storage_map=storage_map, compute_map=compute_map, impl="c"
    632 )
    633 try:
--> 634     return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
    635 except (NotImplementedError, MethodNotDefined):
    636     # We requested the c code, so don't catch the error.
    637     if impl == "c":

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/graph/op.py:600, in COp.make_c_thunk(self, node, storage_map, compute_map, no_recycling)
    598         print(f"Disabling C code for {self} due to unsupported float16")
    599         raise NotImplementedError("float16")
--> 600 outputs = cl.make_thunk(
    601     input_storage=node_input_storage, output_storage=node_output_storage
    602 )
    603 thunk, node_input_filters, node_output_filters = outputs
    605 def rval():

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/link/c/basic.py:1203, in CLinker.make_thunk(self, input_storage, output_storage, storage_map)
   1175 """
   1176 Compiles this linker's fgraph and returns a function to perform the
   1177 computations, as well as lists of storage cells for both the inputs
   (...)
   1200   first_output = ostor[0].data
   1201 """
   1202 init_tasks, tasks = self.get_init_tasks()
-> 1203 cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
   1204     input_storage, output_storage, storage_map
   1205 )
   1207 res = _CThunk(cthunk, init_tasks, tasks, error_storage, module)
   1208 res.nodes = self.node_order

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/link/c/basic.py:1138, in CLinker.__compile__(self, input_storage, output_storage, storage_map)
   1136 input_storage = tuple(input_storage)
   1137 output_storage = tuple(output_storage)
-> 1138 thunk, module = self.cthunk_factory(
   1139     error_storage,
   1140     input_storage,
   1141     output_storage,
   1142     storage_map,
   1143 )
   1144 return (
   1145     thunk,
   1146     module,
   (...)
   1155     error_storage,
   1156 )

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/link/c/basic.py:1634, in CLinker.cthunk_factory(self, error_storage, in_storage, out_storage, storage_map)
   1632     for node in self.node_order:
   1633         node.op.prepare_node(node, storage_map, None, "c")
-> 1634     module = get_module_cache().module_from_key(key=key, lnk=self)
   1636 vars = self.inputs + self.outputs + self.orphans
   1637 # List of indices that should be ignored when passing the arguments
   1638 # (basically, everything that the previous call to uniq eliminated)

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/link/c/cmodule.py:1191, in ModuleCache.module_from_key(self, key, lnk)
   1189 try:
   1190     location = dlimport_workdir(self.dirname)
-> 1191     module = lnk.compile_cmodule(location)
   1192     name = module.__file__
   1193     assert name.startswith(location)

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/link/c/basic.py:1543, in CLinker.compile_cmodule(self, location)
   1541 try:
   1542     _logger.debug(f"LOCATION {location}")
-> 1543     module = c_compiler.compile_str(
   1544         module_name=mod.code_hash,
   1545         src_code=src_code,
   1546         location=location,
   1547         include_dirs=self.header_dirs(),
   1548         lib_dirs=self.lib_dirs(),
   1549         libs=libs,
   1550         preargs=preargs,
   1551     )
   1552 except Exception as e:
   1553     e.args += (str(self.fgraph),)

File ~/miniconda3/envs/starry/lib/python3.9/site-packages/theano/link/c/cmodule.py:2546, in GCC_compiler.compile_str(module_name, src_code, location, include_dirs, lib_dirs, libs, preargs, py_module, hide_symbols)
   2542     # We replace '\n' by '. ' in the error message because when Python
   2543     # prints the exception, having '\n' in the text makes it more
   2544     # difficult to read.
   2545     compile_stderr = compile_stderr.replace("\n", ". ")
-> 2546     raise Exception(
   2547         f"Compilation failed (return status={status}): {compile_stderr}"
   2548     )
   2549 elif config.cmodule__compilation_warning and compile_stderr:
   2550     # Print errors just below the command line.
   2551     print(compile_stderr)

Exception: ('The following error happened while compiling the node', GetClOp(<TensorType(float64, vector)>), '\n', 'Compilation failed (return status=1): In file included from /Users/tjbell1/.theano/compiledir_macOS-11.6.5-x86_64-i386-64bit-i386-3.9.7-64/tmpqoie3ylj/mod.cpp:8:. /Users/tjbell1/miniconda3/envs/starry/lib/python3.9/site-packages/starry/_core/ops/lib/include/ellip.h:56:5: error: cannot use \'throw\' with exceptions disabled.     throw std::runtime_error("Elliptic integral `CEL` ".     ^. /Users/tjbell1/miniconda3/envs/starry/lib/python3.9/site-packages/starry/_core/ops/lib/include/ellip.h:103:3: error: cannot use \'throw\' with exceptions disabled.   throw std::runtime_error("Elliptic integral CEL did not converge.");.   ^. /Users/tjbell1/miniconda3/envs/starry/lib/python3.9/site-packages/starry/_core/ops/lib/include/ellip.h:132:5: error: cannot use \'throw\' with exceptions disabled.     throw std::invalid_argument(.     ^. /Users/tjbell1/miniconda3/envs/starry/lib/python3.9/site-packages/starry/_core/ops/lib/include/ellip.h:215:5: error: cannot use \'throw\' with exceptions disabled.     throw std::runtime_error("Elliptic integral CEL did not converge.");.     ^. In file included from /Users/tjbell1/.theano/compiledir_macOS-11.6.5-x86_64-i386-64bit-i386-3.9.7-64/tmpqoie3ylj/mod.cpp:9:. /Users/tjbell1/miniconda3/envs/starry/lib/python3.9/site-packages/starry/_core/ops/lib/include/limbdark.h:368:5: error: cannot use \'throw\' with exceptions disabled.     throw std::runtime_error(.     ^. /Users/tjbell1/miniconda3/envs/starry/lib/python3.9/site-packages/starry/_core/ops/lib/include/limbdark.h:467:5: error: cannot use \'throw\' with exceptions disabled.     throw std::runtime_error(.     ^. 6 errors generated.. ', 'FunctionGraph(GetClOp(<TensorType(float64, vector)>))')

<Figure size 1200x500 with 0 Axes>

Expected behavior A clear and concise description of what you expected to happen.

Your setup (please complete the following information):

Additional context

silurian:notebooks tjbell1$ python --version
Python 3.9.7
silurian:notebooks tjbell1$ conda info
/Users/tjbell1/miniconda3/lib/python3.9/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")

     active environment : starry
    active env location : /Users/tjbell1/miniconda3/envs/starry
            shell level : 2
       user config file : /Users/tjbell1/.condarc
 populated config files : /Users/tjbell1/.condarc
          conda version : 4.12.0
    conda-build version : not installed
         python version : 3.9.10.final.0
       virtual packages : __osx=11.6.5=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/tjbell1/miniconda3  (writable)
      conda av data dir : /Users/tjbell1/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/tjbell1/miniconda3/pkgs
                          /Users/tjbell1/.conda/pkgs
       envs directories : /Users/tjbell1/miniconda3/envs
                          /Users/tjbell1/.conda/envs
               platform : osx-64
             user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.10 Darwin/20.6.0 OSX/11.6.5
                UID:GID : 503:20
             netrc file : None
           offline mode : False
silurian:notebooks tjbell1$ pip list
Package                Version
---------------------- --------
aesara-theano-fallback 0.1.0
appnope                0.1.3
argon2-cffi            21.3.0
argon2-cffi-bindings   21.2.0
arviz                  0.12.0
astropy                5.0.4
asttokens              2.0.5
attrs                  21.4.0
backcall               0.2.0
beautifulsoup4         4.11.0
bleach                 5.0.0
bokeh                  2.4.2
cachetools             5.0.0
cffi                   1.15.0
cftime                 1.6.0
corner                 2.2.1
cycler                 0.11.0
debugpy                1.6.0
decorator              5.1.1
defusedxml             0.7.1
deprecat               2.1.1
dill                   0.3.4
entrypoints            0.4
executing              0.8.3
exoplanet              0.5.2
exoplanet-core         0.1.2
fastjsonschema         2.15.3
fastprogress           1.0.2
ffmpeg-python          0.2.0
filelock               3.6.0
fonttools              4.32.0
future                 0.18.2
ipykernel              6.12.1
ipython                8.2.0
ipython-genutils       0.2.0
ipywidgets             7.7.0
jedi                   0.18.1
Jinja2                 3.1.1
jsonschema             4.4.0
jupyter                1.0.0
jupyter-client         7.2.2
jupyter-console        6.4.3
jupyter-core           4.9.2
jupyterlab-pygments    0.2.0
jupyterlab-widgets     1.1.0
kiwisolver             1.4.2
MarkupSafe             2.1.1
matplotlib             3.5.1
matplotlib-inline      0.1.3
mistune                0.8.4
mkl-service            2.4.0
nbclient               0.5.13
nbconvert              6.4.5
nbformat               5.3.0
nest-asyncio           1.5.5
netCDF4                1.5.8
notebook               6.4.10
numpy                  1.21.5
packaging              21.3
pandas                 1.4.2
pandocfilters          1.5.0
parso                  0.8.3
patsy                  0.5.2
pexpect                4.8.0
pickleshare            0.7.5
Pillow                 9.1.0
pip                    22.0.4
prometheus-client      0.14.1
prompt-toolkit         3.0.29
psutil                 5.9.0
ptyprocess             0.7.0
pure-eval              0.2.2
pycparser              2.21
pyerfa                 2.0.0.1
Pygments               2.11.2
pymc3                  3.11.5
pymc3-ext              0.1.1
pyparsing              3.0.7
pyrsistent             0.18.1
python-dateutil        2.8.2
pytz                   2022.1
PyYAML                 6.0
pyzmq                  22.3.0
qtconsole              5.3.0
QtPy                   2.0.1
scipy                  1.7.3
semver                 2.13.0
Send2Trash             1.8.0
setuptools             62.0.0
setuptools-scm         6.4.2
six                    1.16.0
soupsieve              2.3.2
stack-data             0.2.0
starry                 1.2.0
terminado              0.13.3
testpath               0.6.0
Theano-PyMC            1.1.2
tomli                  2.0.1
tornado                6.1
tqdm                   4.64.0
traitlets              5.1.1
typing_extensions      4.1.1
wcwidth                0.2.5
webencodings           0.5.1
wheel                  0.37.1
widgetsnbextension     3.6.0
wrapt                  1.14.0
xarray                 2022.3.0

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

taylorbell57 commented 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.

rodluger commented 2 years ago

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.

rodluger commented 2 years ago

(BTW, if I ever have free time again I would like to re-write starry in jax...)

dfm commented 2 years ago

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...

taylorbell57 commented 2 years ago

That indeed works for me - added that line just before importing starry! Thanks @dfm!

eas342 commented 2 years ago

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:

  1. 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
  2. Deactivate and reactivate to make sure the changes take hold:

    conda deactivate
    conda activate Starry1p0
content of environment_starry1p0.yaml ``` yaml name: Starry1p0 channels: - defaults dependencies: - blas=1.0=mkl - ca-certificates=2021.10.26=hecd8cb5_2 - cctools_osx-64=949.0.1=hc7db93f_23 - certifi=2021.5.30=py36hecd8cb5_0 - clang=12.0.0=hecd8cb5_2 - clang-12=12.0.0=default_hfcad0e5_2 - clang_osx-64=12.0.0=h7ad7729_2 - clangxx=12.0.0=default_hfcad0e5_2 - clangxx_osx-64=12.0.0=he0c6f94_2 - compiler-rt=12.0.0=hd87ff74_2 - compiler-rt_osx-64=12.0.0=hfb26b64_2 - intel-openmp=2021.4.0=hecd8cb5_3538 - ld64_osx-64=530=h70f3046_23 - ldid=2.1.2=h2d21305_2 - libclang-cpp12=12.0.0=default_hfcad0e5_2 - libcxx=12.0.0=h2f01273_0 - libffi=3.3=hb1e8313_2 - libgfortran=3.0.1=h93005f0_2 - libllvm12=12.0.0=h9b2ccf5_3 - llvm-tools=12.0.0=h9b2ccf5_3 - mkl=2019.4=233 - mkl-service=2.3.0=py36h9ed2024_0 - mkl_fft=1.3.0=py36ha059aab_0 - mkl_random=1.1.1=py36h959d312_0 - ncurses=6.3=hca72f7f_2 - openssl=1.1.1l=h9ed2024_0 - pip=21.2.2=py36hecd8cb5_0 - python=3.6.13=h88f2d9e_0 - readline=8.1=h9ed2024_0 - setuptools=58.0.4=py36hecd8cb5_0 - six=1.16.0=pyhd3eb1b0_0 - sqlite=3.37.0=h707629a_0 - tapi=1000.10.8=ha1b3eb9_0 - theano=1.0.4=py36h04f5b5a_0 - tk=8.6.11=h7bc2e8c_0 - wheel=0.37.0=pyhd3eb1b0_1 - xz=5.2.5=h1de35cc_0 - zlib=1.2.11=h4dc903c_4 - pip: - aesara-theano-fallback==0.0.4 - alabaster==0.7.12 - appnope==0.1.2 - argon2-cffi==21.3.0 - argon2-cffi-bindings==21.2.0 - arviz==0.11.1 - astropy==4.1 - async-generator==1.10 - attrs==21.4.0 - babel==2.9.1 - backcall==0.2.0 - bleach==4.1.0 - celerite2==0.2.0 - cffi==1.15.0 - cftime==1.5.1.1 - charset-normalizer==2.0.10 - colorama==0.4.4 - contextvars==2.4 - corner==2.2.1 - cycler==0.11.0 - dataclasses==0.8 - decorator==5.1.0 - defusedxml==0.7.1 - dill==0.3.4 - docutils==0.17.1 - entrypoints==0.3 - exoplanet==0.4.5 - exoplanet-core==0.1.2 - fastprogress==1.0.0 - idna==3.3 - imagesize==1.3.0 - immutables==0.16 - importlib-metadata==4.8.3 - ipykernel==5.5.6 - ipython==7.16.2 - ipython-genutils==0.2.0 - ipywidgets==7.6.5 - jedi==0.17.2 - jinja2==3.0.3 - jsonschema==3.2.0 - jupyter==1.0.0 - jupyter-client==7.1.0 - jupyter-console==6.4.0 - jupyter-core==4.9.1 - jupyterlab-pygments==0.1.2 - jupyterlab-widgets==1.0.2 - keyring==23.4.1 - kiwisolver==1.3.1 - markupsafe==2.0.1 - matplotlib==3.3.4 - mistune==0.8.4 - nbclient==0.5.9 - nbconvert==6.0.7 - nbformat==5.1.3 - nest-asyncio==1.5.4 - netcdf4==1.5.8 - notebook==6.4.6 - numpy==1.19.5 - packaging==21.3 - pandas==1.1.5 - pandocfilters==1.5.0 - parso==0.7.1 - patsy==0.5.2 - pexpect==4.8.0 - pickleshare==0.7.5 - pillow==8.4.0 - pkginfo==1.8.2 - prometheus-client==0.12.0 - prompt-toolkit==3.0.24 - ptyprocess==0.7.0 - pybind11==2.9.0 - pycparser==2.21 - pygments==2.11.1 - pymc3==3.10.0 - pymc3-ext==0.1.0 - pyparsing==3.0.6 - pyrsistent==0.18.0 - python-dateutil==2.8.2 - pytz==2021.3 - pyyaml==6.0 - pyzmq==22.3.0 - qtconsole==5.2.2 - qtpy==2.0.0 - requests==2.27.0 - scipy==1.5.4 - send2trash==1.8.0 - setuptools-scm==6.3.2 - snowballstemmer==2.2.0 - sphinx==4.3.2 - sphinxcontrib-applehelp==1.0.2 - sphinxcontrib-devhelp==1.0.2 - sphinxcontrib-htmlhelp==2.0.0 - sphinxcontrib-jsmath==1.0.1 - sphinxcontrib-qthelp==1.0.3 - sphinxcontrib-serializinghtml==1.1.5 - starry==1.0.0 - terminado==0.12.1 - testpath==0.5.0 - theano-pymc==1.0.11 - tomli==1.2.3 - tornado==6.1 - tqdm==4.62.3 - traitlets==4.3.3 - typing-extensions==3.10.0.2 - urllib3==1.26.7 - wcwidth==0.2.5 - webencodings==0.5.1 - widgetsnbextension==3.5.2 - xarray==0.16.2 - zipp==3.6.0 variables: CONDA_SUBDIR: osx-64 prefix: /Users/everettschlawin/miniconda3/envs/BEMStarry1p0 ```