Skip to content
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

Make ordering conventions explicit #13

Closed
wants to merge 4 commits into from

Conversation

serenity4
Copy link
Member

@serenity4 serenity4 commented Nov 9, 2020

This PR implements ordering conventions, that solves #11.
The old Face type is still there, but not used anymore, so it can be safely deleted (in this PR or another).
As discussed in #12, equality of polytopes imply equality of all k-faces. Therefore, I modified equality tests between polytopes so that only vertices are tested for equality. It only affects tests for UnstructuredMeshes. The tested behavior is exactly the same as before this PR.

@juliohm
Copy link
Member

juliohm commented Nov 9, 2020

Awesome, that looks really nice 💯 I will try to test locally today, meanwhile could you please rename the folder common_polytopes to simply polytopes?

Thanks for the awesome improvements.

Copy link
Member

@juliohm juliohm left a comment

Choose a reason for hiding this comment

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

Hi @serenity4 , this PR isn't very easy to review. It is doing multiple things at the same time, and this is hard to keep track in the future. Could you maybe undo the deletion of the Face type, and just handle the ordering convention concept here? There is a lot of file movement to different folders, and a lot of s/Face/Polytope/ that is not related to ordering conventions.

We need a separate PR later to consider the removal of Face.


## Example
```
Δ = connect((1,2,3), Triangle)
```
"""
connect(list::NTuple{N,Int}, F::Type{<:Face}) where {N} = Connectivity{F,N}(list)
connect(list::NTuple{N,Int}, F::Type{<:Polytope}) where {N} = Connectivity{F,N}(list)
Copy link
Member

Choose a reason for hiding this comment

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

Although I like all your suggestions so far, it would be nice if you could draft PRs more carefully. I am spotting a lot occurrences of incomplete changes like this where you chage Face to Polytope and forget to update the type parameter from F to P.

@@ -84,6 +84,10 @@ export
Connectivity,
facetype, connect, materialize,

# ordering conventions
Ordering, connectivity,
Copy link
Member

Choose a reason for hiding this comment

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

You are exchanging two terms in this PR: ordering and convention. Can we agree on a single term "OrderingConvention" and use it consistently in the PR?

"""
Connectivity function provided by an `Ordering` subtype used to construct k-faces of a polytope from vertices (0-faces).
"""
function connectivity end
Copy link
Member

Choose a reason for hiding this comment

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

Please configure your IDE to not remove the last EOL. VS Code does that by default unfortunately.


connectivity(::Type{<:Tetrahedron{GMSH}}, ::Type{GMSH}, ::Val{2}) =
connect.([(1,2,3),(1,4,3),(1,4,2),(2,3,4)], Triangle)

Copy link
Member

Choose a reason for hiding this comment

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

Sometimes you add 2 blank lines, sometimes you add 1 blank line between function definitions. I know this may sound picky, but it is important in the long run to be pedantic about these things.

@juliohm
Copy link
Member

juliohm commented Nov 10, 2020

In summary, it would be nice if you could

  1. Draft a new PR proposing the removal of the Face type.
  2. After (1) is merged into master, update this PR to discuss the ordering conventions.

@juliohm
Copy link
Member

juliohm commented Nov 10, 2020

I've addressed item (1) in #14. Requesting your review over there 👍

@serenity4
Copy link
Member Author

Appreciate the feedback. Tbh I am not used to be as clear when making commits/PRs, particularly for having a good history, but that's better practice indeed. I'll try to be as careful as I can for future PRs. Don't hesitate to continue such feedback when needed.

@juliohm
Copy link
Member

juliohm commented Nov 10, 2020

Now that #14 has been merged, we can either refactor this PR or start a clean one from a new branch out of master. It would be nice to generalize the ordering convention as you proposed here. Please let me know how you prefer to proceed.

@serenity4
Copy link
Member Author

I think I'll just restart anew, it will be easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants