From 911b3eef59f9e18ece4c8d1a8f12f326319851bf Mon Sep 17 00:00:00 2001 From: Roy Smart Date: Mon, 13 Jan 2025 09:49:11 -0700 Subject: [PATCH] Improved `named_arrays.histogramdd()` to automatically cast arguments to instances of `AbstractArray`. (#102) --- .github/workflows/publish.yml | 4 ++-- .github/workflows/tests.yml | 2 +- named_arrays/_named_array_functions.py | 2 +- named_arrays/tests/test_core.py | 4 ++++ pyproject.toml | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3df360b2..473fa4e6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - name: Set up Python 3.10 + - name: Set up Python uses: actions/setup-python@v3 with: - python-version: "3.10" + python-version: "3.11" - name: Install pypa/build run: >- python -m diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e80f0a20..bf6e26e4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", ] + python-version: ["3.11", ] os: [ ubuntu-latest, windows-latest, diff --git a/named_arrays/_named_array_functions.py b/named_arrays/_named_array_functions.py index 0c355ca2..4202facd 100644 --- a/named_arrays/_named_array_functions.py +++ b/named_arrays/_named_array_functions.py @@ -943,7 +943,7 @@ def histogramdd( """ return _named_array_function( histogramdd, - *sample, + *[na.as_named_array(s) for s in sample], axis=axis, bins=bins, min=min, diff --git a/named_arrays/tests/test_core.py b/named_arrays/tests/test_core.py index 75aa6b42..505e0134 100644 --- a/named_arrays/tests/test_core.py +++ b/named_arrays/tests/test_core.py @@ -1428,6 +1428,10 @@ def test_plt_plot_like( func(*args, **kwargs) return + for index in ax_normalized.ndindex(): + ax_normalized[index].ndarray.xaxis._converter = None + ax_normalized[index].ndarray.yaxis._converter = None + with astropy.visualization.quantity_support(): result = func(*args, **kwargs) diff --git a/pyproject.toml b/pyproject.toml index 37a12681..ae5885f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ dependencies = [ "numpy<2", "matplotlib", "scipy", - 'astropy<6.1.5', + "astropy", "astroscrappy", "ndfilters==0.3.0", "colorsynth==0.1.5",