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

changed loadHouseholds when households eq. null #2704

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,22 @@ private void loadHouseholds() {
else {
log.info("no households file set in config, not loading households");
}
final String fn = this.config.households().getInputHouseholdAttributesFile();
if ((this.config.households() != null) && ( fn != null)) {
if (!this.config.households().isInsistingOnUsingDeprecatedHouseholdsAttributeFile()) {
throw new RuntimeException(HouseholdsConfigGroup.HOUSEHOLD_ATTRIBUTES_DEPRECATION_MESSAGE);
if ((this.config.households() != null)) {
final String fn = this.config.households().getInputHouseholdAttributesFile();
if(( fn != null)) {
if (!this.config.households().isInsistingOnUsingDeprecatedHouseholdsAttributeFile()) {
throw new RuntimeException(HouseholdsConfigGroup.HOUSEHOLD_ATTRIBUTES_DEPRECATION_MESSAGE);
}

URL householdAttributesFileName = ConfigGroup.getInputFileURL(this.config.getContext(), fn ) ;
log.info("loading household attributes from " + householdAttributesFileName);
parseObjectAttributesToAttributable(
householdAttributesFileName,
this.scenario.getHouseholds().getHouseholds().values(),
"householdAttributes not empty after going through all households, meaning that it contains material for householdIDs that " +
"are not in the container. This is not necessarily a bug so we will continue, but note that such material " +
"will no longer be contained in the output_* files.");
}

URL householdAttributesFileName = ConfigGroup.getInputFileURL(this.config.getContext(), fn ) ;
log.info("loading household attributes from " + householdAttributesFileName);
parseObjectAttributesToAttributable(
householdAttributesFileName,
this.scenario.getHouseholds().getHouseholds().values(),
"householdAttributes not empty after going through all households, meaning that it contains material for householdIDs that " +
"are not in the container. This is not necessarily a bug so we will continue, but note that such material " +
"will no longer be contained in the output_* files.");
}
else {
log.info("no household-attributes file set in config, not loading any household attributes");
Expand Down
Loading