From 84ca5b54ac3e74fdece27b75449d4219a59abb70 Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Mon, 5 Dec 2022 13:37:48 -0600 Subject: [PATCH 1/5] use real version; testing cleanup --- pyproject.toml | 13 ++++++++----- src/pygram11/__init__.py | 2 +- tests/test_hist.py | 12 ------------ 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a49ed97..ff278ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ build-backend = "scikit_build_core.build" [project] name = "pygram11" -version = "0.999" +version = "0.13.2" readme = "README.md" description = "Fast histogramming in Python built on pybind11 and OpenMP." authors = [ @@ -28,10 +28,13 @@ dependencies = ["numpy"] [tool.pytest.ini_options] norecursedirs = ["extern"] -markers = [ - "misci: Miscellaneous", - "OD: One dimensional histograms", - "TD: Two dimensional histograms", +testpaths = ["tests"] +addopts = [ + "-v", + "-ra", + "--showlocals", + "--strict-markers", + "--strict-config", ] [tool.cibuildwheel] diff --git a/src/pygram11/__init__.py b/src/pygram11/__init__.py index cb2da08..294effb 100644 --- a/src/pygram11/__init__.py +++ b/src/pygram11/__init__.py @@ -26,7 +26,7 @@ """ -__version__ = "0.999" +__version__ = "0.13.2" from ._hist import ( # noqa bin_centers, diff --git a/tests/test_hist.py b/tests/test_hist.py index 4de0e4e..a7ce60c 100644 --- a/tests/test_hist.py +++ b/tests/test_hist.py @@ -42,7 +42,6 @@ def make_data_mw(self, xtype, wtype): @pytest.mark.parametrize("flow", [True, False]) @pytest.mark.parametrize("func", [pg.histogram, pg.fix1d]) @pytest.mark.parametrize("cons_var", [True, False]) - @pytest.mark.OD def test_no_weight_and_single_weight( self, xtype, wtype, density, flow, func, cons_var ): @@ -89,7 +88,6 @@ def test_no_weight_and_single_weight( @pytest.mark.parametrize("wtype", [np.float32, np.float64]) @pytest.mark.parametrize("flow", [True, False]) @pytest.mark.parametrize("func", [pg.histogram, pg.fix1dmw]) - @pytest.mark.OD def test_multiple_weights(self, xtype, wtype, flow, func): x, w = self.make_data_mw(xtype, wtype) n, xmin, xmax = 50, -10.1, 10.1 @@ -114,7 +112,6 @@ def test_multiple_weights(self, xtype, wtype, flow, func): res1[-1] += np.sum(w[:, i][x >= xmax]) npt.assert_allclose(res0a[:, i], res1, atol=0.01, rtol=1.0e-3) - @pytest.mark.OD @pg.without_omp def test_cons_var_nomp(self): x = RNG.standard_normal(size=(500,)) @@ -124,7 +121,6 @@ def test_cons_var_nomp(self): npt.assert_allclose(res1, res2) npt.assert_allclose(var1, res1 * 0.5) - @pytest.mark.OD @pg.with_omp def test_cons_var_womp(self): x = RNG.standard_normal(size=(500,)) @@ -164,7 +160,6 @@ def make_data_mw(self, xtype, wtype): @pytest.mark.parametrize("density", [True, False]) @pytest.mark.parametrize("flow", [True, False]) @pytest.mark.parametrize("func", [pg.histogram, pg.var1d]) - @pytest.mark.OD def test_no_weight_and_single_weight(self, xtype, wtype, bins, density, flow, func): if density and flow: assert True @@ -192,7 +187,6 @@ def test_no_weight_and_single_weight(self, xtype, wtype, bins, density, flow, fu @pytest.mark.parametrize("bins", [E1, E2]) @pytest.mark.parametrize("flow", [True, False]) @pytest.mark.parametrize("func", [pg.var1dmw, pg.histogram]) - @pytest.mark.OD def test_multiple_weights(self, xtype, wtype, bins, flow, func): x, w = self.make_data_mw(xtype, wtype) xmin, xmax = bins[0], bins[-1] @@ -221,7 +215,6 @@ def make_data(self, xtype, ytype, wtype): @pytest.mark.parametrize("wtype", [None, np.float64, np.float32]) @pytest.mark.parametrize("flow", [False]) @pytest.mark.parametrize("func", [pg.histogram2d, pg.fix2d]) - @pytest.mark.TD def test_no_weight_and_single_weight(self, xtype, ytype, wtype, flow, func): x, y, w = self.make_data(xtype, ytype, wtype) nbx, xmin, xmax = 25, -10.1, 10.1 @@ -276,7 +269,6 @@ def make_data(self, xtype, ytype, wtype): @pytest.mark.parametrize("ybins", [E1, E2]) @pytest.mark.parametrize("flow", [False]) @pytest.mark.parametrize("func", [pg.var2d, pg.histogram2d]) - @pytest.mark.TD def test_no_weight_and_single_weight( self, xtype, ytype, wtype, xbins, ybins, flow, func ): @@ -306,7 +298,6 @@ class TestExceptions: W2 = np.abs(RNG.standard_normal(size=(50, 3))) @pytest.mark.parametrize("xtype", BAD_TYPES) - @pytest.mark.misci def test_f1d(self, xtype): x = self.X.astype(xtype) w1 = self.W1 @@ -328,7 +319,6 @@ def test_f1d(self, xtype): pg.fix1dmw(x, weights=w2) @pytest.mark.parametrize("xtype", BAD_TYPES) - @pytest.mark.misci def test_v1d(self, xtype): x = self.X.astype(xtype) # bad range @@ -337,7 +327,6 @@ def test_v1d(self, xtype): class TestConvenience: - @pytest.mark.misci def test_bin_centers(self): edges = [1, 2, 3, 4, 5, 6] c = pg.bin_centers(edges) @@ -350,7 +339,6 @@ def test_bin_centers(self): c2 = np.array([2.0, 3.5, 6.0, 8.5, 9.1]) npt.assert_allclose(c, c2) - @pytest.mark.misci def test_bin_edges(self): edges = pg.bin_edges(8, (-4, 4)) e2 = np.array([-4.0, -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0]) From 03e328b470209334dc4eb3fbcc16c2fe10f8076f Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Mon, 5 Dec 2022 13:39:36 -0600 Subject: [PATCH 2/5] add classifiers --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ff278ae..84e444e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,12 @@ maintainers = [ ] requires-python = ">=3.8" dependencies = ["numpy"] +classifiers = [ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering", +] [tool.pytest.ini_options] norecursedirs = ["extern"] From e41fded8ac3ec0196b3244be1e28a0ed82a4497f Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Mon, 5 Dec 2022 13:41:35 -0600 Subject: [PATCH 3/5] classifiers --- pyproject.toml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 84e444e..6ea9f83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,10 +26,18 @@ maintainers = [ requires-python = ">=3.8" dependencies = ["numpy"] classifiers = [ - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Topic :: Scientific/Engineering", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: C++", + "Operating System :: Unix", + "Operating System :: MacOS", + "Operating System :: POSIX", + "Operating System :: POSIX :: Linux", + "License :: OSI Approved :: MIT License", + "Intended Audience :: Science/Research", ] [tool.pytest.ini_options] From b10491ba527c5430f94ff2eb09e0f92a32c9c832 Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Mon, 5 Dec 2022 13:43:25 -0600 Subject: [PATCH 4/5] classifiers --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 6ea9f83..38e020d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,8 +36,10 @@ classifiers = [ "Operating System :: MacOS", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", "License :: OSI Approved :: MIT License", "Intended Audience :: Science/Research", + "Development Status :: 6 - Mature", ] [tool.pytest.ini_options] From 2ee5a44723631f3ebdd5e9a513abc55da74bd930 Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Thu, 14 Sep 2023 09:34:55 -0500 Subject: [PATCH 5/5] bump versions (#17) --- .github/workflows/build.yml | 6 +++--- .github/workflows/ci.yml | 7 +++++-- extern/mp11 | 2 +- extern/pybind11 | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fd694c..577cadd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: # HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew reinstall --build-from-source --formula ./.github/workflows/libomp.rb - name: Build wheels - uses: pypa/cibuildwheel@v2.9.0 + uses: pypa/cibuildwheel@v2.15.0 - name: Show files run: ls -lh wheelhouse @@ -44,7 +44,7 @@ jobs: with: submodules: true - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 name: Install Python - name: Build sdist @@ -52,6 +52,6 @@ jobs: python -m pip install build python -m build -s - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: path: dist/*.tar.gz diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ffcf96..35e7698 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,15 +11,18 @@ jobs: fail-fast: false matrix: platform: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] runs-on: ${{matrix.platform}} + env: + PIP_ONLY_BINARY: numpy steps: - uses: actions/checkout@v3 with: submodules: true - name: setup Python ${{matrix.python-version}} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: + allow-prereleases: true python-version: ${{matrix.python-version}} # - name: install libomp on macOS # shell: bash diff --git a/extern/mp11 b/extern/mp11 index 590df5e..ef7608b 160000 --- a/extern/mp11 +++ b/extern/mp11 @@ -1 +1 @@ -Subproject commit 590df5e0bcdf0c17911c28098b9e4a7839a63019 +Subproject commit ef7608b463298b881bc82eae4f45a4385ed74fca diff --git a/extern/pybind11 b/extern/pybind11 index 80dc998..8a099e4 160000 --- a/extern/pybind11 +++ b/extern/pybind11 @@ -1 +1 @@ -Subproject commit 80dc998efced8ceb2be59756668a7e90e8bef917 +Subproject commit 8a099e44b3d5f85b20f05828d919d2332a8de841