-
Notifications
You must be signed in to change notification settings - Fork 9
Split mesh creation function #329
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
base: main
Are you sure you want to change the base?
Split mesh creation function #329
Conversation
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.
@gnath-aswin thanks for your first contribution!
This PR is already looking really good. I have a few points for discussion:
-
I think we can remove the deprecation stage and just switch to the new layout. MeshPy only has a very small number of active users/developers and, therefore, we can simply switch.
-
Should we directly update the docstrings in the touched files to align with our new style?
-
Should we directly split up the tests to reflect the src code files?
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.
Thanks for the contribution @gnath-aswin ! I left some comments to apply / discuss.
I agree with the points of @davidrudlstorfer (splitting test files, adapting the doc string style), but I would do that in separate PRs.
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.
I really like this approach of deprecating old functionality, but I agree with @davidrudlstorfer that this might be an overkill in this case. I would just remove this file.
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.
@gnath-aswin general note: In GitHub we use threads like this to discuss pats of the code. When the initial issue is solved / an agreement is reached, you can close this conversation (with the button Resolve conversation
). This allows to easily keep track which discussions are still open. Also, all discussions need to be resolved so that we can merge. If you are not sure if the discussion can be resolved just ask the people who opened it.
For example this discussion can be resolved, since it was about the deprecation file - we agreed to remove it, and you did, so we are done here!
from meshpy.mesh_creation_functions.beam_generic import create_beam_mesh_function | ||
from meshpy.mesh_creation_functions.beam_parametric_curve import create_beam_mesh_curve |
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.
Not related to this file, but I would rename these two functions like:
create_beam_mesh_function
->create_beam_mesh_generic
create_beam_mesh_curve
->create_beam_mesh_parametric_curve
) | ||
|
||
|
||
def create_beam_mesh_line_at_node( |
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.
With this (and create_beam_mesh_arc_at_node
) I am a little bit torn, I think I would prefer to have them in a single file beam_node_continuation.py
, since they are usually always used together. Is there a specific reason you put them in the respective line and arc files?
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.
My initial thought was to group them with their respective geometry types (line or arc). I agree that on usage perspective, it would actually make more sense to have both in beam_node_continuation.py
.
General question (@davidrudlstorfer @knarfnitram), since this would be a good point to do so, are we happy with the naming: create_beam_mesh_xxx(...) The initial thought behind this was that this naming should indicate that a beam related mesh is created and not a geometry, i.e., that the discretisation is performed within these functions. They names can become lengthy, but I actually don't mind that and think that for such relevant functions a descriptive name is important - but I am happy to hear your thoughts. |
Thanks for your review @isteinbrecher. In my opinion we could drop the |
One the one hand |
Thanks for the feedback @davidrudlstorfer @isteinbrecher @knarfnitram . Below is a summary of the updates I will include in this PR, along with suggestions for tasks that can be handled in a separate PR. Changes to be made in this PR
Suggested tasks for a follow-up PR
Naming Convention DiscussionSince there's no strong consensus to change it right now, My suggestion would be we keep the current naming pattern for now ( Let me know if you have any more suggestions. |
Includes stent structures, wire meshes, honeycomb patterns, and fiber | ||
distributions. |
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.
Let's remove this part of the comment as it does not really give any useful information and is prone to be outdated soon.
@gnath-aswin thanks for posting the changes to this PR. There is no exact rule on how to go about this, but small points like the one in this PR are fine if you just resolve within the discussions, this allows to better structure the PR. As always it depends on the actual case and there are no strict rules. I like your proposed approach, feel free to add the changes and push to this branch. One additional note: We don't have a rule on how commit messages should look like in MeshPy, but they should be somewhat meaningful. In your example you have two commits, both with the message I know this is a lot to handle at the beginning, but trust me you will get used to this very quickly! |
@gnath-aswin is there any update on this PR? |
changes have been made to the branch, please review @isteinbrecher |
@gnath-aswin thanks for the changes. There is a merge conflict with the current main branch. This has to be resolved before this can be merged. This can either be done by merging main into your branch, or by rebasing your branch on the current main. In this case I would prefer a rebase - if you do this in VisualStudioCode then it should be hopefully straight forward. You can have a look at this tutorial (https://medium.com/@slamflipstrom/a-beginners-guide-to-squashing-commits-with-git-rebase-8185cf6e62ec) and we can discuss if there are any questions. |
cc81340
to
a178f3d
Compare
a178f3d
to
81aff45
Compare
Organize
src/meshpy/mesh_creation_functions
FolderThis PR addresses issue #319 of organizing the
src/meshpy/mesh_creation_functions
folder.Changes Made
Moved all application-style beam mesh modules to
mesh_creation_functions/applications
:beam_stent.py
beam_honeycomb.py
beam_fibers_in_rectangle.py
beam_wire.py
Split basic functionalities from
beam_basic_geometry.py
into new modules:beam_line.py
:Contains
create_beam_mesh_line
andcreate_beam_mesh_line_continuation
beam_arc.py
:Contains
create_beam_mesh_arc_segment_via_rotation
,create_beam_mesh_arc_segment_via_axis
,create_beam_mesh_arc_segment_2d
, andcreate_beam_mesh_arc_at_node
beam_helix.py
: containscreate_beam_mesh_helix
Left
beam_basic_geometry.py
with a deprecation warning:Renamed modules for clarity:
beam_curve.py
→beam_parametric_curve.py
beam_nurbs.py
→beam_from_nurbs_curve.py