Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update github actions #54

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:
uses: rlespinasse/[email protected]

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: main
fetch-depth: 0

- name: Checkout gh-pages
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
if: github.repository == 'issp-center-dev/PHYSBO'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/python_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ on: [push]

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
max-parallel: 3
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
18 changes: 3 additions & 15 deletions tests/unit/test_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ def test_get_subset(variable, X, t, Z, index):
assert np.array_equal(var2.Z, Z[index, :])


def test_delete(variable, mocker):
delete_X = mocker.patch("physbo.variable.delete_X")
delete_t = mocker.patch("physbo.variable.delete_t")
delete_Z = mocker.patch("physbo.variable.delete_Z")
variable.delete(1)
delete_X.assert_called_once_with(1)
delete_t.assert_called_once_with(1)
delete_Z.assert_called_once_with(1)


@pytest.mark.parametrize("index", [2, [0, 1]])
def test_delete_X(variable, X, index):
Expand All @@ -68,13 +59,10 @@ def test_delete_Z(variable, Z, index):


def test_add(variable, X, t, Z, mocker):
add_X = mocker.patch("physbo.variable.add_X")
add_t = mocker.patch("physbo.variable.add_t")
add_Z = mocker.patch("physbo.variable.add_Z")
variable.add(X, t, Z)
add_X.assert_called_once_with(X)
add_t.assert_called_once_with(t)
add_Z.assert_called_once_with(Z)
assert np.array_equal(variable.X, np.vstack((X,X)))
assert np.array_equal(variable.t, np.hstack((t,t)))
assert np.array_equal(variable.Z, np.vstack((Z,Z)))


def test_add_X(variable, X):
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
requires = tox>=4
envlist = py37, py38, py39, py310, docs
envlist = py37, py38, py39, py310, py311, docs
isolated_build = true

[gh-actions]
Expand All @@ -9,6 +9,7 @@ python =
'3.8': py38
'3.9': py39
'3.10': py310
'3.11': py311

[testenv]
deps =
Expand Down