Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR should fix the failing test by fixing what I think was a bug in input handling.
It is extremely unlikely that this bug caused any calculations to be wrong! It's more about fixing an error message that will be incorrectly generated when using pressure levels.
What was the problem?
Essentially, the problem seems to be that we used to have two different gufunc signatures depending on whether
vertical_lev
wassigma
orpressure
, indicating that the core functions (e.g._calc_cape_numpy
) should have either 6 (sigma) or 7 (pressure) arguments. However, in the tests calling this code, e.g.xcape/test/test_core.py
Line 125 in 1cd1418
we only ever have 6 arguments:
p, t, td, ps, ts, tds
.This PR should make all the tests pass by simply removing the special case for pressure.
Why was it working before (in python 3.6)? My theory is that the older version of dask in that env simply didn't check whether the inputs passed to
apply_gufunc
were consistent with the signature.How I fixed it
I just made the gufunc signature the same for both sigma and pressure level.
How you can help
@chiaral & @xebadir: can you please share any code examples you have of using xcape with pressure-level data? I am trying to figure out why we had this special case for pressure level inputs. Can you think of any reason why we might have thought that pressure level data would need one more input argument than sigma level data?