-
Notifications
You must be signed in to change notification settings - Fork 226
FEAT: Improve consistency #7264
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
Open
Devin-Crawford
wants to merge
25
commits into
main
Choose a base branch
from
fix/7257_improve_consistency_get_object
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
341109e
Improve consistency
Devin-Crawford 132a4ee
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] 0c9ac43
chore: adding changelog file 7264.added.md [dependabot-skip]
pyansys-ci-bot 99fbbcc
Reinstate get_object_from_name
Devin-Crawford 22d3c40
Merge remote-tracking branch 'origin/fix/7257_improve_consistency_get…
Devin-Crawford e6b8b5d
Merge branch 'main' into fix/7257_improve_consistency_get_object
Devin-Crawford c72051e
Update src/ansys/aedt/core/modeler/cad/primitives.py
Samuelopez-ansys 761ff53
Update src/ansys/aedt/core/modeler/cad/primitives.py
Samuelopez-ansys 239e295
Merge branch 'main' into fix/7257_improve_consistency_get_object
Samuelopez-ansys 285e372
Update material value to allow file assignment
Devin-Crawford 821881d
Merge remote-tracking branch 'origin/fix/7257_improve_consistency_get…
Devin-Crawford 9df6acd
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] 350e906
Apply suggestion from @SMoraisAnsys
Devin-Crawford 033a5eb
Merge branch 'main' into fix/7257_improve_consistency_get_object
Devin-Crawford 8f2737d
Apply suggestion from @Devin-Crawford
Samuelopez-ansys 892febf
add test
Samuelopez-ansys 301bcc9
Fix conflicts
Samuelopez-ansys f69249e
Fix codacy
Samuelopez-ansys 1995f81
FIX: improve type hints for get_objects_by_name and get_object_from_n…
Samuelopez-ansys 518f585
Merge branch 'main' into fix/7257_improve_consistency_get_object
Samuelopez-ansys 22989a7
FIX: improve error handling and add validation for material value fil…
Samuelopez-ansys a141ea2
FIX: enhance get_objects_by_name method to support wildcard patterns …
Samuelopez-ansys 0be6151
Merge branch 'main' into fix/7257_improve_consistency_get_object
Samuelopez-ansys 81056ce
Merge branch 'main' into fix/7257_improve_consistency_get_object
SMoraisAnsys 52b5610
Update src/ansys/aedt/core/application/design.py
Samuelopez-ansys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Improve consistency |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7463,23 +7463,28 @@ def get_obj_id(self, assignment): | |
| return None | ||
|
|
||
| @pyaedt_function_handler() | ||
| def get_object_from_name(self, assignment): | ||
| """Return the object from an object name. | ||
| def get_objects_by_name(self, assignment, case_sensitive: bool = True): | ||
| """Return the objects given a search string. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| assignment : str | ||
| Name of the object. | ||
| String used to filter by object names.. | ||
| case_sensitive : bool, optional | ||
| Whether the string is case-sensitive. The default is ``True``. | ||
|
|
||
| Returns | ||
| ------- | ||
| :class:`ansys.aedt.core.modeler.cad.object_3d.Object3d` | ||
| 3D object returned. | ||
| list of class:`ansys.aedt.core.modeler.cad.object_3d.Object3d` | ||
| Returns a list of objects whose names contain the | ||
| search string.. | ||
Samuelopez-ansys marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| """ | ||
| if assignment in self.object_names: | ||
| # object_id = self.get_obj_id(objname) | ||
| return self.objects[assignment] | ||
| if case_sensitive: | ||
| return [o for name, o in self.objects_by_name.items() if assignment in name] | ||
| else: | ||
| return [o for name, o in self.objects_by_name.items() if assignment.lower() in name.lower()] | ||
| return None | ||
Devin-Crawford marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if this is required as, by default, every python function return None |
||
|
|
||
| @pyaedt_function_handler() | ||
| def get_objects_w_string(self, string_name, case_sensitive: bool = True): | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.