File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -216,6 +216,11 @@ struct ConfigAttribute
216216
217217 void read ()
218218 {
219+ if (attributeReaders.empty ())
220+ {
221+ // No readers emplaced for this attribute
222+ return ;
223+ }
219224 AttributeReadResult res = attribute_read_result::TypeUnmatched{};
220225 Parameter<Operation::READ_ATT> aRead;
221226 aRead.name = this ->attrName ;
@@ -237,11 +242,6 @@ struct ConfigAttribute
237242 }
238243
239244 Attribute attribute (Attribute::from_any, std::move (*aRead.m_resource ));
240- if (attributeReaders.empty ())
241- {
242- // No readers emplaced for this attribute
243- return ;
244- }
245245 for (auto &attributeReader : attributeReaders)
246246 {
247247
Original file line number Diff line number Diff line change @@ -552,6 +552,14 @@ void ScientificDefaults<Child>::defaults_impl(OpenpmdStandard standard)
552552 // We don't require unitSI for PatchRecordComponent
553553 //
554554 // addParentDefaults<RecordComponent, write>();
555+ //
556+ // But we still set it when writing. Doesnt hurt and some readers might
557+ // expect it.
558+ defaultAttribute (" unitSI" ).template withSetter <PatchRecordComponent>(
559+ 1.0 , &PatchRecordComponent::setUnitSI)
560+ // Do NOT add a reader here.
561+ // .withReader(float_types, require_type<double>())
562+ (wor);
555563 }
556564 else if constexpr (auxiliary::IsTemplateBaseOf_v<BaseRecord, Child>)
557565 {
You can’t perform that action at this time.
0 commit comments