lmfit / uncertainties

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

Use cases and examples #166

Open mocquin opened 2 years ago

mocquin commented 2 years ago

Is there a place I could find use-cases or in-depth examples outside of the doc ? I am trying to build a unit-test list that is inspired by real-life use of uncertainties. Maybe some known projects that uses uncertainties ?

lebigot commented 2 years ago

I am not aware of any specific example of usage, but if I remember correctly, many hundreds of projects on the web use it. I'm not yet sure how to find them, though.

mocquin commented 2 years ago

The dependency list gives a start, although browsing through it I could not find much examples.

I started from the examples of the documentation and set up few tests here

I'd be curious to have your thoughts about it. FYI out of 30 assertions, I get 2 failures and 3 errors.

lebigot commented 2 years ago

Ah, good find! That's what I had in mind when I was mentioning "hundreds of projects" using uncertainties (actually 1,400 it seems).

I had a quick look at the tests you set up. Thanks!

I have a couple of comments:

  1. I see you measure some execution time: the timeit module is more appropriate, as it takes care of subtleties.
  2. You know that the code of uncertainties already contains quite many tests, right? They are in the test….py files. Now, they could be adapted (if needed) to a more recent Python testing module than nosetests. :)