-
Notifications
You must be signed in to change notification settings - Fork 84
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
docs: Truncate floating point docstring examples to 8 decimal places #1726
docs: Truncate floating point docstring examples to 8 decimal places #1726
Conversation
src/pyhf/cli/infer.py
Outdated
@@ -69,14 +69,14 @@ def fit( | |||
{ | |||
"mle_parameters": { | |||
"mu": [ | |||
0.00017298628839781602 | |||
0.000172986... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These truncations might be debatable of use. I'm open to changes and suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relevant RTD build https://pyhf--1726.org.readthedocs.build/en/1726/cli.html#pyhf-cls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't actually being tested in the doctest, so we can ignore them and revert the changes
$ pytest -r sx src/
=========================================================================================== test session starts ===========================================================================================
platform linux -- Python 3.9.6, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
Matplotlib: 3.5.0
Freetype: 2.6.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/feickert/Code/GitHub/pyhf, configfile: pyproject.toml
plugins: mock-3.6.1, console-scripts-1.2.1, mpl-0.13, requests-mock-1.9.3, benchmark-3.4.1, cov-3.0.0, anyio-3.3.3
collected 123 items
src/pyhf/compat.py .. [ 1%]
src/pyhf/events.py .. [ 3%]
src/pyhf/patchset.py . [ 4%]
src/pyhf/pdf.py ....... [ 9%]
src/pyhf/probability.py ....... [ 15%]
src/pyhf/simplemodels.py .. [ 17%]
src/pyhf/utils.py .. [ 18%]
src/pyhf/contrib/utils.py . [ 19%]
src/pyhf/contrib/viz/brazil.py ... [ 21%]
src/pyhf/infer/__init__.py . [ 22%]
src/pyhf/infer/calculators.py .............. [ 34%]
src/pyhf/infer/intervals.py . [ 34%]
src/pyhf/infer/mle.py ... [ 37%]
src/pyhf/infer/test_statistics.py ..... [ 41%]
src/pyhf/infer/utils.py .. [ 43%]
src/pyhf/tensor/jax_backend.py ................ [ 56%]
src/pyhf/tensor/manager.py .. [ 57%]
src/pyhf/tensor/numpy_backend.py ................ [ 70%]
src/pyhf/tensor/pytorch_backend.py ................. [ 84%]
src/pyhf/tensor/tensorflow_backend.py ................... [100%]
============================================================================================ warnings summary =============================================================================================
Codecov Report
@@ Coverage Diff @@
## master #1726 +/- ##
=======================================
Coverage 98.12% 98.12%
=======================================
Files 64 64
Lines 4270 4270
Branches 683 683
=======================================
Hits 4190 4190
Misses 46 46
Partials 34 34
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
f819a23
to
6df812d
Compare
Description
Resolves #1629
To harden the docs and doctests against floating point noise due to changes in backend libraries or operating systems, truncate all floating point examples in the docstring examples to 8 decimal places using the doctest ELLIPSIS directive.
This should be relatively uncontroversial.
The only place where this might not be desirable (in terms of communication with the user) is for the CLI API insrc/pyhf/cli/infer.py
.Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: