-
Notifications
You must be signed in to change notification settings - Fork 2
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
Confine the unique_entities flag to where it's relevant in incorporate. #221
Conversation
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.
As I suspected, this approach is more complex than the simple code that it replaces.
cxx/gendb.cc
Outdated
if (!reference_values.at(domains[ind]).contains({rf_name, class_item})) { | ||
int new_val; | ||
const std::string& ref_class = domains.at(rf_ind); | ||
if (domain_crps.at(ref_class).tables.size() == 0) { |
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.
This can be simplified after #222 is submitted.
The nested if and for isn't great, but I'd rather have the complexity confined to a single method than plumb an arg through whose purpose is confusing in most of the methods, and will result in weird subtle bugs if someone passes "true" from anywhere but the call in "incorporate". |
e9e5ce8
to
7aecc4b
Compare
…through methods that it isn't relevant to.
bc575d2
to
7aa4920
Compare
I looked at this again, and especially with crp.max_table, the complexity of the new function isn't that bad so I'm going to merge it to better separate concerns between initialization with unique entities/inference where we want CRP samples. |
Diffbase is the inference_gendb branch.