Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating comparisons #497

Merged
merged 4 commits into from
Jul 16, 2017
Merged

Floating comparisons #497

merged 4 commits into from
Jul 16, 2017

Conversation

jrleeman
Copy link
Contributor

Adds functions to compare floating point values in a greater/less than or near to sense. I also removed the conversion in the CAPE/CIN test that helped @tjwixtrom find the bug initially. Closes #488

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.

Minor nits

r"""Compare values for greater or close to boolean masks.

Returns a boolean mask for values greater than or equal to a target within a specified
absolute or relative tolerance (as in np.isclose).
Copy link
Member

@dopplershift dopplershift Jul 16, 2017

Choose a reason for hiding this comment

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

How about :func:\numpy.isclose`` so we can get cross doc linking to work?

r"""Compare values for less or close to boolean masks.

Returns a boolean mask for values less than or equal to a target within a specified
absolute or relative tolerance (as in np.isclose).
Copy link
Member

Choose a reason for hiding this comment

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

Same

There were edge cases where greater/less than or equal to would suffer from
precision issues and drop an extra point in the sounding. Modify them to use
our approximate comparisons.
The initial way this bug was found was by not convering the output of parcel_profile
in the test. It is removed now and tests that those comparisons are working.
@jrleeman jrleeman merged commit 5b2ef8c into Unidata:master Jul 16, 2017
@jrleeman jrleeman deleted the FloatingComparisons branch July 16, 2017 14:25
@dopplershift dopplershift added Area: Calc Pertains to calculations Type: Bug Something is not working like it should labels Jul 16, 2017
@dopplershift dopplershift added this to the Summer 2017 milestone Jul 16, 2017
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.

2 participants