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

tests: add test cases for mcarray/mesh verify functions #72

Merged
merged 21 commits into from
Oct 24, 2016

Conversation

xjrc
Copy link
Member

@xjrc xjrc commented Oct 13, 2016

The changes in this pull request will add test cases to verify the correctness of the conduit::blueprint::mcarray::verify and conduit::blueprint::mesh::verify functions in simple cases not covered by the existing example tests (see #55 for more information).

@xjrc xjrc added the wip label Oct 13, 2016
@xjrc xjrc added this to the 0.2.0 milestone Oct 13, 2016
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 76.821% when pulling 9fd601d on xjrc:tests/blueprint_mesh_mcarray_verify into 82085ad on LLNL:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.0%) to 77.77% when pulling 5858601 on xjrc:tests/blueprint_mesh_mcarray_verify into 82085ad on LLNL:master.

@cyrush
Copy link
Member

cyrush commented Oct 14, 2016

@xjrc looking good! chipping away at the coverage

const std::vector<std::string> CARTESIAN_BASIS = create_basis("x","y","z");
const std::vector<std::string> SPHERICAL_BASIS = create_basis("r","theta","phi");
const std::vector<std::string> CYLINDRICAL_BASIS = create_basis("r","z");

Copy link
Member

Choose a reason for hiding this comment

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

I know this is only for tests, but we actually use basis as one of the entires for the field protocol, so seeing it here though me off a bit

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I didn't notice that conflict! I'll try to think of an alternative name for these collections (space or coordinate system maybe) and update the tests accordingly.

Copy link
Member

@cyrush cyrush Oct 15, 2016

Choose a reason for hiding this comment

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

I think coordinate system is good (the tuples in a coord set are associated with a well known coord system)

info["dims"]))

if(!mesh::coordset::uniform::origin::verify(coordset["origin"],
info["origin"]))
{
Copy link
Member

Choose a reason for hiding this comment

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

thanks for finding this bug!

@coveralls
Copy link

Coverage Status

Coverage increased (+1.4%) to 78.169% when pulling e81c612 on xjrc:tests/blueprint_mesh_mcarray_verify into 82085ad on LLNL:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.6%) to 78.435% when pulling 6f3e2c1 on xjrc:tests/blueprint_mesh_mcarray_verify into 82085ad on LLNL:master.

…verify".

Moved some of the mcarray verification tests from the example test case to the verify test case.
Added a stub for the "conduit::blueprint::mesh::verify" test cases.
Fixed a couple of minor bugs in the "blueprint::mesh::coordset::uniform" verify function.
… case.

Fixed a couple of bugs in the "blueprint::mesh::topology::unstructured" verify function.
@xjrc xjrc force-pushed the tests/blueprint_mesh_mcarray_verify branch from 75857b1 to a974f63 Compare October 17, 2016 21:36
@coveralls
Copy link

Coverage Status

Coverage increased (+2.0%) to 78.843% when pulling a974f63 on xjrc:tests/blueprint_mesh_mcarray_verify into 072f04b on LLNL:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.5%) to 79.396% when pulling 732b9ab on xjrc:tests/blueprint_mesh_mcarray_verify into 072f04b on LLNL:master.

Fixed a number of minor issues in the "blueprint::mesh::index::verify" function.
@coveralls
Copy link

Coverage Status

Coverage increased (+3.0%) to 79.839% when pulling 5059dbe on xjrc:tests/blueprint_mesh_mcarray_verify into 072f04b on LLNL:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+3.0%) to 79.839% when pulling 2c0216a on xjrc:tests/blueprint_mesh_mcarray_verify into 072f04b on LLNL:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+3.2%) to 80.027% when pulling 378cb3a on xjrc:tests/blueprint_mesh_mcarray_verify into 072f04b on LLNL:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+3.3%) to 80.137% when pulling 5f182af on xjrc:tests/blueprint_mesh_mcarray_verify into 072f04b on LLNL:master.

Fixed a few problems with field verifying in "blueprint::mesh::verify".
@coveralls
Copy link

Coverage Status

Coverage increased (+3.9%) to 80.802% when pulling b2e305b on xjrc:tests/blueprint_mesh_mcarray_verify into 072f04b on LLNL:master.

@xjrc xjrc added task and removed wip labels Oct 21, 2016
@xjrc
Copy link
Member Author

xjrc commented Oct 21, 2016

@cyrush: I believe that this pull request is ready to be merged, but please let me know if you see any problems with the existing test cases and I'll try to revise them as soon as I can. Thanks!

@cyrush
Copy link
Member

cyrush commented Oct 21, 2016

awesome, thanks os much -- I'll take a look soon!

Copy link
Member

@cyrush cyrush left a comment

Choose a reason for hiding this comment

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

Looks good -- a few comments, but I think we are ready to merge


// FIXME: Remove the comments from the following line once the verify functions
// for uniform and rectilinear topologies have been implemented.
const std::string topology_types[] = {/*"uniform", "rectilinear", */"structured"};
Copy link
Member

Choose a reason for hiding this comment

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

are these functions there, but basically no-ops? If so, can we still wire them up to be called?

Copy link
Member Author

Choose a reason for hiding this comment

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

These functions do exist and are currently implement as no-ops, but wiring them up here wouldn't be too helpful. The purpose of this part of the test case is to verify that a valid "explicit" topology isn't accepted as any other form of topology when fed through the blueprint::mesh::topology::verify function (essentially just ensuring that the if clauses in this function point to the correct subroutines). Since the "uniform" and "rectilinear" topology tests are no-ops that return true, calling them here would cause this test to fail (this is actually good because this indicates that these verify functions aren't returning values we'd expect). Ultimately, I think that it's best to keep this commented out for now, especially considering that we already have no-op coverage for the "uniform" and "rectilinear" cases in the "topology_uniform" and "topology_rectilinear" test cases above.

Copy link
Member

Choose a reason for hiding this comment

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

got it, thanks!

{
// FIXME: Does this have to be verified against anything else? What does
// this basis refer to if it isn't a different path in the mesh structure?
Node n, info;
Copy link
Member

Choose a reason for hiding this comment

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

the basis is an mfem style string for the finite element collection.
I haven't really though about how to verify it, its possible we could enumerate everything mfem supports even without directly using mfem

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the clarification on this. I guess it isn't too important that we verify it for now, but I think that keeping the 'fixme' here will be helpful to remind us to expand on this test if/when we decide to expand the blueprint::mesh::field::basis::verify function.

Copy link
Member

Choose a reason for hiding this comment

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

agreed.

// FIXME: The coordinate system checking functions shouldn't accept
// systems such as (y) or (x, z); all successive dimensions should
// require the existence of previous coordsys dimensions.
/*
Copy link
Member

Choose a reason for hiding this comment

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

we can leave this in commented out -- but I not sure what we want to support.
I can imagine a (complex) case with two 2d meshes that use different major axes, and wanting to plot those both in 3D given some input from a user on how to anchor the unspecified coordinate for each.

Copy link
Member Author

Choose a reason for hiding this comment

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

That makes sense to me! I'll just leave this code in until we make a final decision on whether or not these types of coordinate spaces will be supported.

@cyrush
Copy link
Member

cyrush commented Oct 24, 2016

this all looks good! Thanks so much for getting this in.

For some reason the appveyor (windows) checks didn't run -- I'll resolve anything after I merge.

In the future, feel free to create a branch off of the main repo instead of forking. It will make it easier for use to work closer together and make sure all the CI stuff works.

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

Successfully merging this pull request may close these issues.

3 participants