MolarVerse / PQAnalysis

PQAnalysis is a API/CLI python package for the analysis of MD simulations
https://molarverse.github.io/PQAnalysis/
MIT License
4 stars 2 forks source link

Adjust relative tolerance based on input #75

Open 97gamjak opened 1 month ago

97gamjak commented 1 month ago

As for example the __eq__ comparison of two AtomicSystem objects is based on a lot of floating point comparisons. Would it make sense to consider the worst possible relative tolerance when reading for example trajectory files and hence make the __eq__ method automatically take this relative tolerance as default value.

Further explanation:

If we decide now to rely on the defaults of math.isclose the absoulte tolerance is set to 0.0, But the relative tolerance has a default value of 1e-9. This makes sense when a Trajectory or AtomicSystem object is directly created via the API. But if the user reads in an AtomicSystem object that has only four significant digits wouldn't it make sense to adjust the default parameter of rtol taking this into consideration? @galjos