Skip to content

Conversation

@robrohan
Copy link

This just changes a few itemset calls to array index setting calls. The old itemset calls fails on newer numpy versions.

Environment

% python --version => Python 3.11.11

>>> import numpy
>>> numpy.version.version
'2.2.5'

Fixing Issue

% python -m mathematics_dataset.generate --filter=linear_1d

Traceback (most recent call last):
 ...
  File "/Users/robrohan/Projects/SideProjects/mathematics_dataset/mathematics_dataset/sample/polynomials.py", line 222, in sample_coefficients
    coeffs.itemset(index, value)
    ^^^^^^^^^^^^^^
AttributeError: `itemset` was removed from the ndarray class in NumPy 2.0. Use `arr[index] = value` instead.

After the change it generates correctly.

Just changed a few references to array elements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant