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

test[next]: Add unit test for embedded inverse_image and fix bugs #1432

Merged
merged 6 commits into from
Jan 31, 2024

Conversation

egparedes
Copy link
Contributor

@egparedes egparedes commented Jan 30, 2024

Add unit test for ConnectivityField.inverse_image().

@egparedes egparedes requested a review from havogt January 30, 2024 11:05
Copy link
Contributor

@havogt havogt left a comment

Choose a reason for hiding this comment

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

I'd like to discuss the corner cases in the 2d case (also for understanding the extension to the one with skip values.

@@ -632,3 +632,59 @@ def test_setitem_wrong_domain():

with pytest.raises(ValueError, match=r"Incompatible 'Domain'.*"):
field[(1, slice(None))] = value_incompatible


Copy link
Contributor

Choose a reason for hiding this comment

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

maybe also add a testcase with a 2D connectivity?

Copy link
Contributor

Choose a reason for hiding this comment

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

To be honest I don't really understand if it makes sense to restrict the connectivity in that case. I have to think about it.

Copy link
Contributor

Choose a reason for hiding this comment

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

note to myself:

Start from this case and look at corner cases

E_START, E_STOP = 0, 1
V_START, V_STOP = 0, 1

e2v_conn = common._connectivity([0,1], domain=domain(named_range(E,1), named_range(E2V, 2)))

the inverse image is probably

domain(named_range(E,0), named_range(E2V, 1))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added some cases to test 2d connectivities

Copy link
Contributor

@havogt havogt left a comment

Choose a reason for hiding this comment

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

👍

@egparedes egparedes merged commit e4dc1ee into GridTools:main Jan 31, 2024
28 checks passed
Sign up for free to 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