-
Notifications
You must be signed in to change notification settings - Fork 14
WIP: 109 layer descriptor shape parameters #110
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
base: master
Are you sure you want to change the base?
Conversation
In order to allow for layers that have different dimensions from the main grid (specifically the VRRefinements and VRNode layers), added support for dimensions in the LayerDescriptor class, and propagated support to the derived classes.
VR data in field BAG files appears to contain 2D arrays rather than the 1D version that they should; modified code to follow this model, rather than the standard so that source data can be read. Replaced deprecated sprintf() with snprintf().
WIP debugging to confirm location of memory leak causing heap-bombs elsewhere (commit purely to allow publication and other support activities).
| std::tie(numRows, numColumns) = pDataset->getDescriptor().getDims(); | ||
| std::tie(numRows, numColumns) = m_pLayerDescriptor->getDims(); | ||
|
|
||
| if (columnEnd >= numColumns || rowEnd >= numRows) |
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.
@brian-r-calder This branch is being taken when running test_bag_vrmetadata.cpp, specifically when the test attempts to read back the VR metadata. Is the test wrong, or is there a mistake in Layer::read()?
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 don't see a branch here, but the code is correct --- we have to read the dimensions specifically from the layer rather than from the dataset, since we need to allow each layer to have its own dimensions.
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.
What I meant was if (columnEnd >= numColumns || rowEnd >= numRows) evaluates to true when Layer::read() is called from test_bag_vrmetadata.cpp:452. Is the VR layer being created by the test incorrect?
When reporting exceptions for VR refinements not having the right number of dimensions, we have both 1D and 2D arrays that have to be handled (the 2D simply because we're patching around a bug in BAG creation in other software that doesn't use this code that's not following the specification correctly). The reporting of InvalidVRRefinementDimensions therefore has to be neutral on number of dimensions and report that the number is inconsistent.
… in addition to XML file on filesystem, to provide diagnostic info when tests crash
… common usage that is counter to the BAG spec (i.e. 1D)
…to read-back dta after it was written to disk in accordance with other tests (such as 'test vr metadata create open' in the same test file)
…C++ header file public interfaces
…than uint32_t like elsewhere in the API) because dimensions are initialized from HDF5 hsize_t values, which are uint64_t.
…ying uint64_t to maintain compatibility with the rest of the BAG API, which assumes rows and cols are uint32_t.
…s other implementations do) rather than 1D (as called for in BAG spec)
…ntations do) rather than 1D (as called for in BAG spec)
…ption handling for HDF5 call in Dataset::readDataset()
|
@selimnairb Make sure this PR addresses #115. |
…ing varres_refinrements dataspace shape.
|
This PR should be merged after #143 |
varres_refinements were created in BAG 1.6.3 using the following code:HD5 type creationbag_opt_group.c::bagCreateVarResRefinementGroup(): 101-120:bagError bagCreateVarResRefinementGroup(bagHandle hnd, bagData *data, u32 const n_cells)
{
bagError err;
herr_t herr;
if ((data->opt[VarRes_Refinement_Group].datatype = H5Tcreate(H5T_COMPOUND, sizeof(bagVarResRefinementGroup))) < 0) {
return BAG_HDF_TYPE_CREATE_FAILURE;
}
herr = H5Tinsert(data->opt[VarRes_Refinement_Group].datatype, "depth", HOFFSET(bagVarResRefinementGroup, depth), H5T_NATIVE_FLOAT);
if (herr < 0) return BAG_HDF_TYPE_CREATE_FAILURE;
herr = H5Tinsert(data->opt[VarRes_Refinement_Group].datatype, "depth_uncrt", HOFFSET(bagVarResRefinementGroup, depth_uncrt), H5T_NATIVE_FLOAT);
if (herr < 0) return BAG_HDF_TYPE_CREATE_FAILURE;
data->opt[VarRes_Refinement_Group].nrows = 1;
data->opt[VarRes_Refinement_Group].ncols = n_cells;
err = bagCreateOptionalDataset(hnd, data, VarRes_Refinement_Group);
return err;
}
HD5 group creationbag_opt_surfaces.c::bagCreateOptionalDataset():352-355:if ((dataset_id = H5Dcreate(file_id, VARRES_REFINEMENT_GROUP_PATH, datatype_id, dataspace_id, plist_id)) < 0) {
status = H5Fclose(file_id);
return BAG_HDF_CREATE_GROUP_FAILURE;
}The dataspace is defined at bag_opt_surfaces.c::bagCreateOptionalDataset():190-194:if ((dataspace_id = H5Screate_simple(RANK, dims, NULL)) < 0)
{
status = H5Fclose (file_id);
return (BAG_HDF_CREATE_DATASPACE_FAILURE);
}
|
…r-shape-parameters-update-testcases Update VR-related tests
Discussed with @anthonyklemm, will address #115 after #109 is merged. |
…me downloads server as GitLab's recently enabled anti-AI scraping countermeasures (Anubis) doesn't take kindly to Windows hosts headlessly downloading content
…le of one-shot tar.xz unarchiving
… update Python versions to correspond to those supported by Ubuntu 22.04 GH actions runner
…sn't work and seemingly isn't necessary.
…g the new, correct, behavior to be executed
Issue #109: layers do not currently have separate shape parameters (except Geometadata layer), but should in order for VR refinements to work appropriately. This pull request adds this functionality, and also bug-fixes a number of issues in the VR implementation, and other deprecation issues (e.g., snprintf() rather than sprintf()).