Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Hierarchies #1432

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c3522f0
JSON backend: Fail when trying to open non-existing groups
franzpoeschel May 30, 2023
506363f
Insert CustomHierarchy class to Iteration
franzpoeschel Apr 12, 2023
a57bf26
Help older compilers deal with this
franzpoeschel May 25, 2023
56363a5
Add vector variants of meshes/particlesPath
franzpoeschel Jul 28, 2023
83d2e12
Move meshes and particles over to CustomHierarchies class
franzpoeschel Jul 28, 2023
0ee50f4
Move dirtyRecursive to CustomHierarchy
franzpoeschel May 30, 2023
10b6b9e
Move Iteration reading logic to CustomHierarchy
franzpoeschel Jul 28, 2023
0b3bb43
Move Iteration flushing logic to CustomHierarchy class
franzpoeschel Jul 31, 2023
90cd659
Support for custom datasets
franzpoeschel Jul 31, 2023
b321772
Treat "meshes"/"particles" as normal subgroups
franzpoeschel Jul 31, 2023
9335e13
Regex-based list of meshes/particlesPaths
franzpoeschel Jul 31, 2023
1415e90
More extended testing
franzpoeschel Jul 31, 2023
6303b14
Fix Python bindings without adding new functionality yet
franzpoeschel Aug 1, 2023
9468600
Add simple Python bindings and an example
franzpoeschel Aug 1, 2023
1876759
Replace Regexes with Globbing
franzpoeschel Oct 13, 2023
01e59a7
Move .meshes and .particles back to Iteration class
franzpoeschel Oct 24, 2023
3849c74
Some fixes in read error handling
franzpoeschel Oct 26, 2023
4acd1f8
More symmetric design for container types
franzpoeschel Oct 26, 2023
0637683
Don't write unitSI in custom datasets
franzpoeschel Nov 13, 2023
a869c3d
Discouraged support for custom datasets inside the particlesPath
franzpoeschel Dec 21, 2023
8dbe1c2
Fix after rebase: dirtyRecursive
franzpoeschel Mar 26, 2024
a4512d7
Fixes to the dirty/dirtyRecursive logic
franzpoeschel May 24, 2024
59a4a1c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 7, 2024
583ec1b
Some cleanup in CustomHierarchies class
franzpoeschel Aug 14, 2024
317cc0f
Use polymorphism for meshes/particlesPath in Python
franzpoeschel Nov 6, 2024
1032573
Remove hasMeshes / hasParticles logic
franzpoeschel Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Some fixes in read error handling
  • Loading branch information
franzpoeschel committed Dec 17, 2024
commit 3849c74da7ee5347aa517169dfe34f65b2f15740
38 changes: 30 additions & 8 deletions src/CustomHierarchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ void CustomHierarchy::read(
{
std::cerr << "Cannot read mesh at location '"
<< myPath().openPMDPath() << "/" << path
<< "' and will skip them due to read error:\n"
<< "' and will skip it due to read error:\n"
<< err.what() << std::endl;
meshesMap.forget(path);
}
Expand All @@ -454,7 +454,7 @@ void CustomHierarchy::read(
{
std::cerr << "Cannot read particle species at location '"
<< myPath().openPMDPath() << "/" << path
<< "' and will skip them due to read error:\n"
<< "' and will skip it due to read error:\n"
<< err.what() << std::endl;
particlesMap.forget(path);
}
Expand Down Expand Up @@ -492,7 +492,18 @@ void CustomHierarchy::read(
break;
}
case internal::ContainedType::Mesh:
readScalarMesh(meshesMap, path);
try
{
readScalarMesh(meshesMap, path);
}
catch (error::ReadError const &err)
{
std::cerr << "Cannot read scalar mesh at location '"
<< myPath().openPMDPath() << "/" << path
<< "' and will skip it due to read error:\n"
<< err.what() << std::endl;
meshesMap.forget(path);
}
break;
case internal::ContainedType::Particle:
std::cerr
Expand All @@ -508,11 +519,22 @@ void CustomHierarchy::read(
for (auto const &path : constantComponentsPushback)
{
auto &rc = data.m_embeddedDatasets[path];
Parameter<Operation::OPEN_PATH> pOpen;
pOpen.path = path;
IOHandler()->enqueue(IOTask(&rc, pOpen));
rc.get().m_isConstant = true;
rc.read();
try
{
Parameter<Operation::OPEN_PATH> pOpen;
pOpen.path = path;
IOHandler()->enqueue(IOTask(&rc, pOpen));
rc.get().m_isConstant = true;
rc.read();
}
catch (error::ReadError const &err)
{
std::cerr << "Cannot read dataset at location '"
<< myPath().openPMDPath() << "/" << path
<< "' and will skip it due to read error:\n"
<< err.what() << std::endl;
data.m_embeddedDatasets.container().erase(path);
}
}
}

Expand Down