-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Add Sphinx Documentation #25
base: master
Are you sure you want to change the base?
Conversation
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.
This is great to see. I'll enable some extensions that will help with testing Sphinx builds.
docs/source/conf.py
Outdated
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = ["m2r2"] |
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.
This is fine for now, but given that m2r2
is a fork of an abandoned project it is probably worth just switching to RST for long term support, which pyhf
reluctantly did. That can be for another PR though. 👍
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.
Okay, since I wanted to use README.md directly rather than write README.rst before. I will discard the usage of m2r2 and wrote a README.rst file in the next PR.
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.
Yeah keeping it as Markdown I think is fine for now.
For Sphinx to really be powerful it will need to be able to understand the code though, so it will help to get PR #19 done first. |
Codecov Report
@@ Coverage Diff @@
## master #25 +/- ##
=======================================
Coverage 85.89% 85.89%
=======================================
Files 12 12
Lines 482 482
Branches 67 67
=======================================
Hits 414 414
Misses 54 54
Partials 14 14
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@matthewfeickert Documentation contents have been added and you can enter into |
@matthewfeickert What are the further steps for this PR? |
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.
I need to preview this still and get the ReadTheDocs integration setup but this is looking good overall. Some things need fixing though.
docs/source/conf.py
Outdated
xref_links = {"arXiv:1007.1727": ("[1007.1727]", "https://arxiv.org/abs/1007.1727")} | ||
|
||
# Github repo | ||
issues_github_path = "scikit-hep/pyhf/pyhf-benchmark" |
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.
issues_github_path = "scikit-hep/pyhf/pyhf-benchmark" | |
issues_github_path = "pyhf/pyhf-benchmark" |
path is wrong
src/pyhf_benchmark/manager.py
Outdated
|
||
Returns: | ||
|
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.
Returns: |
If no return don't list it.
src/pyhf_benchmark/plot.py
Outdated
Returns: | ||
|
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.
As I mentioned before, probably makes more sense to have the function accept an axis object and then return an axis object then try to wrap all of it, but that can be done for a later PR. At the moment this doesn't return anything so it should get fixed.
|
||
Returns: | ||
|
||
""" | ||
fig, ax = plt.subplots() | ||
ax.set_xlabel("Time (minutes)") |
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.
This should probably be seconds not minutes.
None of the required dependencies are setup in a |
@matthewfeickert I created a virtual python environment without any other third-part library installed before successfully, but it is weird that when I use I changed README.md to README.rst and removed m2r2 extension in |
@matthewfeickert One question in command line api page, the format of command lines in examples are in a mess, can you tell me how to modify it? |
@matthewfeickert The bug in CI/docs (3.8) still needs to be solved. What is the possible reason? |
It seems that you don't actually have a properly isolated virtual environment. If on this branch in a clean virtual environment I get the following
If you look at the logs
it tells us the same error as
as
. Why are all the docs under
but haven't added it to the $ git diff origin/master -- setup.py
diff --git a/setup.py b/setup.py
index c8df5b1..1d944ad 100644
--- a/setup.py
+++ b/setup.py
@@ -20,6 +20,7 @@ extras_require["develop"] = sorted(
+ ["check-manifest", "bumpversion~=0.5", "pre-commit", "twine",]
)
)
+extras_require["docs"] = sorted(set(["sphinx"]))
extras_require["complete"] = sorted(set(sum(extras_require.values(), [])))
setuptools.setup(extras_require=extras_require,) |
@matthewfeickert I use the same command lines as you did but I can still build the doc successfully even I denote a python version as 3.8(which is a different version with the python in my local PC) in virtual environment. As the information from your result. I just need to add to setup.py? |
@matthewfeickert If I don't use source file I will get an error when build docs locally. The error information is the same as CI/docs (3.8) |
This PR aims to add Sphinx documentation for
pyhf-benchmark
.The main page of documentation has been completed, and the page looks like as follows:
More contents need to be added into the introduction, examples, etc.