Conversation
|
Please also add tests :) |
cc4495b to
b59f84f
Compare
37157c4 to
6cf9888
Compare
c117b6c to
7c84fa6
Compare
|
The datatype tests apparently fail for the HDF5 backend. I don't think this is a bug with the current PR. |
4b6ff6e to
67df907
Compare
|
CMake backport issue in Spack is going to be fixed in spack/spack#12241 Maybe check already to Windows builds, they seem actually broken. |
|
@franzpoeschel ping: please rebase |
67df907 to
5e84e9d
Compare
68444d1 to
ed938a0
Compare
b43a6fb to
0a6377f
Compare
|
It seems there is an issue in the ADIOS1 backend, the recent commit has made the checks pass. Leaving this line inside ms["double"][SCALAR].make_empty(np.dtype("double"), 21)will create datasets that cannot even be processed by EDIT: It seems that the reason for this behavior is the fact that ADIOS is apparently case insensitive, choosing another name for the field will apparently work. I will push a commit in a minute. |
6d75f3e to
9ae2120
Compare
|
Huh, I wasn't aware of that :-o |
include/openPMD/RecordComponent.hpp
Outdated
| * @param dimensions | ||
| * @return RecordComponent& | ||
| */ | ||
| RecordComponent& makeEmpty( Datatype, uint8_t dimensions ); |
There was a problem hiding this comment.
Just an ascetic question: would it be better to have the Datatype last?
Also: doxygen does not describe both parameters (second name is missing, dt?)
There was a problem hiding this comment.
I am used to putting that parameter first since that's how switchType does it, so I did that without a lot of thinking. You mean because it would align better with the templated makeEmpty? I actually like the order that it has now, since you first specify the datatype (as template or as normal parameter), thus also specifying whether you use the templated makeEmpty or the non-template, and next you specify the dimensions.
rc.makeEmpty< float >( 3u );
rc.makeEmpty( Datatype::FLOAT, 3u);Think that's pretty straightforward this way around?
I've completed the doxygen description.
9ae2120 to
31ea01e
Compare
|
@franzpoeschel I fixed the one test that ran into timeouts with #558. |
31ea01e to
b516c9d
Compare
|
@franzpoeschel pls rebase me one more time :) |
b516c9d to
81916d8
Compare
d090e50 to
9403705
Compare
include/openPMD/RecordComponent.hpp
Outdated
| * | ||
| * @param dt The datatype of which to create an empty dataset. | ||
| * @param dimensions The dimensionality of the dataset. | ||
| * @return RecordComponent& |
There was a problem hiding this comment.
| * @return RecordComponent& | |
| * @return A reference to this RecordComponent. |
There was a problem hiding this comment.
Orthogonal question for a follow-up PR about the return type:
with handles implemented, could we make the code usage safer by returning in all those places just a RecordComponent instead of a RecordComponent&? What do you think?
There was a problem hiding this comment.
The intent of returning this at all is chaining methods, right? So, things such as recordComponent.makeEmpty(3).setUnitSI(3.0).
By forcing a copy there, we would also needlessly force copying the contained shared_ptrs, which we already do somewhat excessively at times, so I'm not really convinced.
I'm in general not a huge fan of how C++ does references and the problems in returning references is one of the major reasons (especially implicit copying upon auto x = <reference>), but do you see a safety issue in our case?
There was a problem hiding this comment.
Yes, the idea is to chain methods.
I think copying a shared_ptr is okay if it prevents that a user can create a dangling reference (to RecordComponent). It makes the API safer and keeps the syntactic sugar of chaining.
9403705 to
26a0255
Compare
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
26a0255 to
51d7e57
Compare
|
I think this one is finished @ax3l ;) |
ax3l
left a comment
There was a problem hiding this comment.
Thank you, this looks great! 🚀 ✨
See this PR, this adds bindings for Python accordingly.