From 126d210c4bb352860f5f1f6571976062c7db69ec Mon Sep 17 00:00:00 2001 From: Sam VS Date: Mon, 27 Nov 2023 14:38:44 +0000 Subject: [PATCH] Update version and bump release (#226) * update python * update reqs * revert python versions * update * fix numpy * revert docker * add vscode recommendations * update versions --- .gitignore | 3 --- .pre-commit-config.yaml | 8 ++------ .vscode/extensions.json | 8 ++++++++ .vscode/settings.json | 16 ++++++++++++++++ README.md | 2 +- changelog.md | 6 +++++- puma/__init__.py | 2 +- puma/histogram.py | 6 ++++-- requirements.txt | 9 +++------ 9 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 4e4d9a94..b565a202 100644 --- a/.gitignore +++ b/.gitignore @@ -140,9 +140,6 @@ dmypy.json .DS_Store ._.DS_Store -# VSCode config files -.vscode - # package specific excludes examples/*.png # user specific files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b976c469..4235255e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,10 @@ repos: - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.0.289" + rev: "v0.1.6" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - - - repo: https://github.com/psf/black - rev: "23.9.1" - hooks: - - id: black + - id: ruff-format #- repo: https://github.com/pre-commit/mirrors-mypy # rev: "v1.1.1" diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..bc5bb2a2 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "ms-python.python", + "njpwerner.autodocstring", + "elagil.pre-commit-helper", + "charliermarsh.ruff" + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..1a9acfe3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "editor.stickyScroll.enabled": true, + "autoDocstring.docstringFormat": "numpy", + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.codeActionsOnSave": { + "source.organizeImports": true + }, + }, + "editor.formatOnSave": true, + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/.git/subtree-cache/**": true, + "**/logs/*/**": true + } +} \ No newline at end of file diff --git a/README.md b/README.md index 70ace1d0..57a4e237 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ The Docker images are built on GitHub and contain the latest version from the `m The container registry with all available tags can be found [here](https://gitlab.cern.ch/atlas-flavor-tagging-tools/training-images/puma-images/container_registry/13727). -The `puma:latest` image is based on `python:3.8.15-slim` and is meant for users who want to use the latest version of `puma`. For each release, there is a corresponding tagged image. +The `puma:latest` image is based on `python:3.8.15` and is meant for users who want to use the latest version of `puma`. For each release, there is a corresponding tagged image. You can start an interactive shell in a container with your current working directory mounted into the container by using one of the commands provided below. diff --git a/changelog.md b/changelog.md index a3077985..e48f9605 100644 --- a/changelog.md +++ b/changelog.md @@ -2,10 +2,14 @@ ### [Latest] + +### [v0.3.1] (2023/11/27) + +- Update versions and add vscode settings [!226](https://github.com/umami-hep/puma/pull/226) - Update ratio uncertainty calculation [!225](https://github.com/umami-hep/puma/pull/225) +- Adding option for initialising histograms with pre-binned distributions. [!221](https://github.com/umami-hep/puma/pull/221) - Add NaN filtering for HL plots. Bump atlas-ftag-tools version to 0.1.11. [!220](https://github.com/umami-hep/puma/pull/220) - Making Under- and Overflow bins default in histograms [!218](https://github.com/umami-hep/puma/pull/218) -- Adding "bin_edges" and "sum_squared_weights" parameters to the Histogram constructor to define pre-filled histograms. ### [v0.3.0] (2023/10/03) diff --git a/puma/__init__.py b/puma/__init__.py index 8824365b..4e2e332d 100644 --- a/puma/__init__.py +++ b/puma/__init__.py @@ -2,7 +2,7 @@ # flake8: noqa -__version__ = "0.3.0" +__version__ = "0.3.1" from puma.histogram import Histogram, HistogramPlot from puma.integrated_eff import IntegratedEfficiency, IntegratedEfficiencyPlot diff --git a/puma/histogram.py b/puma/histogram.py index e412b909..ab8fcda9 100644 --- a/puma/histogram.py +++ b/puma/histogram.py @@ -100,9 +100,11 @@ def __init__( self.sum_squared_weights = sum_squared_weights if bin_edges is None and sum_squared_weights is not None: - logger.warning("""The Histogram has no bin edges defined and is thus + logger.warning( + """The Histogram has no bin edges defined and is thus not considered filled. Parameter `sum_squared_weights` - is ignored. """) + is ignored. """ + ) # This attribute allows to know how to handle the histogram later during # plotting diff --git a/requirements.txt b/requirements.txt index 10238dd6..7d03c42b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,10 @@ atlasify==0.8.0 -black==23.1.0 -ruff==0.0.254 coverage==6.3.1 -h5py==3.8.0 -librep==0.0.5 +h5py==3.10.0 matplotlib==3.5.1 -numpy==1.24.* +numpy==1.24.4 pandas[hdf5]==1.5.3 -pre-commit==3.1.1 +pre-commit==3.5.0 pydot==1.4.2 pytest-cov==3.0.0 pytest-randomly==3.11.0