Note

This tutorial was generated from a Jupyter notebook that can be downloaded here.

FAQs

A non-exhaustive list of frequently asked questions about starry.

1. I get weird output when I call starry functions.

If you call a starry.Map method (or any other starry function) and get something like

Elemwise{mul,no_inplace}.0

or

TensorConstant{(1,) of 1.0}

or

Subtensor{int64}.0

that’s because you’re running starry in lazy mode. To obtain the numerical value of a variable or expression in lazy mode, simply call its .eval() method. Or, alternatively, switch to greedy mode by adding

starry.config.lazy = False

at the very top of your script, before instantiating any starry objects. All methods will automagically return numerical values in greedy mode.

2. I get a ValueError when instantiating a pymc3 model.

If you get an error like

ValueError: setting an array element with a sequence.

inside of a pymc3 model, it could be that you’re in greedy mode. If you have the line

starry.config.lazy = False

at the top of your script, simply remove it. To sample using pymc3, starry needs to be in lazy mode.

3. How do I evaluate a variable inside a pymc3 model?

If you’re in a pymc3 model context, running the .eval() method of a pymc3 variable usually results in an error similar to the following:

MissingInputError: Input 0 of the graph (indices start from 0), used to compute [something], was not provided and not given a value. Use the Theano flag exception_verbosity='high', for more information on this error.

That’s because in a pymc3 model context, none of the theano variables ever have values (“inputs”), so you get an error when you try to evaluate them the usual way. pymc3 stores things differently (using test values), so what you want to do instead is

exoplanet.eval_in_model(expression)

where expression is the pymc3 expression whose value you want. By default, this will evaluate the expression at the test point of each of the inputs. If you’ve already run the sampler and have access to a trace, you can evaluate the expression at index i of the trace by running

exoplanet.eval_in_model(expression, point=trace.point(i))

Check out the exoplanet docs for more information.

4. I can’t find what I’m looking for.

Please search all of the issues on GitHub, or open a new one.