Skip to content

Commit

Permalink
Merge branch 'main' into newcibw
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasdavis authored Mar 12, 2024
2 parents 11a3bce + 2ee5a44 commit 89a3154
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ jobs:
with:
submodules: true

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python

- name: Build sdist
run: |
python -m pip install build
python -m build -s
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion extern/mp11
Submodule mp11 updated 66 files
+266 −39 .github/workflows/ci.yml
+1 −1 CMakeLists.txt
+1 −1 README.md
+9 −5 appveyor.yml
+52 −12 doc/mp11/algorithm.adoc
+15 −0 doc/mp11/changelog.adoc
+7 −0 doc/mp11/definitions.adoc
+10 −0 doc/mp11/integral.adoc
+154 −1 doc/mp11/list.adoc
+38 −17 include/boost/mp11/algorithm.hpp
+11 −0 include/boost/mp11/detail/config.hpp
+140 −4 include/boost/mp11/detail/mp_append.hpp
+119 −0 include/boost/mp11/detail/mp_defer.hpp
+105 −3 include/boost/mp11/detail/mp_fold.hpp
+13 −1 include/boost/mp11/detail/mp_front.hpp
+41 −0 include/boost/mp11/detail/mp_is_value_list.hpp
+27 −0 include/boost/mp11/detail/mp_list_v.hpp
+1 −1 include/boost/mp11/detail/mp_map_find.hpp
+4 −1 include/boost/mp11/detail/mp_plus.hpp
+18 −5 include/boost/mp11/detail/mp_rename.hpp
+25 −0 include/boost/mp11/detail/mp_value.hpp
+1 −0 include/boost/mp11/integral.hpp
+171 −3 include/boost/mp11/list.hpp
+2 −96 include/boost/mp11/utility.hpp
+1 −1 include/boost/mp11/version.hpp
+39 −2 test/Jamfile
+60 −0 test/mp_append_3.cpp
+49 −0 test/mp_apply_q_sf.cpp
+89 −0 test/mp_assign_2.cpp
+64 −0 test/mp_at_2.cpp
+57 −0 test/mp_back_2.cpp
+32 −0 test/mp_clear_2.cpp
+58 −0 test/mp_compose_sf.cpp
+10 −0 test/mp_drop.cpp
+98 −0 test/mp_drop_2.cpp
+40 −0 test/mp_empty_2.cpp
+159 −0 test/mp_erase_2.cpp
+40 −0 test/mp_fill_2.cpp
+32 −13 test/mp_fold.cpp
+50 −0 test/mp_fold_q_sf.cpp
+45 −0 test/mp_from_sequence_2.cpp
+40 −0 test/mp_front_2.cpp
+119 −0 test/mp_insert_2.cpp
+37 −0 test/mp_iota_2.cpp
+24 −0 test/mp_is_list.cpp
+58 −0 test/mp_is_value_list.cpp
+34 −0 test/mp_list_v.cpp
+54 −0 test/mp_pop_back_2.cpp
+37 −0 test/mp_pop_front_2.cpp
+46 −0 test/mp_push_back_2.cpp
+46 −0 test/mp_push_front_2.cpp
+51 −0 test/mp_rename_2.cpp
+56 −0 test/mp_rename_v.cpp
+125 −0 test/mp_repeat_2.cpp
+48 −0 test/mp_repeat_3.cpp
+60 −0 test/mp_replace_front_2.cpp
+43 −0 test/mp_replace_second_2.cpp
+41 −0 test/mp_replace_third_2.cpp
+32 −0 test/mp_second_2.cpp
+38 −0 test/mp_size_2.cpp
+88 −0 test/mp_take_2.cpp
+32 −0 test/mp_third_2.cpp
+99 −0 test/mp_transform_front_2.cpp
+61 −0 test/mp_transform_second_2.cpp
+61 −0 test/mp_transform_third_2.cpp
+40 −0 test/mp_value.cpp
2 changes: 1 addition & 1 deletion extern/pybind11
Submodule pybind11 updated 138 files
29 changes: 24 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -25,13 +25,32 @@ maintainers = [
]
requires-python = ">=3.8"
dependencies = ["numpy"]
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"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",
"Operating System :: Microsoft :: Windows",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Science/Research",
"Development Status :: 6 - Mature",
]

[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]
Expand Down
2 changes: 1 addition & 1 deletion src/pygram11/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"""

__version__ = "0.999"
__version__ = "0.13.2"

from ._hist import ( # noqa
bin_centers,
Expand Down
12 changes: 0 additions & 12 deletions tests/test_hist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
):
Expand Down Expand Up @@ -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
Expand All @@ -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,))
Expand All @@ -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,))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
):
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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])
Expand Down

0 comments on commit 89a3154

Please sign in to comment.