lmfit / uncertainties

Transparent calculations with uncertainties on the quantities involved (aka "error propagation"); calculation of derivatives.
http://uncertainties.readthedocs.io/
Other
576 stars 74 forks source link

errors under msys2 environment package creation #157

Open wongtenit opened 2 years ago

wongtenit commented 2 years ago

Errors shown during "test_PDG_precision" under msys2 environment.

first error: for (std_dev, result) in tests.items(): assert uncert_core.PDG_precision(std_dev) == result E assert (2, 1.0000000000000006e+308) == (2, 1e+308) E At index 1 diff: 1.0000000000000006e+308 != 1e+308 E Use -v to get more diff

uncertainties/test_uncertainties.py:1526: AssertionError

second error: assert representation == result, (

The representation is used, for terminal that do not

                # support some characters like ▒, and superscripts:
                'Incorrect representation %r for format %r of %r:'
                ' %r expected.'
                % (representation, format_spec, value, result))

E AssertionError: Incorrect representation '-1.1999999999999982(0)e-12' for format '13S' of -1.2e-12+/-0: ' -1.2(0)e-12' expected. E assert '-1.1999999999999982(0)e-12' == ' -1.2(0)e-12' E - -1.2(0)e-12 E + -1.1999999999999982(0)e-12

uncertainties/test_uncertainties.py:2071: AssertionError

May I have guidance on how to rectify these two errors. Aim is to use uncertainties for lmfit package. https://lmfit.github.io/lmfit-py/installation.html

lebigot commented 2 years ago

The first error does not indicate a problem (but only some unusual floating point rounding error). I will modify the testing code so that it passes even on MSYS2.

The second error obviously also come from floating point rounding errors. I need to investigate what the standard behavior of the "13S" format should be so as to see if the unusual rounding error from MSYS2 should indeed produce the observed result or not. I'll get back to you.

wongtenit commented 2 years ago

The first error does not indicate a problem (but only some unusual floating point rounding error). I will modify the testing code so that it passes even on MSYS2.

The second error obviously also come from floating point rounding errors. I need to investigate what the standard behavior of the "13S" format should be so as to see if the unusual rounding error from MSYS2 should indeed produce the observed result or not. I'll get back to you.

Hi Eric, thank you for your generous helps and time. Please let me know if there is anything for a layman like me can do, in hope not messing up your codes.

One question: is that possible for me to create a package for "uncertainties" and list is as a package in msys2?

lebigot commented 2 years ago

As for the MSYS2 package, that would actually be great, as it can help people find it and use it. The code is free, so you can do many things with it (please follow the license instructions, though).

wongtenit commented 2 years ago

Great to know that, thank you.