Closed jdossgollin closed 5 years ago
I think you may just need to change (temp)
to (temp, )
. The comma indicates that you want the result to be a length-1 tuple (otherwise Python just evaluates the expression in parentheses, which in the case of (temp)
is just temp
).
You can also specify them as a list rather than a tuple. That way, you don't have to worry about remembering the comma for length-1 cases: [temp]
rather than (temp,)
That works, thanks -- can I close this?
When running calculations which use only one variable I run into
calculations.py
has the following content:and
variables.py
hasInterestingly, if I change things so that
meridional_gradient
takes in a second argumentdef meridional_gradient(temp: xr.DataArray, discard: xr.DataArray) -> xr.DataArray:
and change thevariables
accordinglyvariables=(temp, temp),
it works. Is there a way to run calculations that just take in a single variable?