Skip to content

Conversation

@pshriwise
Copy link
Member

Applying the changes from the professional code review (#660) to the make_watertight related files. The changes are as follows:

  • remove commented code blocks that are either outdated or are debug statements
  • improvements to some logic for clarity
  • use of standard library containers to avoid potential memory leaks in Arc.cpp/Gen.cpp
  • improvements to struct/variable names
  • declared variables for "magic numbers"
  • passing by const reference where possible to avoid unnecessary memory allocation
  • removed an unused function (Arc::create_loops_from_oriented_edges_fast)

I'm not going to link each comment from the original PR here due to the sheer number of them, but I'm happy to answer any questions about the changes and hunt them down for reference as needed.

@@ -1,4 +1,3 @@
message("")
Copy link
Member

Choose a reason for hiding this comment

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

Apologies in advance for commenting on such a small change.

The purpose of these lines is to break up the CMake output to make it easier to see what CMake output is coming from where. This message("") line appears in CMakeLists.txt files throughout the entire repo. If we don't want these lines anymore, then we should delete them from all the CMake files, not just this one. (I would argue we shouldn't delete them.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, makes sense. Though I think there's something to their comment that it would be even better if these each contained a message indicating their respective directories.
https://github.com/svalinn/DAGMC/pull/660/files#r368664884

All the same, reverting this change now.

Copy link
Contributor

@kkiesling kkiesling left a comment

Choose a reason for hiding this comment

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

Nice work! Just a few questions:

There are a lot of assert(moab::MB_SUCCESS == result) lines throughout (not necessarily ones that you've added). We discussed that result/rval should always be checked, but maybe there needs to be more than just an assertion. If the result is not a success, what error message shows up and is it helpful to users at all? Some places are good about having messages, while others still don't.

curve_i_verts, curve_j_verts);
if (moab::MB_SUCCESS != result)
std::cout << result << std::endl;
std::cout << "Failed to merge vertices with error: " << result << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be std::cerr?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mmm yeah probably. Updating now.

@pshriwise
Copy link
Member Author

I had the same thought looking through this and it's been an issue in the make_watertight files for a while now, but I felt that that would be better off in a separate PR dedicated solely for that update. for now, I've created issue #669 for this so we don't forget.

Copy link
Contributor

@kkiesling kkiesling left a comment

Choose a reason for hiding this comment

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

This PR looks good to me now. Thanks @pshriwise!

@pshriwise
Copy link
Member Author

Any further comments or thoughts here @ljacobson64 @kkiesling?

@kkiesling
Copy link
Contributor

Any further comments or thoughts here @ljacobson64 @kkiesling?

None from me. I approved the other day.

Copy link
Member

@bam241 bam241 left a comment

Choose a reason for hiding this comment

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

Thx @pshriwise !
Looking good.

I only have few minor comments.

Copy link
Member

@bam241 bam241 left a comment

Choose a reason for hiding this comment

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

I missed those 2 :)

Copy link
Member

@bam241 bam241 left a comment

Choose a reason for hiding this comment

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

Looking good thx @pshriwise !

@gonuke
Copy link
Member

gonuke commented Apr 8, 2020

Thanks @pshriwise

@gonuke gonuke merged commit c621bb8 into svalinn:develop Apr 8, 2020
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.

5 participants