-
Notifications
You must be signed in to change notification settings - Fork 1
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
Read zipped input data #391
Conversation
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
clang-tidy review says "All clean, LGTM! 👍" |
20a246f
to
c8dd65a
Compare
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good. Just one question on how well temp creation behaves on the HPC, and to consider if we want to be a bit careful, or else do some testing.
c8dd65a
to
fb9e4e2
Compare
fb9e4e2
to
c836cbe
Compare
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've a few suggestions, mainly related to error handling and explicitly. Maybe I'm in a pythonic mindset, but I thought worth to highlight them.
if (!std::filesystem::create_directories(out_path)) { | ||
throw std::runtime_error{ | ||
fmt::format("Failed to create directory: {}", out_path.string())}; | ||
} | ||
} else { | ||
std::ofstream ofs{out_path}; | ||
if (!ofs) { | ||
throw std::runtime_error{ | ||
fmt::format("Failed to create file: {}", out_path.string())}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be useful to attach the original error to get an idea of why these fail, so the user can investigate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason it'll fail here is because of an IO error and C++ won't give any information beyond that, unfortunately.
Suggested by @dalonsoa.
clang-tidy review says "All clean, LGTM! 👍" |
This PR adds the option to provide the input data as a path to a zip file rather than to a directory, e.g.:
Note that the
index.json
file must be in the root folder of the zip file otherwise it won't work.While this feature isn't particularly useful by itself, it's a necessary step to being able to automatically download input data from a URL (#364).
I haven't added tests yet because the input files are likely to be moved out of this repo soon (#366), so I'll wait until we know what the final project structure looks like first. I didn't want to commit a zip file to the repo either if its contents are likely to change soon.
I've also broken out the schema-related code into its own
.cpp
file asdatamanager.cpp
was getting a bit bloated.Closes #363.