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

Code update for Ansvec __getitem__ to handle complex dtype #1882

Merged
merged 6 commits into from
Feb 24, 2023

Conversation

kmkoshy
Copy link
Contributor

@kmkoshy kmkoshy commented Feb 23, 2023

Code change to handle Issue #1881

Description of the Issue :
Indexing Items from a AnsVec of complex datatype which has both real and imag values, returns only the real value.
There is no way of accessing the imaginary value unless AnsVec is changed to numpy array.

image

Close #1881

@kmkoshy kmkoshy requested a review from germa89 February 23, 2023 13:23
@github-actions github-actions bot added the BUG Issue, problem or error in PyMAPDL label Feb 23, 2023
@github-actions
Copy link
Contributor

Please add one of the following labels to add this contribution to the Release Notes 👇

@kmkoshy kmkoshy changed the title Code change to fix Ansvec __getitem__ to handle complex dtype Code update for Ansvec __getitem__ to handle complex dtype Feb 23, 2023
@codecov
Copy link

codecov bot commented Feb 23, 2023

Codecov Report

Merging #1882 (1b5bedb) into main (eda2e39) will decrease coverage by 0.14%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1882      +/-   ##
==========================================
- Coverage   85.86%   85.72%   -0.14%     
==========================================
  Files          44       44              
  Lines        7844     7853       +9     
==========================================
- Hits         6735     6732       -3     
- Misses       1109     1121      +12     

Copy link
Contributor

@clatapie clatapie left a comment

Choose a reason for hiding this comment

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

Good point! Thank you @kmkoshy. 😄

tests/test_math.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@germa89 germa89 left a comment

Choose a reason for hiding this comment

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

I wasn't aware how MAPDL stores de complex numbers. It seems it is just an array with two columns. Always there is something to learn!

Good PR. Nice pick.
Thank you @kmkoshy :)

src/ansys/mapdl/core/math.py Outdated Show resolved Hide resolved
src/ansys/mapdl/core/math.py Outdated Show resolved Hide resolved
tests/test_math.py Outdated Show resolved Hide resolved
Copy link
Contributor

@clatapie clatapie left a comment

Choose a reason for hiding this comment

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

It looks to me. 😄

@kmkoshy kmkoshy merged commit 89da3a4 into main Feb 24, 2023
@kmkoshy kmkoshy deleted the fix_vec_get_item branch February 24, 2023 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Issue, problem or error in PyMAPDL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indexing of math.AnsVec of complex dtype does not return imag values
3 participants