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

Introduce quadrature.inf to denote infinite accuracy #96

Merged
merged 2 commits into from
Sep 18, 2024
Merged

Conversation

inducer
Copy link
Owner

@inducer inducer commented Sep 17, 2024

The second commit is noisy but uncontroversial. I'm mostly looking for feedback on the first.

cc @a-alveyblanc

@inducer
Copy link
Owner Author

inducer commented Sep 17, 2024

Surprising! It seems like nothing in meshmode or grudge (or the tests) seems to mind this.

Copy link
Collaborator

@alexfikl alexfikl left a comment

Choose a reason for hiding this comment

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

The first commit looks good to me!

Just wondering about the motivation. What's the reason not to just use float("inf")? Might suggest adding a little doc blurb to _Inf to justify its existence 😁

@inducer
Copy link
Owner Author

inducer commented Sep 17, 2024

Just wondering about the motivation. What's the reason not to just use float("inf")? Might suggest adding a little doc blurb to _Inf to justify its existence 😁

Mostly to avoid introducing floats there as a valid data type, following the mantra "make invalid states unrepresentable". If we did, someone could claim their quadrature is exact to polynomial degree $3.5$. 🤔

I'll add a note.

@alexfikl
Copy link
Collaborator

alexfikl commented Sep 18, 2024

Mostly to avoid introducing floats there as a valid data type, following the mantra "make invalid states unrepresentable". If we did, someone could claim their quadrature is exact to polynomial degree 3.5 . 🤔

I was thinking of something like Literal[float("inf")], but apparently that's not allowed :(
python/typing#1160

@inducer inducer merged commit 773abeb into main Sep 18, 2024
9 checks passed
@inducer inducer deleted the inf-exact-to branch September 18, 2024 17:49
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