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 Scoping.ids setter for int64 arrays #2040

Merged
merged 8 commits into from
Jan 28, 2025

Conversation

PProfizi
Copy link
Contributor

@PProfizi PProfizi commented Jan 27, 2025

Closes #2037

Edit: this fixes the issue for np.ndarray(dtype=int64) which is the new default, however for some reason the case:

from ansys.dpf import core as dpf
import numpy as np

nids = np.array([1,2,3,4],dtype=int)
nids = list(nids)
print(nids)
scop = dpf.Scoping(ids=nids, location= dpf.locations.nodal)
print(nids)
print(scop.ids)

already worked despite the list being:
[np.int64(1), np.int64(2), np.int64(3), np.int64(4)]

Why would this case work? In theory these too would need to be converted to int32.

@PProfizi PProfizi added the bug Something isn't working label Jan 27, 2025
@PProfizi PProfizi added this to the 0.13.5 milestone Jan 27, 2025
@PProfizi PProfizi requested a review from rafacanton January 27, 2025 11:15
@PProfizi PProfizi self-assigned this Jan 27, 2025
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.56%. Comparing base (17bc61f) to head (78b2883).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2040      +/-   ##
==========================================
+ Coverage   87.51%   88.56%   +1.05%     
==========================================
  Files          90       90              
  Lines       10220    10225       +5     
==========================================
+ Hits         8944     9056     +112     
+ Misses       1276     1169     -107     

@PProfizi PProfizi requested a review from cbellot000 January 27, 2025 13:49
@PProfizi PProfizi merged commit 086a68e into master Jan 28, 2025
45 checks passed
@PProfizi PProfizi deleted the fix/scoping_ids_setter_int_precision branch January 28, 2025 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DPF scoping creation using Numpy arrays in Numpy2
3 participants