gonum / gonum/hdf5

hdf5: start handleing references

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
135
Forks
34
PR merge metrics
No merged PRs in 30d

Description

In earlier discussions, such as https://github.com/gonum/hdf5/pull/15, we talked about about working with an "HDF5 DataType that describes a pointer to x". As it is right now, whenever we are receiving a pointer, we are dereferencing it and are working with the underlying value.

The code that was at the center of the discussion was:

when creating a `DataType`
```go
case reflect.Ptr:
return NewDataTypeFromType(t.Elem())
```

and when performing encoding in our `cmem` package:
```go
case reflect.Ptr:
return enc.Encode(rv.Elem())
```

Looking at the [HDF5 Documentation](https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_6_2_Referencebc-17&rhtocid=6.4.0_2) describing that topic, one notices that this is a bit more complex than we thought in our discussions. The guys there have a separate interface for handling the issue: [Reference Interface](https://support.hdfgroup.org/HDF5/doc/RM/RM_H5R.html).

Therefore, if we want to support those referencing types, we would need to create a wrapper for the named interface.

What still would not be resolved by adding the interface, is the issue of what happens if someone would try to e.g. append a pointer to a Go value without going through such an interface. Would we error? Or would we keep the status quo?

Contributor guide

No contributing guide indexed for this repository

Research direction

No file or test is named. Start at NewDataTypeFromType and the reflect.Ptr handling in the cmem encoding package, then review the linked HDF5 Reference Interface documentation and discussion. Done requires an agreed API for references and a decided behavior for pointers passed without that interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.