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

Release 0.4.4 #588

Merged
merged 9 commits into from
Jan 21, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
build-wheel:
name: Wheel
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -38,7 +38,7 @@ jobs:
run: python3 -m twine check dist/*

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: tar -czvf docs.tar.gz -C docs/build/ .

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docs
path: docs.tar.gz
Expand All @@ -69,7 +69,7 @@ jobs:
ref: gh-pages

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: docs

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ on:
jobs:
run-linter:
name: Ruff Lint
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12, 3.13]
steps:
- uses: actions/checkout@v3

Expand All @@ -43,10 +43,10 @@ jobs:
steps:
- uses: actions/checkout@v3

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

- name: Upgrade pip
run: python3 -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
steps:
- uses: actions/checkout@v3

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

- name: Upgrade pip
run: python3 -m pip install --upgrade pip
Expand Down Expand Up @@ -82,8 +82,8 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12]
os: [ubuntu-22.04, macos-13, windows-latest]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12, 3.13]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -138,8 +138,8 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12]
os: [ubuntu-22.04, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12, 3.13]
# https://github.com/actions/runner-images/issues/9770#issuecomment-2085623315
exclude: # Python < v3.8 does not support Apple Silicon ARM64
- python-version: "3.7"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.9.2
hooks:
- id: ruff
- id: ruff-format
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Import the `galois` package in Python.
In [1]: import galois

In [2]: galois.__version__
Out[2]: '0.4.3'
Out[2]: '0.4.4'
```

### Create a [`FieldArray`](https://mhostetter.github.io/galois/latest/api/galois.FieldArray/) subclass
Expand Down
14 changes: 14 additions & 0 deletions docs/release-notes/v0.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,17 @@ tocdepth: 2
- TDQuering ([@TDQuering](https://github.com/TDQuering))
- maple ([@maple3142](https://github.com/maple3142))
- Matt Hostetter ([@mhostetter](https://github.com/mhostetter))

## v0.4.4

*Released January 21, 2025*

### Changes

- Added support for Python 3.13. ([#587](https://github.com/mhostetter/galois/pull/587))
- Added support for NumPy 2.1. ([#587](https://github.com/mhostetter/galois/pull/587))
- Added support for Numba 0.61. ([#587](https://github.com/mhostetter/galois/pull/587))

### Contributors

- Matt Hostetter ([@mhostetter](https://github.com/mhostetter))
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Security :: Cryptography",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand All @@ -51,7 +52,7 @@ classifiers = [
requires-python = ">=3.7"
dependencies = [
"numpy >= 1.21.0", # v1.21.0 is needed for dtype support of ufuncs, see https://numpy.org/devdocs/release/1.21.0-notes.html#ufunc-signature-and-dtype-generalization-and-casting
"numba >= 0.55, < 0.61", # v0.55 is needed for support of NumPy 1.21
"numba >= 0.55, < 0.62", # v0.55 is needed for support of NumPy 1.21
"typing_extensions >= 4.0.0", # v4.0.0 is needed for use of Self (Python 3.11+) and Literal (Python 3.8+)
]
dynamic = ["version"]
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ruff == 0.4.7
ruff == 0.9.2
pytest
pytest-cov[toml]
pytest-xdist
Expand Down
2 changes: 2 additions & 0 deletions requirements-min.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
numpy==2.1.0; python_version=="3.13"
numpy==1.26.0; python_version=="3.12"
numpy==1.23.2; python_version=="3.11"
numpy==1.21.3; python_version=="3.10"
numpy==1.21.0; python_version=="3.9"
numpy==1.21.0; python_version=="3.8"
numpy==1.21.0; python_version=="3.7"
numba==0.61.0; python_version=="3.13"
numba==0.59.0; python_version=="3.12"
numba==0.57.0; python_version=="3.11"
numba==0.55.0; python_version=="3.10"
Expand Down
12 changes: 6 additions & 6 deletions scripts/create_prime_factors_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ def parse_factors_string(table: dict, rows: dict, row: dict, string: str, letter
# A special composite. Verify that it divides the remaining value.
label = prime_composite_label(table, row["n"], letter)
key = (label, factor)
assert (
row["composite"] % table["composites"][key] == 0
), f"{row['composite']} is not divisible by {table['composites'][key]}"
assert row["composite"] % table["composites"][key] == 0, (
f"{row['composite']} is not divisible by {table['composites'][key]}"
)
else:
# Must be a regular integer
factor = int(factor)
Expand Down Expand Up @@ -499,9 +499,9 @@ def create_even_negative_offset_table(conn: sqlite3.Connection, cursor: sqlite3.

row = select_two_factorizations_from_database(cursor, A_value, B_value)
if row is None:
assert (
k == k_fail
), f"The {base}^(2k) - 1 table generation failed at k = {k}, but should have failed at k = {k_fail}"
assert k == k_fail, (
f"The {base}^(2k) - 1 table generation failed at k = {k}, but should have failed at k = {k_fail}"
)
break

exponent = 2 * k
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_field_test_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ def make_luts(field, sub_folder, seed, sparse=False):
Z = [0] * 3 # The lagrange polynomial
for i in range(3):
N = min(10, order)
if dtype == object:
if dtype is object:
x = randint_matrix(0, order, (N,))
else:
x = np.array(random.sample(range(0, order), N), dtype=dtype)
Expand Down
2 changes: 1 addition & 1 deletion scripts/sparse_poly_performance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_coeffs(degree, N, field):
N = 3 # Number of non-zero coefficients
degree = 100
while degree <= 1000:
print(f"Nonzero: {N} / {degree}, {N/degree*100} %")
print(f"Nonzero: {N} / {degree}, {N / degree * 100} %")
p1 = galois.Poly.Degrees(*get_coeffs(degree, N, GF))
p2 = galois.Poly.Degrees(*get_coeffs(degree, N, GF))

Expand Down
2 changes: 1 addition & 1 deletion src/galois/_polys/_lagrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class lagrange_poly_jit(Function):
def __call__(self, x: Array, y: Array) -> Array:
verify_isinstance(x, Array)
verify_isinstance(y, Array)
if not type(x) == type(y):
if not type(x) is type(y):
raise TypeError(f"Arguments 'x' and 'y' must be over the same Galois field, not {type(x)} and {type(y)}.")
if not x.ndim == 1:
raise ValueError(f"Argument 'x' must be 1-D, not have shape {x.shape}.")
Expand Down
12 changes: 6 additions & 6 deletions src/galois/_polys/_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ def recursive(
yield poly
elif terms == 1:
# The last term must be the x^0 term, so we don't need to loop over possible degrees.
for coeff in direction(range(1, field.order)):
for c in direction(range(1, field.order)):
next_degrees = (*degrees, 0)
next_coeffs = (*coeffs, coeff)
next_coeffs = (*coeffs, c)
yield from recursive(next_degrees, next_coeffs, terms - 1)
else:
# Find the next term's degree. It must be at least terms - 1 so that the polynomial can have the specified
# number of terms of lesser degree. It must also be less than the degree of the previous term.
for degree in direction(range(terms - 1, degrees[-1])):
for coeff in direction(range(1, field.order)):
next_degrees = (*degrees, degree)
next_coeffs = (*coeffs, coeff)
for d in direction(range(terms - 1, degrees[-1])):
for c in direction(range(1, field.order)):
next_degrees = (*degrees, d)
next_coeffs = (*coeffs, c)
yield from recursive(next_degrees, next_coeffs, terms - 1)

# Initialize the search by setting the first term to x^m with coefficient 1. This function will
Expand Down
Loading