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

'elements_ratios' model validator uses double-precision machine epsilon - could be relaxed #947

Closed
ml-evs opened this issue Sep 22, 2021 · 0 comments · Fixed by #948
Closed
Labels
models For issues related to the pydantic models directly priority/medium Issue or PR with a consensus of medium priority

Comments

@ml-evs
Copy link
Member

ml-evs commented Sep 22, 2021

Somewhat related to #735.

Currently we compare sum(elements_ratios) - 1 to sys.float_info.epsilon. A fairer comparison might be to compare to single-precision representations (as the spec just says floating point).

@ml-evs ml-evs added priority/medium Issue or PR with a consensus of medium priority models For issues related to the pydantic models directly labels Sep 22, 2021
@ml-evs ml-evs mentioned this issue Sep 22, 2021
4 tasks
@ml-evs ml-evs changed the title 'elements_ratios' model validator uses machine-specific epsilon 'elements_ratios' model validator uses double-precision machine epsilon - could be relaxed Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
models For issues related to the pydantic models directly priority/medium Issue or PR with a consensus of medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant