-
Notifications
You must be signed in to change notification settings - Fork 10
Use configuration for I/O, plus general cleanup #22
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
Conversation
Update factories.hpp
Update storage.cpp
gemmeren
left a comment
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.
Mostly minor things now :)
…per constants to technology.hpp and update factories.hpp to use named constants instead of hardcoded values. Addresses code review feedback.
- Replace magic numbers with constexpr constants and Combine() helper - Add HDF5 placeholder - Remove redundant form/ directory from include paths Update CMake and source files to match simplified directory structure
gemmeren
left a comment
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.
Thanks Barnali, this looks good.
pcanal
left a comment
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.
Thanks. Let's squash on merge.
knoepfel
left a comment
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.
@barnaliy, just some minor comments for your consideration.
| const std::string& top_name(); | ||
| const std::string& col_name(); |
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.
Should be const-qualified member functions:
| const std::string& top_name(); | |
| const std::string& col_name(); | |
| const std::string& top_name() const; | |
| const std::string& col_name() const; |
|
|
||
| Storage_Container::Storage_Container(const std::string& name) : m_name(name), m_file(nullptr) {} | ||
|
|
||
| Storage_Container::~Storage_Container() {} |
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.
Same comment as before. Putting the implementation of the destructor in the .cpp makes sense. If you want it to be the default implementation, just specify it here:
Storage_Container::~Storage_Container() = default;| const form::experimental::config::parse_config& config) //factory takes form config | ||
| { | ||
| return std::unique_ptr<IPersistence>(new Persistence()); | ||
| return std::unique_ptr<IPersistence>(new Persistence(config)); |
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.
If you're adjusting this line of code anyway, I suggest using std::make_unique:
| return std::unique_ptr<IPersistence>(new Persistence(config)); | |
| return std::make_unique<Persistence>(config); |
form/persistence/persistence.cpp
Outdated
| m_store(nullptr), m_config(config) // constructor takes form config | ||
| { | ||
| m_store = createStorage(); | ||
| } |
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.
| m_store(nullptr), m_config(config) // constructor takes form config | |
| { | |
| m_store = createStorage(); | |
| } | |
| m_store(createStorage()), m_config(config) // constructor takes form config | |
| {} |
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.
@knoepfel: Thanks for the feedback! I've implemented your suggestions.
technology-specific configuration system.
* First import of latest FORM developments from Phlex. This will eventually become a PR to add per-container configuration attributes. * Restored include guard formatting that didn't all make it to the FORM development repository. * Restored CMakeLists.txt formatting to match the main branch when possible. * Restored formatting in a CMakeLists.txt that I missed. * Change include guards to _HPP__ from _H__ to match file names after reaching consensus with FORM team. * Changed configuration examples to use enums from technology header instead of magic numbers. * Removed member variable of form interface and other small text changes from PR review. * Fixed most of the requests from PR #36. * Restored PR #22 upgrades to Persistence while keeping new technology-specific configuration system. * Committing clang-format changes --------- Co-authored-by: Andrew Olivier <aolivier@anl.gov> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR reorganizes the configuration system that maps data products to storage technologies and file destinations.
What the Configuration System Does:
The configuration system allows users to specify:
Which storage technology to use for each data product (ROOT TTree, ROOT RNtuple, HDF5)
Which file each data product should be written to
Runtime flexibility rather than compile-time hardcoded storage decisions.
Tagging @gemmeren and @aolivier23
Requesting reviews from @knoepfel and @pcanal