Skip to content

Commit

Permalink
add precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
jackaraz committed Dec 12, 2024
1 parent 680acfe commit 7d1a484
Show file tree
Hide file tree
Showing 24 changed files with 124 additions and 129 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
value: |
## Before posting a feature request
Search existing [GitHub issues](https://github.com/SpeysideHEP/spey-pyhf/issues) to make sure the issue does not already exist.
* **Please use [Markdown syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax).**
- type: textarea
id: system
Expand Down Expand Up @@ -49,4 +49,3 @@ body:
label: Additional information
description: |
Add any other context about the problem here.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ body:
## Before posting a question
Search existing [GitHub issues](https://github.com/SpeysideHEP/spey-pyhf/issues) to make sure the issue does not already exist.
If your question involves software issues, please include your system settings as shown below;
**System Settings:**
Please copy and paste the output of `spey.about()` function. If you are working on a specific branch please add the name of the branch and last commit ID. The abbreviated commit ID can be found via `git log -n1 --format="%h"` command. To retreive the branch name please use `git rev-parse --abbrev-ref HEAD` command.)
- type: textarea
Expand All @@ -21,7 +21,7 @@ body:
label: Question
description: |
How can we help?
* **Please use [Markdown syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax).**
validations:
required: true
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
id: action_black
with:
options: "-l 100"
src: "./src"
src: "./src"
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ repos:
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py310-plus]
args: [--py38-plus]
language_version: python3.8

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
Expand All @@ -30,5 +31,5 @@ repos:
rev: 22.6.0
hooks:
- id: black
args: [--line-length=90]
language_version: python3.10
args: ["--line-length=90", "--target-version=py38"]
language_version: python3.8
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
path: .
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
"relation": "requires"
}
]
}
}
2 changes: 1 addition & 1 deletion CITATIONS.bib
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ @article{pyhf_joss
author = {Lukas Heinrich and Matthew Feickert and Giordon Stark and Kyle Cranmer},
title = {pyhf: pure-Python implementation of HistFactory statistical models},
journal = {Journal of Open Source Software}
}
}
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,3 @@ testpypi:
.PHONY: pypi
pypi:
twine --repository spey-pyhf upload dist/*





4 changes: 2 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Makefile for Sphinx documentation
# Makefile for Sphinx documentation

SPHINXOPTS = -W --keep-going #-n
SPHINXBUILD = sphinx-build
Expand Down Expand Up @@ -78,4 +78,4 @@ latex:
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
"(use \`make latexpdf' here to do that automatically)."
2 changes: 1 addition & 1 deletion docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ span.label {
background-color: var(--pst-color-surface);
color: var(--pst-color-text-base);
border: 1px solid var(--pst-color-border);
}
}
4 changes: 2 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Managers

.. currentmodule:: spey_pyhf

.. autosummary::
.. autosummary::
:toctree: _generated/

manager.PyhfManager
Expand Down Expand Up @@ -63,4 +63,4 @@ Helper functions

.. autoclass:: spey_pyhf.WorkspaceInterpreter
:members:
:undoc-members:
:undoc-members:
4 changes: 2 additions & 2 deletions docs/bib/references.bib
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
%% This BibTeX bibliography file was created using BibDesk.
%% https://bibdesk.sourceforge.io/
%% Created for Jack Araz at 2023-04-01 8:42:56 am +0100
%% Created for Jack Araz at 2023-04-01 8:42:56 am +0100
%% Saved with string encoding Unicode (UTF-8)
%% Saved with string encoding Unicode (UTF-8)
Expand Down
2 changes: 1 addition & 1 deletion docs/citations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ This plug-in uses ``pyhf`` internally; thus, please also cite the following
year = {2021},
bdsk-url-1 = {https://doi.org/10.21105/joss.02823}}
.. include:: ZENODO-PYHF.rst
.. include:: ZENODO-PYHF.rst
12 changes: 6 additions & 6 deletions docs/quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Installation
Python >=3.8 is required. This will also automatically install ``pyhf`` since it is a requirement.
For Gradient and Hessian implementations in likelihood optimisation, we recommend also installing ``Jax``.

Once this package is installed, ``spey`` can automatically detect it, which can be tested using
Once this package is installed, ``spey`` can automatically detect it, which can be tested using
:func:`~spey.AvailableBackends` function;

.. code-block:: python3
Expand Down Expand Up @@ -99,7 +99,7 @@ descriptions within ``spey``;
>>> statistical_model.exclusion_confidence_level() # [0.9474850259721279]
For the rest of the functionalities, please refer to the ``spey`` documentation, which can be found
For the rest of the functionalities, please refer to the ``spey`` documentation, which can be found
`in this link <https://speysidehep.github.io/spey/>`_. Due to Spey's fully
backend agnostic structure, all the functionalities of the :class:`~spey.StatisticalModel` class also
applies to ``pyhf`` plug-in.
Expand All @@ -109,13 +109,13 @@ applies to ``pyhf`` plug-in.
* ``background_only_model``: This background-only model dictionary includes information about
background yields, uncertainties and observations. Details on constructing these dictionaries can be
found in `pyhf's online documentation <https://pyhf.readthedocs.io/en/v0.7.2/likelihood.html>`_.
* ``signal_patch``: This signal patch includes dictionaries describing which regions will be added or
* ``signal_patch``: This signal patch includes dictionaries describing which regions will be added or
removed from the statistical model.
* ``analysis`` (optional): Unique identifier for the analysis.
* ``xsection`` (optional): Cross-section value for the signal hypothesis. Units determined by the user.


Additionally, this plug-in is shipped with simple uncorrelated background-attachment which accesses
Additionally, this plug-in is shipped with simple uncorrelated background-attachment which accesses
``pyhf``'s ``uncorrelated_backgound`` function can be accessed through spey with the following function

.. code-block:: python3
Expand Down Expand Up @@ -152,7 +152,7 @@ Additionally, this plug-in is shipped with simple uncorrelated background-attach

.. note::

``pyhf`` offers an interface to combine the likelihoods that are described as JSON serialised
``pyhf`` offers an interface to combine the likelihoods that are described as JSON serialised
files. This has been exploited in ``spey`` interface via :func:`combine` `function <https://speysidehep.github.io/spey/api.html#spey.StatisticalModel.combine>`_.
This function combines ``pyhf`` workspaces and adjusts the signal structure accordingly. For more information
about how ``pyhf`` handles the workspace combination `see the dedicated tutorial here <https://pyhf.github.io/pyhf-tutorial/Combinations.html>`_.
about how ``pyhf`` handles the workspace combination `see the dedicated tutorial here <https://pyhf.github.io/pyhf-tutorial/Combinations.html>`_.
2 changes: 1 addition & 1 deletion docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Release Notes
.. toctree::
:maxdepth: 2

releases/changelog-v0.1
releases/changelog-v0.1
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ sphinx-togglebutton>=0.3.0
myst-parser
sphinx-rtd-size
sphinx-book-theme
myst-nb
myst-nb
Loading

0 comments on commit 7d1a484

Please sign in to comment.