-
Notifications
You must be signed in to change notification settings - Fork 14
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
deprecate write_tree_flag in favor of direct method arguments #163
Conversation
- now takes a parameter `require_tree` instead of `tree` - prints and returns false if APR data group does not exist - prints and returns false if `require_tree=true` but tree group does not exist - if tree data exists, it is opened regardless of `require_tree` - refactor usages (this change should not break anything)
Deprecate use of write_tree_flag and related methods. Note that a side effect of this is that in order to write an APR file without the tree data, one has to specify t and channel_name, due to the order of arguments
NOTE: this change affects read times since read_apr now initializes the tree structure
…:total_number_tree_particles
I do not have more specific comments. I do not really like how APR.hpp looks but** it is not connected to this specific changes but in general it ... screams for big refactoring which is not (and should not be) part of this PR. |
Good points. I think large parts of the library need a major cleanup -- not just removing unused and deprecated code, but also restructuring and rethinking some classes. I will merge this for now though |
Resolve some of the issues discussed in #160 and fixes current errors with examples (#162, but testing examples is still a good idea). Notable changes:
write_tree_flag
and mark the set/get methods as deprecatedwrite_apr
now takes fourth argument:bool write_apr(APR& apr,uint64_t t = 0,std::string channel_name = "t", bool write_tree = true);
read_apr
reads the APR and tries to read the tree. If the tree does not exist,it initializes it from the APR structureit is left uninitialized until required by other methods.apr_or_tree
argumentThe new behavior of
read_apr
has some performance implications. Reading the tree is quite fast (adds ~5-15% to overall read time),but initializing the tree from the APR is significantly slower (makes overall read time up to 7 times longer). Perhaps the default behavior if the tree data is not on file should be to leave it uninitialized.What do you think @cheesema?