Skip to content

numerical tolerance - #1641

Merged
bjlittle merged 2 commits into
SciTools:v1.8.xfrom
marqh:intersectionBug
Apr 22, 2015
Merged

numerical tolerance#1641
bjlittle merged 2 commits into
SciTools:v1.8.xfrom
marqh:intersectionBug

Conversation

@marqh

Copy link
Copy Markdown
Member

There is a bug in the cube intersection code where

np.where(pre_wrap_delta != post_wrap_delta)

can return a result due to numerical tolerances in the floating point coordinate value

I have trapped this and added a test. This is a reported bug against 1.8.0, so please may it be targeted at the 1.8.1 milestone?

thank you

@bjlittlebjlittle added this to the v1.8.1 milestone Apr 22, 2015
Comment threadlib/iris/cube.py Outdated

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.

@marqh You could simply refactor this to be the following ...

close_enough=np.allclose(pre_wrap_delta, post_wrap_delta)
ifnotclose_enough:
split_cell_indices, _=np.where(pre_wrap_delta!=post_wrap_delta)
# Re-calaulate the extended minimum.indices=inside_indices[split_cell_indices]
cells=bounds[indices]
....

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

that looks neater

@bjlittlebjlittle self-assigned this Apr 22, 2015
@bjlittle

Copy link
Copy Markdown
Member

@marqh Great, thanks 👍

bjlittle added a commit that referenced this pull request Apr 22, 2015
@bjlittle
bjlittle merged commit f77170e into SciTools:v1.8.xApr 22, 2015
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@marqh@bjlittle