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
I recently noticed that datatype() now works for all kinds of Julia structs! That’s such an awesome feature, allowing me to simplify my code a lot.
There is one remaining issue for me though. If you want to write a scalar dataset, this works fine with normal numbers and Complex
using HDF5
import ForwardDiff.Dual # just an example
f =h5open("test.h5", "w")
dual =Dual{:test}(1.0, 0.1)
# these all work
f["x1"] =1.0
f["x2"] =1im
f["x3"] = [dual]
f["x4"] = [complex(dual, dual)]
# these fail
f["x5"] = dual
f["x6"] =complex(dual, dual)
Yeah we don't support those as ScalarTypes. I'm not sure what would be the best approach here. Technically Dual is a struct and should be a CompoundData, but since it's <: Real we can't handle it.
Maybe a sensible default would be to consider structs scalar unless they are AbstractArrays (since if they are not, it is not clear how to get elements from them anyway).
Hi,
I recently noticed that
datatype()
now works for all kinds of Julia structs! That’s such an awesome feature, allowing me to simplify my code a lot.There is one remaining issue for me though. If you want to write a scalar dataset, this works fine with normal numbers and
Complex
However,
x5
andx6
fail with the errorThe text was updated successfully, but these errors were encountered: