Thanks to visit codestin.com
Credit goes to github.com

Skip to content

馃悰馃敤 on zero-size array to reduction operation in lfc when there is no el - #3796

Merged
dopplershift merged 1 commit into
Unidata:mainfrom
leaver2000:bugfix/issue-3795
Apr 21, 2025
Merged

馃悰馃敤 on zero-size array to reduction operation in lfc when there is no el#3796
dopplershift merged 1 commit into
Unidata:mainfrom
leaver2000:bugfix/issue-3795

Conversation

@leaver2000

Copy link
Copy Markdown
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

CLAassistant commented Apr 19, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dopplershift dopplershift left a comment

Copy link
Copy Markdown
Member

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
@dopplershift

Copy link
Copy Markdown
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