Closed donkahlero closed 6 years ago
Thanks :) I'll have a look at it on Monday (when I come back from holidays)
Yes, take your time :) I guess you will have numerous comments :sunglasses:
Hi @sbinet, yes you are right. It is not the most beautiful way of handling this. But for me it seems the best way of handling it ATM. Obviously, revising the code is always an option :)
Nevertheless, we are using the code quite successfully here for some huge datasets (appending 5MB+ a time at a high rate). And so far Append()
was stable. I hope this makes you a bit more comfortable to hear :)
yes, my comment (wrt a CMarshal
(?) method) was more a side comment rather than a road blocker.
Alright! But definitely something to keep in mind! :sunglasses: Other than that - improved the code based on your comments :)
Actually there is one thing @sbinet. It just came to my mind that I have no case for uint
and int
. Do you want me to add one that is then just a uint64
and int64
?
Any other changes that you want for this PR?
a Go int
has the size of int64
only on a 64b machine.
this would make the creation of an HDF5
file non portable...
I would err on the side of just returning an error.
(with a CMarshal
version we could actually create a []byte
with int64
data w/o fiddling w/ alignment+offset)
Okay. Then we can keep it for now? I guess so, but I would need to do that another time and PR :smiley:
LGTM but could you reword a bit the commit message so it reads something like:
hdf5: improve Table.Append bla-bla
bla-bla foo bar
qux and baz
Done, sir :)
thanks! let's wait a bit for @kortschak to chime in :)
Hi @kortschak!
Thanks for your nice comments! I think I have fixed all the issues that you have outlined.
A comment in regard to naked returns, etc pp.: maybe I could create a P/R in regard to a feasible linter setup, so the Travis check would actually fail if the code does not look a certain way? Of course we would need to agree on a proper set of linters + this would eventually lead to some fixing of the source (which should not be an issue after all).
If there's a linter for naked returns that might be worth running, but it's not a clear cut case of always avoiding them, so incorporating it in the build is probably more trouble than it's worth.
I think a linting setup in general would improve the code of the whole lib. Maybe just add golint
? It doesn't have to be gometalinter
with a full stack of linters :P
Haha, great that this fails - has nothing to do with the code, I guess?
I've restarted the failing test.
My experience with linting in builds has not been good. Vetting is OK (and now mandatory), but linting involves too much style.
Hi @sbinet,
added the nil for bot the ad.ptr and each string. I am actually not quite sure that this can happen, as the pointer that is passed to C.H5PTappend
(in case of appending a single string only) will point to an address that will then contain the address of the string to append.
To keep the fun alive :sunglasses:
This patch features an improvement of the HDF5 PacketTable Append method. This was necessary, because the old version did not support the append of struct containing nested structs and/or slices/arrays. To sum it up:
What needs to be improved?
I suggest that the above mentioned improvements are tackled in a separate patch.