From 0b8db23c749a2744c423e7c26ed64914009dea91 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:00:14 +0000 Subject: [PATCH 1/2] chore: update pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1) - [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](https://github.com/PyCQA/flake8/compare/6.1.0...7.0.0) - [github.com/kynan/nbstripout: 0.6.1 → 0.7.1](https://github.com/kynan/nbstripout/compare/0.6.1...0.7.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db9d59f..4e5c718 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: args: ["--py36-plus"] - repo: https://github.com/psf/black - rev: "23.12.1" + rev: "24.1.1" hooks: - id: black @@ -58,7 +58,7 @@ repos: args: ["--all"] - repo: https://github.com/PyCQA/flake8 - rev: "6.1.0" + rev: "7.0.0" hooks: - id: flake8 additional_dependencies: [ @@ -70,7 +70,7 @@ repos: args: ["--docstring-convention", "numpy"] # or google, change me - repo: https://github.com/kynan/nbstripout - rev: "0.6.1" + rev: "0.7.1" hooks: - id: nbstripout args: ["--strip-empty-cells", From 7ea25d9bb5f1e68be542dc5bbd878ce9047cfc27 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:00:30 +0000 Subject: [PATCH 2/2] style: pre-commit fixes --- src/legendoptics/fibers.py | 1 + src/legendoptics/lar.py | 6 ++---- src/legendoptics/pen.py | 1 + src/legendoptics/tetratex.py | 1 + tests/test_pyg4.py | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/legendoptics/fibers.py b/src/legendoptics/fibers.py index 745f614..ff77dce 100644 --- a/src/legendoptics/fibers.py +++ b/src/legendoptics/fibers.py @@ -3,6 +3,7 @@ .. [SaintGobainDataSheet] https://www.crystals.saint-gobain.com/sites/hps-mac3-cma-crystals/files/2021-11/Fiber-Product-Sheet.pdf """ + from __future__ import annotations import logging diff --git a/src/legendoptics/lar.py b/src/legendoptics/lar.py index d62ba4c..28800c6 100644 --- a/src/legendoptics/lar.py +++ b/src/legendoptics/lar.py @@ -22,6 +22,7 @@ from liquid argon and xenon.” In: Phys. Rev. B 27 (9 May 1983), pp. 5279–5285, https://doi.org/10.1103/PhysRevB.27.5279 """ + from __future__ import annotations import logging @@ -96,10 +97,7 @@ def lar_dielectric_constant_cern2020( f"this parametrization holds only between {λ_uv+1*u.nm} and {λ_ir-1*u.nm}" ) - x = 0.334 + ( - (0.100 * λ**2) / (λ**2 - λ_uv**2) - + (0.008 * λ**2) / (λ**2 - λ_ir**2) - ) + x = 0.334 + ((0.100 * λ**2) / (λ**2 - λ_uv**2) + (0.008 * λ**2) / (λ**2 - λ_ir**2)) # solve Clausius-Mossotti return (3 + 2 * x) / (3 - x) diff --git a/src/legendoptics/pen.py b/src/legendoptics/pen.py index 5d389b8..c9eea9a 100644 --- a/src/legendoptics/pen.py +++ b/src/legendoptics/pen.py @@ -10,6 +10,7 @@ .. [Ouchi2006] I. Ouchi et al. “Features of Fluorescence Spectra of Polyethylene 2,6-Naphthalate Films” In: Journal of Applied Polymer Science, Vol. 105, 114–121 (2007), https://doi.org/10.1002/app.26085 """ + from __future__ import annotations import logging diff --git a/src/legendoptics/tetratex.py b/src/legendoptics/tetratex.py index f0e24fd..b87ad7e 100644 --- a/src/legendoptics/tetratex.py +++ b/src/legendoptics/tetratex.py @@ -3,6 +3,7 @@ .. [Janacek2012] M. Janacek, "Reflectivity spectra for commonly used reflectors", https://www.osti.gov/servlets/purl/1184400 """ + from __future__ import annotations import logging diff --git a/tests/test_pyg4.py b/tests/test_pyg4.py index 3f3bb90..ce0622a 100644 --- a/tests/test_pyg4.py +++ b/tests/test_pyg4.py @@ -1,4 +1,5 @@ """Test the attaching of all properties to Geant4 materials.""" + import pint import pyg4ometry.geant4 as g4