From d82df6744efe3fe2e178853c7f83b643040b44c6 Mon Sep 17 00:00:00 2001 From: Chris Havlin Date: Mon, 8 Jan 2024 09:41:26 -0600 Subject: [PATCH 1/4] enable unyt 3.0 --- pyVBRc/tests/test_pyVBRc.py | 6 ++++++ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pyVBRc/tests/test_pyVBRc.py b/pyVBRc/tests/test_pyVBRc.py index be16c70..73e8387 100644 --- a/pyVBRc/tests/test_pyVBRc.py +++ b/pyVBRc/tests/test_pyVBRc.py @@ -46,6 +46,12 @@ def test_interpolator(fname): dgval = vbr.input.SV.dg_um.min() phi_targets = np.full(T_targets.shape, np.log10(phival)) dg_targets = np.full(T_targets.shape, np.log10(dgval)) + if isinstance(T_targets, unyt_array): + T_targets = T_targets.d + if isinstance(dg_targets, unyt_array): + dg_targets = dg_targets.d + if isinstance(phi_targets, unyt_array): + phi_targets = phi_targets.d targets = np.column_stack((T_targets, phi_targets, dg_targets)) Vs_interp = interp(targets) assert len(Vs_interp) == nT * 2 diff --git a/pyproject.toml b/pyproject.toml index 287c31f..f966326 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies=["numpy", "scipy", "matplotlib", "packaging", - "unyt<3.0", + "unyt", ] [tool.setuptools] From 0d658a46783ff56bc97fa044b02589488dff63a8 Mon Sep 17 00:00:00 2001 From: Chris Havlin Date: Mon, 8 Jan 2024 09:48:07 -0600 Subject: [PATCH 2/4] bump action versions --- .github/workflows/build-test.yaml | 4 ++-- .github/workflows/check-build.yml | 4 ++-- .github/workflows/check-manifest.yaml | 4 ++-- .github/workflows/create-release.yaml | 2 +- .github/workflows/pypi-release.yaml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index a5587e7..4dcc3d1 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -11,9 +11,9 @@ jobs: python-version: ['3.9', '3.10', '3.11'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index 36e44c6..dbdc58c 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -6,9 +6,9 @@ jobs: name: Build Verification runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.9 - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: 3.9 - name: Install dependencies diff --git a/.github/workflows/check-manifest.yaml b/.github/workflows/check-manifest.yaml index 53c365b..7031019 100644 --- a/.github/workflows/check-manifest.yaml +++ b/.github/workflows/check-manifest.yaml @@ -7,9 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Source - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.9 - name: install check-manifest diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 277653f..afd66b4 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -12,7 +12,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pypi-release.yaml b/.github/workflows/pypi-release.yaml index 9be150d..08a4d78 100644 --- a/.github/workflows/pypi-release.yaml +++ b/.github/workflows/pypi-release.yaml @@ -11,9 +11,9 @@ jobs: name: Build and Publish runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.9 - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: 3.9 - name: Install dependencies From c6036e6b9cfc3e67e0480fefcb37c66d616fcae0 Mon Sep 17 00:00:00 2001 From: Chris Havlin Date: Mon, 8 Jan 2024 09:51:16 -0600 Subject: [PATCH 3/4] no submodules, rm submolue init from check-manifest --- .github/workflows/check-manifest.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/check-manifest.yaml b/.github/workflows/check-manifest.yaml index 7031019..faffbdb 100644 --- a/.github/workflows/check-manifest.yaml +++ b/.github/workflows/check-manifest.yaml @@ -23,7 +23,5 @@ jobs: shell: bash run: | python -m pip install --no-build-isolation . - - name: Init submodules - uses: snickerbockers/submodules-init@v4 - name: run check-manifest run: check-manifest -vvv From 9cec1662deaadfd6bf46a89fc44b3d08e036de9b Mon Sep 17 00:00:00 2001 From: Chris Havlin Date: Mon, 8 Jan 2024 09:52:28 -0600 Subject: [PATCH 4/4] only T array **can** have units --- pyVBRc/tests/test_pyVBRc.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyVBRc/tests/test_pyVBRc.py b/pyVBRc/tests/test_pyVBRc.py index 73e8387..ba547a5 100644 --- a/pyVBRc/tests/test_pyVBRc.py +++ b/pyVBRc/tests/test_pyVBRc.py @@ -48,10 +48,6 @@ def test_interpolator(fname): dg_targets = np.full(T_targets.shape, np.log10(dgval)) if isinstance(T_targets, unyt_array): T_targets = T_targets.d - if isinstance(dg_targets, unyt_array): - dg_targets = dg_targets.d - if isinstance(phi_targets, unyt_array): - phi_targets = phi_targets.d targets = np.column_stack((T_targets, phi_targets, dg_targets)) Vs_interp = interp(targets) assert len(Vs_interp) == nT * 2