Skip to content

feat: node/element selection commands returning selected ids#3636

Merged
moe-ad merged 9 commits into
mainfrom
feat/selection-commands-returning-ids
Jan 8, 2025
Merged

feat: node/element selection commands returning selected ids#3636
moe-ad merged 9 commits into
mainfrom
feat/selection-commands-returning-ids

Conversation

@moe-ad

@moe-ad moe-ad commented Jan 7, 2025

Copy link
Copy Markdown
Contributor

Description

Currently, commands such as mapdl.nsel() or mapdl.esel() will return a numpy array of selected objects' IDs. This is extremely useful when scripting since the selected IDs can be saved in a variable to be accessed later. Similar commands like mapdl.esln() or mapdl.nsle() do not have this behavior. Instead they return some selection status string from the running mapdl instance.

This PR adds the described functionality to the mapdl.esln() and mapdl.nsle() commands.

Issue linked

This PR will close #3635

Checklist

@moe-ad moe-ad self-assigned this Jan 7, 2025
@ansys-reviewer-bot

Copy link
Copy Markdown
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@github-actions github-actions Bot added the new feature Request or proposal for a new feature label Jan 7, 2025
@moe-ad moe-ad changed the title Feat: Node/Element selection commands returning selected IDs feat: node/element selection commands returning selected ids Jan 7, 2025
@github-actions github-actions Bot added examples Publishing PyMAPDL examples documentation Documentation related (improving, adding, etc) labels Jan 7, 2025
@moe-ad

moe-ad commented Jan 7, 2025

Copy link
Copy Markdown
Contributor Author

Before:
before

After:
after

Looks like that is everything that requires changing. Pinging @germa89 incase there is anything else to take note of.
@clatapie thanks for our discussions on this.

@github-actions github-actions Bot removed examples Publishing PyMAPDL examples documentation Documentation related (improving, adding, etc) labels Jan 7, 2025

@germa89 germa89 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thank you a lot for this @moe-ad :). However, for this to be approved, you need to add some unit tests. I'm sure you know the procedure, but in case you have any doubt please check: https://mapdl.docs.pyansys.com/version/stable/getting_started/develop_pymapdl.html#unit-testing

Which you can reach from main documentation page https://mapdl.docs.pyansys.com :

image

@codecov

codecov Bot commented Jan 7, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.06%. Comparing base (e83f46c) to head (0a824bb).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3636      +/-   ##
==========================================
- Coverage   87.08%   87.06%   -0.02%     
==========================================
  Files         187      187              
  Lines       14679    14683       +4     
==========================================
+ Hits        12783    12784       +1     
- Misses       1896     1899       +3     

@moe-ad

moe-ad commented Jan 8, 2025

Copy link
Copy Markdown
Contributor Author

@germa89 , thanks for the guide. I have added the tests.

@moe-ad moe-ad marked this pull request as ready for review January 8, 2025 09:29
@moe-ad moe-ad requested a review from a team as a code owner January 8, 2025 09:29

@germa89 germa89 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Thank you a lot @moe-ad ! Feel free to merge!

@moe-ad moe-ad merged commit ce34c76 into main Jan 8, 2025
@moe-ad moe-ad deleted the feat/selection-commands-returning-ids branch January 8, 2025 11:40
@jorgepiloto

Copy link
Copy Markdown
Member

Congrats on this, @moe-ad 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Request or proposal for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node/Element selection commands returning selected IDs

4 participants