diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 751ee94..5143bee 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -14,11 +14,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - os: [ubuntu-22.04] - include: - - python-version: 3.12 - os: macos-12 + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e37cf73..f8035db 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,13 +11,13 @@ repos: hooks: - id: prettier - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.9 + rev: v0.8.6 hooks: - id: ruff args: [--fix, --show-fixes] - id: ruff-format - repo: https://github.com/fsfe/reuse-tool - rev: v4.0.3 + rev: v5.0.2 hooks: - id: reuse - repo: https://github.com/codespell-project/codespell diff --git a/ehist/__init__.py b/ehist/__init__.py index afee91c..2436e87 100644 --- a/ehist/__init__.py +++ b/ehist/__init__.py @@ -7,7 +7,11 @@ """ -__all__ = ["HistCat", "Hist1D", "Hist2D"] +__all__ = [ + "Hist1D", + "Hist2D", + "HistCat", +] __version__ = "0.0.1" diff --git a/ehist/util.py b/ehist/util.py index 1c42692..c3e163e 100644 --- a/ehist/util.py +++ b/ehist/util.py @@ -150,7 +150,7 @@ def add_column(self, col, align="<", t=str, prefix="", postfix=""): a = np.log10(max(np.abs(col))) > 5 # noqa: PLR2004 b = min(np.abs(col)) != 0 c = np.log10(min(np.abs(col[col != 0]))) < -2 # noqa: PLR2004 - fmt = "{:7.2e}" if a or b and c else "{:0.2f}" + fmt = "{:7.2e}" if a or (b and c) else "{:0.2f}" c = [fmt.format(r) for r in col] align = ">" elif t in [int]: