-
Notifications
You must be signed in to change notification settings - Fork 10
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
Expose streamlines #480
Expose streamlines #480
Conversation
Codecov Report
@@ Coverage Diff @@
## master #480 +/- ##
==========================================
+ Coverage 83.49% 83.77% +0.27%
==========================================
Files 45 47 +2
Lines 5041 5072 +31
==========================================
+ Hits 4209 4249 +40
+ Misses 832 823 -9 |
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.
@PProfizi Just made a couple of suggestions to avoid referring to velocity. This is way more general and applies to all vector fields. For example, when we support EMag data, the same method could be used to plot the magnetic field lines
Co-authored-by: Rafael Canton <[email protected]>
if mesh: | ||
meshed_region = mesh._meshed_region | ||
else: | ||
meshed_region = dataframe._fc[0].meshed_region |
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.
we will eventually need a public method in the dataframe to get the mesh, no?
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.
@cbellot000 sure, but again it will need a label logic to select which field's meshed_region is of interest, or else I guess return a MeshesContainer
as a Meshes
meshed_region = mesh._meshed_region | ||
else: | ||
meshed_region = dataframe._fc[0].meshed_region | ||
field = dataframe._fc[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.
why the first field? what if you have a single time, but different label (like "elshape") in your data frame?
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.
@cbellot000 talked it out and it seems the only use-case is merging the fields labeled by zone, as well as selecting a set.
I updated the PR accordingly.
@rafacanton @cbellot000 @anslpa Just realized we cannot actually create a
I think the first solution is the best. What do you think? |
@PProfizi I agree, I think it is right to have both libraries with a similar structure. Thanks! |
…etro-compatibility while preparing deprecation.
…ect set in transient dataframe.
What I ended-up doing:
|
@@ -0,0 +1,6 @@ | |||
"""Tools package. | |||
|
|||
Tools |
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.
Helpers?
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.
The only problem I see is naming. For me "helpers" means wrapping already existing capabilities in another way to make them easier to be used
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.
Is there a plan for follow up PR adding an example for streamlines?
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.
The only problem I see is naming. For me "helpers" means wrapping already existing capabilities in another way to make them easier to be used
IMO this is what this method is? The end-goal is to have a much more thorough streamlines manipulation capability, this method being a quick way to plot the streamlines given a Dataframe.
Is there a plan for follow up PR adding an example for streamlines?
Yes of course, I initially wanted this merged before last Friday's deadline, but if the deadline is not an issue anymore, I can add an example within this PR.
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.
The only problem I see is naming. For me "helpers" means wrapping already existing capabilities in another way to make them easier to be used
@cbellot000 What I can do though is rename helpers
as tools
, but that will require deleting the tools.py
module, which I think can be done without retro-compatibility issues if I import the select
method from within the __init__.py
file of the new tools
sub-package, yet I may have missed a case where it breaks.
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.
@PProfizi no, it's okay, your justification makes sense
@@ -0,0 +1,6 @@ | |||
"""Tools package. | |||
|
|||
Tools |
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.
@PProfizi no, it's okay, your justification makes sense
Create the
ansys.dpf.post.tools
package, with theansys.dpf.post.tools.streamlines
module.Add the
plot_streamlines
helper to provide a first way of plotting streamlines based on a DataFrame.Add a first test in
test_streamlines.py
.Initial mock-up: