-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: exposing quantity types in PyDPF Core #1965
Open
a-bouth
wants to merge
5
commits into
master
Choose a base branch
from
feat/exposing_quantity_types
base: master
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
Conversation
This file contains 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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1965 +/- ##
===========================================
- Coverage 88.35% 50.56% -37.80%
===========================================
Files 89 89
Lines 10242 10255 +13
===========================================
- Hits 9049 5185 -3864
- Misses 1193 5070 +3877 |
cbellot000
approved these changes
Dec 12, 2024
@@ -153,6 +153,61 @@ def dimensionality(self): | |||
self._api.csfield_definition_fill_dimensionality(self, dim, nature, dim.internal_size) | |||
return Dimensionality(dim.tolist(), natures(int(nature))) | |||
|
|||
def get_quantity_type(self, index=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe having just one property which returns the quantity_types would be easier too use, what do you think?
cbellot000
approved these changes
Dec 13, 2024
[like] Camille Bellot reacted to your message:
________________________________
From: Alexandre Bouthéon ***@***.***>
Sent: Friday, December 13, 2024 9:34:58 AM
To: ansys/pydpf-core ***@***.***>
Cc: Camille Bellot ***@***.***>; Mention ***@***.***>
Subject: Re: [ansys/pydpf-core] feat: exposing quantity types in PyDPF Core (PR #1965)
[External Sender]
@a-bouth commented on this pull request.
________________________________
In src/ansys/dpf/core/field_definition.py<#1965 (comment)>:
+ raise ValueError("Index must be greater than or equal to 0")
+
+ quantity_type = self._api.csfield_definition_get_quantity_type(self, index)
+ return str(quantity_type)
+
+ def set_quantity_type(self, quantity_type):
+ """Setter for Quantity Type
+
+ Parameters
+ ----------
+ quantity_type: Quantity Type
+ Quantity type to set
+ """
+ self._api.csfield_definition_set_quantity_type(self, quantity_type)
+
+ def get_num_available_quantity_types(self):
@cbellot000<https://github.com/cbellot000> done
—
Reply to this email directly, view it on GitHub<#1965 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ATF7SHXXBBRJOOB67UUCIEL2FKS4FAVCNFSM6AAAAABTPFTM5KVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMBRHAZTSNBXGA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Exposing the
quantity_type
forFieldsDefinition
Main Changes
field_definition_capi.py
field_definition.py
@property
decorator forquantity_type
, but it turns out that the getter needs an index, which we cannot specify with the@property
decorator. I opted for defining explicitsget_quantity_type(index)
andset_quantity_type()
methods. Please let me know if I should do it differently.is_of_quantity_type()
andget_num_quantity_types_available()
test_field.py
(I found other tests forFieldDefinition
here, but maybe that's not the best place ?)