Skip to content

Commit 9224a5d

Browse files
committed
Fixes
1 parent e77d303 commit 9224a5d

7 files changed

Lines changed: 10 additions & 15 deletions

File tree

include/openPMD/backend/BaseRecord.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,6 @@ class BaseRecord
366366
*/
367367
bool scalar() const;
368368

369-
protected:
370-
void readBase();
371-
372369
private:
373370
void flush(std::string const &, internal::FlushParams const &) final;
374371
virtual void

include/openPMD/backend/ScientificDefaults_internal.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ struct ConfigAttribute
239239
Attribute attribute(Attribute::from_any, std::move(*aRead.m_resource));
240240
if (attributeReaders.empty())
241241
{
242-
std::cout << "Empty attribute readers for " << this->attrName
243-
<< std::endl;
242+
// No readers emplaced for this attribute
243+
return;
244244
}
245245
for (auto &attributeReader : attributeReaders)
246246
{

src/Mesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ void Mesh::read()
489489

490490
std::move(homogenizeExtents).homogenize(*this);
491491

492-
readBase();
492+
internal::ScientificDefaults<Mesh>::readDefaults(IOHandler()->m_standard);
493493

494494
readAttributes(ReadMode::FullyReread);
495495
}

src/Record.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "openPMD/ThrowError.hpp"
2525
#include "openPMD/UnitDimension.hpp"
2626
#include "openPMD/backend/BaseRecord.hpp"
27+
#include "openPMD/backend/ScientificDefaults.hpp"
2728

2829
#include <iostream>
2930

@@ -191,7 +192,7 @@ auto Record::read() -> internal::HomogenizeExtents
191192
}
192193
}
193194

194-
readBase();
195+
internal::ScientificDefaults<Record>::readDefaults(IOHandler()->m_standard);
195196

196197
readAttributes(ReadMode::FullyReread);
197198
return res;

src/RecordComponent.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "openPMD/auxiliary/StringManip.hpp"
3030
#include "openPMD/backend/Attributable.hpp"
3131
#include "openPMD/backend/BaseRecord.hpp"
32+
#include "openPMD/backend/ScientificDefaults.hpp"
3233
#include "openPMD/backend/Variant_internal.hpp"
3334

3435
// comment so clang-format does not move this
@@ -515,6 +516,8 @@ void RecordComponent::flush(
515516
void RecordComponent::read()
516517
{
517518
readBase();
519+
internal::ScientificDefaults<RecordComponent>::readDefaults(
520+
IOHandler()->m_standard);
518521
}
519522

520523
namespace

src/backend/BaseRecord.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -765,13 +765,6 @@ inline bool BaseRecord<T_elem>::scalar() const
765765
return this->datasetDefined();
766766
}
767767

768-
template <typename T_elem>
769-
inline void BaseRecord<T_elem>::readBase()
770-
{
771-
internal::ScientificDefaults<BaseRecord<T_elem>>::readDefaults(
772-
this->IOHandler()->m_standard);
773-
}
774-
775768
template <typename T_elem>
776769
inline void BaseRecord<T_elem>::flush(
777770
std::string const &name, internal::FlushParams const &flushParams)

src/backend/ScientificDefaults.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,8 @@ void ScientificDefaults<Child>::defaults_impl(OpenpmdStandard standard)
492492
else if constexpr (std::is_same_v<Child, Record>)
493493
{
494494
defaultAttribute("timeOffset")
495-
.template withSetter<Record>(0.f, &Record::setTimeOffset)(wor);
495+
.template withSetter<Record>(0.f, &Record::setTimeOffset)
496+
.withReader(float_types, require_scalar)(wor);
496497

497498
auto const &keyInParent = asChild().writable().ownKeyWithinParent;
498499
if (keyInParent == "position" || keyInParent == "positionOffset")

0 commit comments

Comments
 (0)