Skip to content

Conversation

@leaver2000
Copy link
Contributor

Description Of Changes

Size check to insure a non-zero sized array prior to calling np.min(el_pressure) > this_lcl[0] which was throwing a ValueError("zero-size array to reduction operation minimum which has no identity").

As a quick example, here is the result of MUCAPE prior to the fix, where the error was caught and nan values were inserted. white represents those missing values.

image

Post fix; the calculation is using the LCL as the LFC and this is the result.

image

Checklist

@leaver2000 leaver2000 requested a review from a team as a code owner April 19, 2025 08:36
@leaver2000 leaver2000 requested review from dcamron and removed request for a team April 19, 2025 08:36
@CLAassistant
Copy link

CLAassistant commented Apr 19, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking over the logic, not to mention your graphics above, I agree that this is the correct solution. (Contrary to my comment in the issue.)

@dopplershift dopplershift added Type: Bug Something is not working like it should Area: Calc Pertains to calculations labels Apr 21, 2025
@dopplershift dopplershift added this to the 1.7.0 milestone Apr 21, 2025
@dopplershift dopplershift merged commit e4aa15f into Unidata:main Apr 21, 2025
39 checks passed
@dopplershift
Copy link
Member

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Calc Pertains to calculations Type: Bug Something is not working like it should

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError: zero-size array to reduction operation minimum which has no identity

3 participants