In #99 I wanted to expose the minimum available API to write to file with Python3.
Though, I noticed that the Add method of XCDFField allowed only to add a single value at the time, so in Python one would have to perform for cycles for each array to write, e.g. what is currently in the writing example of the Python tutorial,
for i in np.arange(0, 1, 0.25):
field_B.add(i)
which obviously not scalable.
Implementation
I added an overloaded method of XCDFField::Add which instead of eating a single value eats a std::vector and inside it just loops over it calling XCDFFieldData::Add on each value.
I added a dedicated unit test and updated the documentation accordingly.
Context
In #99 I wanted to expose the minimum available API to write to file with Python3.
Though, I noticed that the Add method of XCDFField allowed only to add a single value at the time, so in Python one would have to perform for cycles for each array to write, e.g. what is currently in the writing example of the Python tutorial,
which obviously not scalable.
Implementation
I added an overloaded method of
XCDFField::Add
which instead of eating a single value eats astd::vector
and inside it just loops over it callingXCDFFieldData::Add
on each value.I added a dedicated unit test and updated the documentation accordingly.
With this we can do, e.g.