File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ void RecordComponent::flush(
272272 {
273273 // The check for !written() is technically not needed, just
274274 // defensive programming against internal bugs that go on us.
275- if (!written () && rc.m_chunks .empty ())
275+ if (!written () && rc.m_chunks .empty () && !rc. m_isConstant )
276276 {
277277 // No data written yet, just accessed the object so far without
278278 // doing anything
@@ -283,7 +283,8 @@ void RecordComponent::flush(
283283 {
284284 throw error::WrongAPIUsage (
285285 " [RecordComponent] Must specify dataset type and extent "
286- " before flushing (see RecordComponent::resetDataset())." );
286+ " before flushing or setting a constant value (see "
287+ " RecordComponent::resetDataset())." );
287288 }
288289 }
289290 if (!containsAttribute (" unitSI" ))
Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ def refcountingCreateData(self):
109109 for dim in ["x" , "y" ]:
110110 # Do not bother with a positionOffset
111111 position_offset = e ["positionOffset" ][dim ]
112+ position_offset .reset_dataset (
113+ io .Dataset (np .dtype ("int" ), [100 ]))
112114 position_offset .make_constant (0 )
113115
114116 position = e ["position" ][dim ]
You can’t perform that action at this time.
0 commit comments