Skip to content

Conversation

@dschwoerer
Copy link
Collaborator

No description provided.

Comment on lines +288 to +291
try:
import shapely
except ImportError:
pass
Copy link
Member

Choose a reason for hiding this comment

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

Why not add this to the dependencies and always do this check?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It felt a bit overkill to require shapely for such a simple check.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should I add shapely as a dependency?

Copy link
Member

Choose a reason for hiding this comment

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

I mean, it's not a huge dependency, so may as well?

Comment on lines 294 to 295
inner = shapely.Polygon(zip(R[2], Z[2]))
outer = shapely.Polygon(zip(R[-2], Z[-2]))
Copy link
Member

Choose a reason for hiding this comment

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

Should these slices be ranges? Or are we really just interested in R[2], Z[2]?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, just the inner and outer boundary should be checked.
Of course we could check all slices, and make sure they are monotonically increasing, but I think just those two should suffice.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I meant that these really look like scalars -- what shape does R[2] have?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

R and Z are 2D, thus R[2] is a 1D array of a contour.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, then I would prefer to write this as R[2, ...], which makes it much clearer

@dschwoerer
Copy link
Collaborator Author

dschwoerer commented Dec 3, 2025 via email

@dschwoerer dschwoerer requested a review from ZedThree December 15, 2025 09:50
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.

3 participants