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.0 #553

Merged
merged 7 commits into from
Jul 2, 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
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.3.10'
Out[2]: '0.4.0'
```

### Create a [`FieldArray`](https://mhostetter.github.io/galois/latest/api/galois.FieldArray/) subclass
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ If this library was useful to you in your research, please cite us. Following th
:hidden:

release-notes/versioning.rst
release-notes/v0.4.md
release-notes/v0.3.md
release-notes/v0.2.md
release-notes/v0.1.md
Expand Down
19 changes: 19 additions & 0 deletions docs/release-notes/v0.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
tocdepth: 2
---

# v0.4

## v0.4.0

*Released July 2, 2024*

### Changes

- Added support for NumPy 2.0. ([#550](https://github.com/mhostetter/galois/pull/550))
- Added support for Numba 0.60. ([#550](https://github.com/mhostetter/galois/pull/550))

### Contributors

- Iyán Méndez Veiga ([@iyanmv](https://github.com/iyanmv))
- Matt Hostetter ([@mhostetter](https://github.com/mhostetter))
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ classifiers = [
]
requires-python = ">=3.7"
dependencies = [
"numpy >= 1.21.0, < 1.27", # 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.60", # v0.55 is needed for support of NumPy 1.21
"numpy >= 1.21.0, < 2.1", # 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
"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 src/galois/_domains/_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class FunctionMixin(np.ndarray, metaclass=ArrayMeta):
np.unpackbits,
np.unwrap,
np.around,
np.round_,
np.round,
np.fix,
np.gradient,
np.trapz,
Expand Down
6 changes: 5 additions & 1 deletion src/galois/_domains/_ufunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,11 @@ def __call__(self, ufunc, method, inputs, kwargs, meta):
self._verify_operands_in_field_or_int(ufunc, inputs, meta)
inputs, kwargs = self._view_inputs_as_ndarray(inputs, kwargs)
i = meta["non_field_operands"][0] # Scalar multiplicand
inputs[i] = np.mod(inputs[i], self.field.characteristic)
if meta["dtype"] == np.object_:
# Need to explicitly cast to np.object_ in NumPy v2.0 or the integer will overflow
inputs[i] = np.mod(inputs[i], self.field.characteristic, dtype=np.object_)
else:
inputs[i] = np.mod(inputs[i], self.field.characteristic)
inputs, kwargs = self._view_inputs_as_ndarray(inputs, kwargs)
output = getattr(self.ufunc, method)(*inputs, **kwargs)
output = self._view_output_as_field(output, self.field, meta["dtype"])
Expand Down
2 changes: 1 addition & 1 deletion src/galois/_fields/_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ def additive_order(self) -> int | np.ndarray:
if x.ndim == 0:
order = 1 if x == 0 else field.characteristic
else:
order = field.characteristic * np.ones(x.shape, dtype=np.int64)
order = field.characteristic * np.ones(x.shape, dtype=field.dtypes[-1])
order[np.where(x == 0)] = 1

return order
Expand Down
4 changes: 2 additions & 2 deletions src/galois/_polys/_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def implementation(nonzero_degrees, nonzero_coeffs, primitive_element): # pragm
# Test if 0 is a root
if nonzero_degrees[-1] != 0:
roots.append(0)
powers.append(-1)
powers.append(nonzero_degrees[-1]) # 0 has multiplicity equal to the lowest degree of x that is non-zero

# Test if 1 is a root
_sum = 0
Expand All @@ -510,4 +510,4 @@ def implementation(nonzero_degrees, nonzero_coeffs, primitive_element): # pragm
if len(roots) == degree:
break

return np.array([roots, powers], dtype=nonzero_coeffs.dtype)
return np.array([roots, powers])
Loading