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

docs: Add docstrings and examples to infer fitting methods #849

Merged
merged 12 commits into from
May 1, 2020

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented May 1, 2020

Description

Fix the docstrings for infer.mle.fit and infer.mle.fixed_poi_fit. Add examples to infer.mle fit methods,infer.hypotest, and infer.test_statistics.qmu.

To get doctest passing on the macOS builds there is a small cheat in that the MINUIT example for pyhf.infer.mle.fit has its evaluations skipped. The SciPy optimizer evaluations before it pass though, so this small deviation should be fine.

ReadTheDocs build: https://pyhf.readthedocs.io/en/docs-add-infer-mle-doc-strings/_generated/pyhf.infer.hypotest.html

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Fix the docstrings for 'infer.mle.fit' and 'infer.mle.fixed_poi_fit' 
* Add examples to 'infer.mle' fit methods, 'infer.hypotest', and 'infer.test_statistics.qmu'

@matthewfeickert matthewfeickert added docs Documentation related fix A bug fix labels May 1, 2020
@matthewfeickert matthewfeickert self-assigned this May 1, 2020
@matthewfeickert matthewfeickert added this to In progress in Patch release v0.4.2 via automation May 1, 2020
@codecov
Copy link

codecov bot commented May 1, 2020

Codecov Report

Merging #849 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #849   +/-   ##
=======================================
  Coverage   96.09%   96.09%           
=======================================
  Files          54       54           
  Lines        3019     3019           
  Branches      424      424           
=======================================
  Hits         2901     2901           
  Misses         75       75           
  Partials       43       43           
Flag Coverage Δ
#unittests 96.09% <ø> (ø)
Impacted Files Coverage Δ
src/pyhf/infer/__init__.py 100.00% <ø> (ø)
src/pyhf/infer/mle.py 100.00% <ø> (ø)
src/pyhf/infer/test_statistics.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31d34a0...b7bb804. Read the comment docs.

@matthewfeickert
Copy link
Member Author

matthewfeickert commented May 1, 2020

Currently failing due to floats and doctest.

Expected:
    [2.23857553e-07 1.00308914e+00 9.62725456e-01]
Got:
    [2.23857361e-07 1.00308914e+00 9.62725456e-01]

src/pyhf/infer/mle.py Show resolved Hide resolved
src/pyhf/infer/mle.py Show resolved Hide resolved
src/pyhf/infer/mle.py Show resolved Hide resolved
src/pyhf/infer/mle.py Show resolved Hide resolved
Patch release v0.4.2 automation moved this from In progress to Review in progress May 1, 2020
paramters -> parameters
The example uses the return_uncertainties=True kwarg, but as that is not
universally suported it is probably not a good idea to demo that in an
example for the fit API
Patch release v0.4.2 automation moved this from Review in progress to Reviewer approved May 1, 2020
@lukasheinrich
Copy link
Contributor

LGTM! :shipit:

@lukasheinrich lukasheinrich merged commit f86fde8 into master May 1, 2020
Patch release v0.4.2 automation moved this from Reviewer approved to Done May 1, 2020
@lukasheinrich lukasheinrich deleted the docs/add-infer-mle-doc-strings branch May 1, 2020 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related fix A bug fix
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

pyhf.infer.mle.fit docstring missing arguments
3 participants