You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like to have the possibility to choose between Array and Scalar value while adding an attribute.
I added a screenshot bellow to see the difference in the HDF viewer.
I already have an semi-implementation which allows this behavior.
I had troubles with 4 types: bool, char, decimal and string:
bool, char, decimal are not supported or does not work when setting the right H5T parameter , we decided to throw an exception that those types are not supported.
string: it is working with ASCII but I did not manage to get it to work with UTF8
We made breaking changes on the API inside the PR:
Before: WriteAttribute: it would take one argument and then set it into an array ReadAttribute: it would read an array and return the first element
In the PR: WriteAttribute: it would take one argument set the value as a Scalar value inside the HDF5 file ReadAttribute: it would read a Scalar value inside the HDF5 and return this value.
We also created 2 overload in this PR one generic and one for string but we will change it to have just one method which accept generic without constraint then.
Since these changes are quite big breaking changes on the API level, we could also create new methods for example:
(int success, long createdId) WriteScalarAttribute<T>(long groupId, string name, T value)
T ReadScalarAttribute<T>(long groupId, string name) or (bool success, T value) ReadScalarAttribute<T>(long groupId, string name)
I created a draft PR just that you can check the changes and what we have done. The goal is not to merge this PR since there is quite some re-work to do there (tests, code duplication, comments...).
It also contains the translation from the tree structure that we get the right attribute, array or scalar.
Here's is the link to the PR: #516
If you have any questions, concerned you can ping me or comment the PR ;)
Cheers !
The text was updated successfully, but these errors were encountered:
Hello,
We have a feature request :)
We would like to have the possibility to choose between Array and Scalar value while adding an attribute.
I added a screenshot bellow to see the difference in the HDF viewer.
I already have an semi-implementation which allows this behavior.
I had troubles with 4 types: bool, char, decimal and string:
We made breaking changes on the API inside the PR:
Before:
WriteAttribute
: it would take one argument and then set it into an arrayReadAttribute
: it would read an array and return the first elementIn the PR:
WriteAttribute
: it would take one argument set the value as a Scalar value inside the HDF5 fileReadAttribute
: it would read a Scalar value inside the HDF5 and return this value.We also created 2 overload in this PR one generic and one for string but we will change it to have just one method which accept generic without constraint then.
Since these changes are quite big breaking changes on the API level, we could also create new methods for example:
(int success, long createdId) WriteScalarAttribute<T>(long groupId, string name, T value)
T ReadScalarAttribute<T>(long groupId, string name)
or(bool success, T value) ReadScalarAttribute<T>(long groupId, string name)
I created a draft PR just that you can check the changes and what we have done. The goal is not to merge this PR since there is quite some re-work to do there (tests, code duplication, comments...).
It also contains the translation from the tree structure that we get the right attribute, array or scalar.
Here's is the link to the PR:
#516
If you have any questions, concerned you can ping me or comment the PR ;)
Cheers !
The text was updated successfully, but these errors were encountered: