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

Confine the unique_entities flag to where it's relevant in incorporate. #221

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

emilyfertig
Copy link

Diffbase is the inference_gendb branch.

Copy link

@ThomasColthurst ThomasColthurst left a 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) {

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.

@emilyfertig
Copy link
Author

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".

@emilyfertig emilyfertig force-pushed the 093024-emilyaf-inference_gendb branch from e9e5ce8 to 7aecc4b Compare October 3, 2024 22:08
Base automatically changed from 093024-emilyaf-inference_gendb to master October 4, 2024 16:09
@emilyfertig emilyfertig force-pushed the 100124-emilyaf-unique-entities branch from bc575d2 to 7aa4920 Compare October 4, 2024 19:33
@emilyfertig
Copy link
Author

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.

@emilyfertig emilyfertig merged commit b846860 into master Oct 4, 2024
2 checks passed
@emilyfertig emilyfertig deleted the 100124-emilyaf-unique-entities branch October 4, 2024 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants