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

Fix GitHub workflow CI #438

Merged
merged 3 commits into from
Dec 11, 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
36 changes: 18 additions & 18 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.11]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: [3.11]
python-version: ["3.11"]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and throughout; otherwise when we eventually reach 3.20, yaml will parse it as 3.2!)

Copy link
Contributor Author

@trundev trundev Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, 3.20 is the same as 3.2, i.e. must use "3.20".
BTW, this is valid for "3.10" also - I skipped it, but it could soon become the "legacy" version.

So, quotes are mandatory for versions that ends in zeros, otherwise - recommended. I suggest quoting all the versions. Is this ok?

name: "lint | Python ${{ matrix.python-version }}"
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
Expand All @@ -45,37 +45,37 @@ jobs:
matrix:
include:
# fastest jobs first
- python-version: 3.8
- python-version: 3.11
name: without JIT
disable_jit: 1
- python-version: 3.8
- python-version: 3.11
name: doctests
mode: doctests
# really slow job next, so it runs in parallel with the others
- python-version: 3.8
- python-version: 3.11
name: slow tests
mode: very_slow
- python-version: 3.5
name: default
- python-version: 3.8
name: default
- python-version: 3.9
- python-version: 3.11
name: default
- python-version: 3.8
- python-version: 3.12
name: default
- python-version: 3.11
name: conda
conda: true
- python-version: 3.8
- python-version: 3.11
name: benchmarks
mode: bench

name: "build | ${{ matrix.name }} | Python ${{matrix.python-version}}"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# python / pip
- name: Set up Python ${{ matrix.python-version }}
if: "!matrix.conda"
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -89,7 +89,7 @@ jobs:
# conda
- name: Set up Python ${{ matrix.python-version }} (conda)
if: matrix.conda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -146,24 +146,24 @@ jobs:
# if: ${{ always() }}
# with:
# report_paths: 'junit/test-results.xml'
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v5

deploy:
needs: test
runs-on: ubuntu-latest
name: deploy
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"
run: |
python -m pip install --upgrade pip;
python -m pip install build
python -m build --sdist --wheel --outdir dist/
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
Expand Down
2 changes: 1 addition & 1 deletion clifford/_conformal_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def up(self, x: MultiVector) -> MultiVector:
new_val = np.zeros(self.gaDims)
new_val[:len(old_val)] = old_val
x = self.MultiVector(value=new_val)
except(AttributeError):
except AttributeError:
# if x is a scalar it does not have layout but following
# will still work
pass
Expand Down
2 changes: 1 addition & 1 deletion clifford/cga.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
arg = float(arg)

if arg < 0:
raise(ValueError('dilation should be positive'))
raise ValueError('dilation should be positive')

Check warning on line 402 in clifford/cga.py

View check run for this annotation

Codecov / codecov/patch

clifford/cga.py#L402

Added line #L402 was not covered by tests

mv = e**((-log(arg)/2.)*(self.cga.E0))

Expand Down
6 changes: 3 additions & 3 deletions clifford/test/test_clifford.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def test_2d_mv_array(self, g3, rng): # noqa: F811
# check properties of the array are preserved (no need to check both a and b)
np.testing.assert_array_equal(mv_array_a.value, value_array_a)
assert mv_array_a.value.dtype == value_array_a.dtype
assert type(mv_array_a.value) == type(value_array_a)
assert type(mv_array_a.value) is type(value_array_a)

# Check addition
mv_array_sum = mv_array_a + mv_array_b
Expand Down Expand Up @@ -806,9 +806,9 @@ def check_inv(self, A):
for m, a in enumerate(A):
for n, b in enumerate(A.inv):
if m == n:
assert(a | b == 1)
assert (a | b == 1)
else:
assert(a | b == 0)
assert (a | b == 0)

@pytest.mark.parametrize(('p', 'q'), [
(2, 0), (3, 0), (4, 0)
Expand Down
17 changes: 6 additions & 11 deletions clifford/test/test_g3c_tools.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import random
from functools import reduce
import time
import functools


import numpy as np
import numpy.testing as npt
from numpy import exp
import pytest
import numba

from clifford import Cl
from clifford.g3c import *
from clifford.tools.g3c import *
from clifford.tools.g3c.rotor_parameterisation import ga_log, ga_exp, general_logarithm, \
interpolate_rotors
from clifford.tools.g3c.rotor_parameterisation import ga_log, general_logarithm
from clifford.tools.g3c.rotor_estimation import *
from clifford.tools.g3c.object_clustering import *
from clifford.tools.g3c.scene_simplification import *
Expand Down Expand Up @@ -175,7 +170,7 @@ def test_general_logarithm_TRS(self, rng): # noqa: F811
V = (T * R * S).normal()
biv = general_logarithm(V)
V_rebuilt = biv.exp().normal()
biv2 = general_logarithm(V)
_ = general_logarithm(V)

C1 = random_point_pair(rng=rng)
C2 = (V * C1 * ~V).normal()
Expand Down Expand Up @@ -381,8 +376,8 @@ def test_closest_furthest_circle_points(self, rng): # noqa: F811
for _ in range(100):
C1 = random_circle(rng=rng)
C2 = random_circle(rng=rng)
pclose = iterative_closest_points_on_circles(C1, C2)
pfar = iterative_furthest_points_on_circles(C1, C2)
_ = iterative_closest_points_on_circles(C1, C2)
_ = iterative_furthest_points_on_circles(C1, C2)

def test_closest_points_circle_line(self, rng): # noqa: F811
"""
Expand Down Expand Up @@ -740,7 +735,7 @@ def test_rotor_between_non_overlapping_spheres(self, rng): # noqa: F811
rad = get_radius_from_sphere(C1)
t_r = generate_translation_rotor(2.5*rad*e1)
C2 = (t_r * C1 * ~t_r)(4).normal()
rad2 = get_radius_from_sphere(C2)
_ = get_radius_from_sphere(C2)
R = rotor_between_objects(C1, C2)
C3 = (R * C1 * ~R).normal()
if sum(np.abs((C2 + C3).value)) < 0.0001:
Expand Down Expand Up @@ -1021,7 +1016,7 @@ def test_assign_objects_to_objects(self, obj_gen, rng): # noqa: F811

n_repeats = 5
for i in range(n_repeats):
r = random_rotation_translation_rotor(0.001, np.pi / 32, rng=rng)
_ = random_rotation_translation_rotor(0.001, np.pi / 32, rng=rng)
object_set_a = [obj_gen(rng=rng) for i in range(20)]
object_set_b = [l for l in object_set_a]
label_a, costs_a = assign_measurements_to_objects_matrix(object_set_a, object_set_b)
Expand Down
3 changes: 1 addition & 2 deletions clifford/tools/g3c/rotor_estimation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import random
from scipy import e
import numpy as np
import multiprocessing

Expand Down Expand Up @@ -379,7 +378,7 @@
""" Performs the extended cartans algorithm as suggested by Alex Arsenovic """
V_found, rs = cartan(A=obj_list_a, B=obj_list_b)
theta = ((V_found*~V_found)*e1234)(0)
V_found = e**(-theta/2*e123inf)*V_found
V_found = np.e**(-theta/2*e123inf)*V_found

Check warning on line 381 in clifford/tools/g3c/rotor_estimation.py

View check run for this annotation

Codecov / codecov/patch

clifford/tools/g3c/rotor_estimation.py#L381

Added line #L381 was not covered by tests
return V_found


Expand Down
Loading