G-Node / nix

Neuroscience information exchange format
https://readthedocs.org/projects/nixio/
Other
67 stars 36 forks source link

Create dimensions during DataArray creation #517

Open stoewer opened 9 years ago

stoewer commented 9 years ago

Pass information about dimensions to DataArray's create method. The goal is to have a similar behavior as in the prototype:

DataArray da = block.createDataArray("da", "signal", nix::DataType::Double, {D("ms", "Time", 0.1)})

Further all methods to set or append dimensions should be removed and it should not be possible to change the unit of existing dimensions (or at least not to an incompatible unit).

This is a major API change and has a huge impact on the bindings and the documentation of the c++ API and the bindings.

gicmo commented 9 years ago

This is related to issue #519.

matham commented 7 years ago

I think I kinda agree with this. It makes sense to me that dimensions should be automatically created when the data is created and should not be done with appends after; it's a bit unintuitive currently. However, I do think it may make sense to allow the changing of dimension type afterwards. Perhaps at creation it should create a default dimension for every dimension (if not specified explicitly), but allow replacing the type later.

achilleas-k commented 7 years ago

I think I like the idea of creating default dimensions too. We could automatically create SetDimensions signifying that by default, data in DataArrays are simply just a collection of values, until the dimensionality is specified.