-
Notifications
You must be signed in to change notification settings - Fork 28
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
Feature/sina/hdf5 output support #1480
Conversation
src/axom/sina/core/Document.cpp
Outdated
message << "The '" << RELATIONSHIPS_KEY | ||
<< "' element of a document must be an array"; | ||
throw std::invalid_argument(message.str()); | ||
conduit::Node relationship_nodes = asNode[RELATIONSHIPS_KEY]; |
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.
this should be a ref to avoid a copy
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.
Removed as many copies as I could, this one underwent additional changes
src/axom/sina/core/Document.cpp
Outdated
conduit::Node modifiedRelationshipsNode; | ||
|
||
removeSlashes(relationshipNode, modifiedRelationshipsNode); | ||
relationshipsNode.append() = modifiedRelationshipsNode; |
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.
you could pass ref to append result into removeSlashes to avoid one extra copy.
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.
Copy removed
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.
are the changes pushed? I see:
removeSlashes(relationshipNode, modifiedRelationshipsNode);
relationshipsNode.append() = modifiedRelationshipsNode;
however, I expect something like:
removeSlashes(relationshipNode, relationshipsNode.append());
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.
src/spack
Outdated
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.
was this sub module add intended?
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.
Submodule removed
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.
Looks like the PR is trying to make unintended changes to submodules (blt, data, radiuss-spack-configs)
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.
Submodule changes came from develop merges, double checked for intentionality
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.
Left some suggestions for you. Also wondering if the fortran changes are tested?
@gwaegner please take a look at the failures |
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.
The updated ReadTheDocs documentation for this PR can be previewed here: https://axom.readthedocs.io/en/feature-sina-hdf5_output_support/axom/sina/docs/sphinx/index.html
src/axom/sina/core/Document.cpp
Outdated
conduit::Node &newChild = restoredNode.add_child(restoredKey); | ||
|
||
// Leaves empty keys empty but continues recursive call if its a list | ||
if(it.node().dtype().is_string() || it.node().dtype().is_number() || |
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.
This could be more readable and possibly more efficent if you stored the type then checked instead of calling the same function again and again.
Something like:
auto dtype = it.node().dtype();
if (dtype.is_string() || dtype.is_number() || dtype.is_object())
{
newChild.set(it.node());
}
else if(dtype.is_list())
{
restoreSlashes(it.node(), newChild); // Handle nested lists
}
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.
it.node().dtype() stored as an auto data_type that is now referenced instead of additional calls.
src/axom/sina/core/Document.cpp
Outdated
} | ||
|
||
} // namespace sina | ||
} // namespace axom | ||
} // namespace axom |
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.
} // namespace axom | |
} // namespace axom | |
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.
Implemented.
|
||
In addition to assembling ``Document`` instances from existing JSON files, it | ||
is possible to generate ``Document`` objects from existing HDF5 files using | ||
conduit. |
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.
conduit. | |
Conduit. |
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.
Fixed.
@@ -0,0 +1,55 @@ | |||
.. ## Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and |
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.
As far as I can tell this is not showing up in the Sphinx documentation. Also the "Records" page is a bad link.
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.
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.
It is probably because of line 6 needing to be unique and also it needs to be added to the toctree
probably here:
records |
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.
HDF5_vs_JSON nested in the Documents page as a new toctree, broken links on the Documents page are fixed.
Once you have a document, it is easy to save it to a file. To save to a JSON, we | ||
run the saveDocument() with the optional argument Protocol set to JSON or set as | ||
nothing. Alternatively if you wish to save the document to an HDF5 file: Configure | ||
axom for HDF5 support then you can set saveDocument()'s optional Protocol parameter |
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.
There is a lot of code in these paragraphs that is not formatted. A lot of it is pre-existing but should be fixed at some point. I would be fine if it happened after this PR.
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 can look into adjusting this one for my Append MR, it will just need this one merged first.
Some minor changes on my end then it is fine to be merged. The reason for wanting a newline at the end of a file is because it can lead to obscure issues that are very hard to track down. |
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.
Fix docs and minor tweaks
…into sina_hdf5_implementation
/style |
Summary