From 1df1bcd8b244533e3cb8eb126a87cfadf7c37aef Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:01:31 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.3.0 → 24.8.0](https://github.com/psf/black/compare/22.3.0...24.8.0) - [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.6.0) - [github.com/pre-commit/pygrep-hooks: v1.9.0 → v1.10.0](https://github.com/pre-commit/pygrep-hooks/compare/v1.9.0...v1.10.0) - [github.com/PyCQA/isort: 5.10.1 → 5.13.2](https://github.com/PyCQA/isort/compare/5.10.1...5.13.2) - [github.com/asottile/pyupgrade: v2.34.0 → v3.17.0](https://github.com/asottile/pyupgrade/compare/v2.34.0...v3.17.0) - [github.com/asottile/setup-cfg-fmt: v1.20.1 → v2.5.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.1...v2.5.0) - [github.com/hadialqattan/pycln: v1.3.5 → v2.4.0](https://github.com/hadialqattan/pycln/compare/v1.3.5...v2.4.0) - [github.com/asottile/yesqa: v1.3.0 → v1.5.0](https://github.com/asottile/yesqa/compare/v1.3.0...v1.5.0) - [github.com/pycqa/flake8: 4.0.1 → 7.1.1](https://github.com/pycqa/flake8/compare/4.0.1...7.1.1) - [github.com/shellcheck-py/shellcheck-py: v0.8.0.4 → v0.10.0.1](https://github.com/shellcheck-py/shellcheck-py/compare/v0.8.0.4...v0.10.0.1) - [github.com/mgedmin/check-manifest: 0.48 → 0.49](https://github.com/mgedmin/check-manifest/compare/0.48...0.49) --- .pre-commit-config.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2853b16..32c42da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ repos: - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 24.8.0 hooks: - id: black-jupyter - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.6.0 hooks: - id: check-case-conflict - id: check-merge-conflict @@ -18,7 +18,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: python-check-blanket-noqa - id: python-check-blanket-type-ignore @@ -30,29 +30,29 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/PyCQA/isort - rev: 5.10.1 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v2.34.0 + rev: v3.17.0 hooks: - id: pyupgrade args: ["--py36-plus"] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.1 + rev: v2.5.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/hadialqattan/pycln - rev: v1.3.5 + rev: v2.4.0 hooks: - id: pycln args: [--config=pyproject.toml] - repo: https://github.com/asottile/yesqa - rev: v1.3.0 + rev: v1.5.0 hooks: - id: yesqa exclude: docs/conf.py @@ -61,7 +61,7 @@ repos: - flake8-print - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + rev: 7.1.1 hooks: - id: flake8 exclude: docs/conf.py @@ -75,13 +75,13 @@ repos: - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.8.0.4 + rev: v0.10.0.1 hooks: - id: shellcheck - repo: https://github.com/mgedmin/check-manifest - rev: "0.48" + rev: "0.49" hooks: - id: check-manifest stages: [manual] From 05be40bd0266b5af02769064222739146c5e21fb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:01:46 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- applying_neos.md | 1 - examples/binning.ipynb | 3 +++ examples/cuts.ipynb | 1 + setup.cfg | 9 ++------- src/neos/losses.py | 1 - src/neos/top_level.py | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/applying_neos.md b/applying_neos.md index b0f0b76..652a2da 100644 --- a/applying_neos.md +++ b/applying_neos.md @@ -22,4 +22,3 @@ I've just released [`relaxed` v0.3.0](https://github.com/gradhep/relaxed), which ## reaching out If you're interested in working on this, please reach out to me through [Mattermost](https://mattermost.web.cern.ch/signup_user_complete/?id=zf7w5rb1miy85xsfjqm68q9hwr&md=link&sbr=su), or by email. - diff --git a/examples/binning.ipynb b/examples/binning.ipynb index 7a2f92a..c42f267 100644 --- a/examples/binning.ipynb +++ b/examples/binning.ipynb @@ -668,6 +668,7 @@ "num_bins = 4\n", "pars = jnp.linspace(0, 8, num_bins + 1)\n", "\n", + "\n", "# differentiable significance pipeline\n", "def asimov_pipe(bins, s, b, bandwidth=1e-2):\n", " # restrict bin edges so they don't overlap during optimisation\n", @@ -732,6 +733,7 @@ "\n", "from copy import deepcopy\n", "\n", + "\n", "# specify the workspace for a simple model with a three-point background systematic\n", "def correlated_background(signal, bkg, bkg_up, bkg_down):\n", " spec = {\n", @@ -768,6 +770,7 @@ "\n", "from pyhf import interpolators\n", "\n", + "\n", "# pipeline to calculate the full CLs for the model, given a number of bins\n", "def pipe(num_bins):\n", " def cls_pipe(bins, s, b, bup, bdown, bandwidth=1e-2, skeleton_model=None):\n", diff --git a/examples/cuts.ipynb b/examples/cuts.ipynb index 48d56a4..395285d 100644 --- a/examples/cuts.ipynb +++ b/examples/cuts.ipynb @@ -341,6 +341,7 @@ "from jaxopt import OptaxSolver\n", "from optax import adam\n", "\n", + "\n", "# define something to minimise (1/significance)\n", "def loss(cut):\n", " s_weights = relaxed.cut(sig, cut, slope) + 1e-4\n", diff --git a/setup.cfg b/setup.cfg index e783631..220aab8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,7 +9,7 @@ author_email = n.s@cern.ch maintainer = Nathan Simpson maintainer_email = n.s@cern.ch license = BSD-3-Clause -license_file = LICENSE +license_files = LICENSE platforms = Any classifiers = @@ -21,11 +21,6 @@ classifiers = Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 Topic :: Scientific/Engineering project_urls = Documentation = https://neos.readthedocs.io/ @@ -41,7 +36,7 @@ install_requires = relaxed>=0.2.0 sklearn typing-extensions>=3.7;python_version<'3.8' -python_requires = >=3.6 +python_requires = >=3.8 include_package_data = True package_dir = =src diff --git a/src/neos/losses.py b/src/neos/losses.py index 1710b0e..78e545f 100644 --- a/src/neos/losses.py +++ b/src/neos/losses.py @@ -10,7 +10,6 @@ import jax.numpy as jnp import pyhf - import relaxed Array = jnp.ndarray diff --git a/src/neos/top_level.py b/src/neos/top_level.py index 0f64ccb..bdb234c 100644 --- a/src/neos/top_level.py +++ b/src/neos/top_level.py @@ -10,8 +10,8 @@ import jax.numpy as jnp import pyhf - import relaxed + from neos.losses import ( cls_value, discovery_significance,