Skip to content

Commit 036bd34

Browse files
committed
Add series.iterations to test
1 parent e8973bd commit 036bd34

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/Series.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2360,7 +2360,17 @@ creating new iterations.
23602360
readableIterations.reserve(pList.paths->size());
23612361
for (auto const &it : *pList.paths)
23622362
{
2363-
IterationIndex_t index = std::stoull(it);
2363+
IterationIndex_t index;
2364+
try
2365+
{
2366+
index = std::stoull(it);
2367+
}
2368+
catch (std::exception const &e)
2369+
{
2370+
std::cerr << "[Warning] Could not parse '" << it
2371+
<< "' as an Iteration index. Will skip." << std::endl;
2372+
continue;
2373+
}
23642374
if (read_only_this_single_iteration.has_value() &&
23652375
index != *read_only_this_single_iteration)
23662376
{

src/backend/Attributable.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,6 @@ void Attributable::customHierarchyFlush(
198198
// customHierarchies().printRecursively();
199199
if (!dirtyRecursive())
200200
{
201-
if (!unset_dirty)
202-
{
203-
throw std::runtime_error(
204-
"Control flow error: Should be called upon a dirty object.");
205-
}
206201
return;
207202
}
208203

test/Files_Core/custom_hierarchy.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ void write(
4141
IterationEncoding)
4242
{
4343
Series series(filename, Access::CREATE_LINEAR, json_params);
44-
auto add_custom_hierarchy = [](Attributable &attr) {
44+
auto add_custom_hierarchy = [](auto &&attr) {
4545
attr.customHierarchies()["rabimmel"].setAttribute("rabammel", "rabumm");
4646
};
4747
auto iteration = series.snapshots()[0];
4848

4949
add_custom_hierarchy(series);
50+
add_custom_hierarchy(series.snapshots());
5051
add_custom_hierarchy(iteration);
5152
iteration.close();
5253
}
@@ -57,8 +58,8 @@ void read(
5758
IterationEncoding)
5859
{
5960
Series series(filename, Access::READ_LINEAR, json_params);
60-
auto require_custom_hierarchy = [](Attributable &attr) {
61-
auto ch = attr.customHierarchies();
61+
auto require_custom_hierarchy = [](auto &&attr) {
62+
CustomHierarchy ch = attr.customHierarchies();
6263
REQUIRE(ch.find("rabimmel") == ch.end());
6364
ch.read(0);
6465
REQUIRE(
@@ -68,6 +69,7 @@ void read(
6869
auto iteration = series.snapshots()[0];
6970

7071
require_custom_hierarchy(series);
72+
require_custom_hierarchy(series.snapshots());
7173
require_custom_hierarchy(iteration);
7274
iteration.close();
7375
}

0 commit comments

Comments
 (0)