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

Testing tuple_from_id #844

Merged
merged 7 commits into from
Dec 6, 2024
Merged

Testing tuple_from_id #844

merged 7 commits into from
Dec 6, 2024

Conversation

mtao
Copy link
Collaborator

@mtao mtao commented Dec 5, 2024

tuple_from_id is mostly handled by autogen but lacked testing - extracted the functions and added some unit tests

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 86.36364% with 9 lines in your changes missing coverage. Please review.

Project coverage is 77.17%. Comparing base (574cfec) to head (b1dc298).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...ogen/edge_mesh/get_tuple_from_simplex_local_id.hpp 63.63% 4 Missing ⚠️
...togen/tri_mesh/get_tuple_from_simplex_local_id.hpp 85.71% 3 Missing ⚠️
...togen/tet_mesh/get_tuple_from_simplex_local_id.hpp 92.85% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #844   +/-   ##
=======================================
  Coverage   77.17%   77.17%           
=======================================
  Files         476      479    +3     
  Lines       23658    23698   +40     
  Branches     2642     2641    -1     
=======================================
+ Hits        18259    18290   +31     
- Misses       5388     5397    +9     
  Partials       11       11           
Flag Coverage Δ
wildmeshing 77.17% <86.36%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@daniel-zint daniel-zint left a comment

Choose a reason for hiding this comment

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

A few comment on the global_id default value and the asserts are a bit inconsistent. Otherwise, lgtm.


namespace wmtk::autogen::edge_mesh {

inline Tuple get_tuple_from_simplex_local_vertex_id(int8_t local_id, int64_t global_id = 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it reasonable to have the global_id default to 0? I feel like having no default value makes more sense.

/*
namespace {
template <size_t Dim>
inline Tuple get_tuple_from_simplex_local_id_T(int8_t local_id, int64_t global_id = 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that commented out code still relevant? If not, it should be deleted.


inline Tuple get_tuple_from_simplex_local_vertex_id(int8_t local_id, int64_t global_id = 0)
{
const auto& arr = autogen::tet_mesh::auto_3d_table_complete_vertex[local_id];
Copy link
Contributor

Choose a reason for hiding this comment

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

An assert for local_id would be nice. You have it for the edge mesh.

assert(lvid == local_id);


if (lvid < 0 || leid < 0 || lfid < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that even possible? That sounds like something that should be checked for in a test and not in here.

@mtao mtao merged commit 22b78e8 into wildmeshing:main Dec 6, 2024
9 checks passed
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