fix: better inference with overrides
All checks were successful
gitea-physics/kalpa/pipeline/head This commit looks good
All checks were successful
gitea-physics/kalpa/pipeline/head This commit looks good
This commit is contained in:
parent
3fe55dbb67
commit
31ba558364
@ -155,8 +155,23 @@ class Stage04Runner:
|
|||||||
writer = csv.DictWriter(outfile, MERGED_OUT_FIELDNAMES)
|
writer = csv.DictWriter(outfile, MERGED_OUT_FIELDNAMES)
|
||||||
writer.writeheader()
|
writer.writeheader()
|
||||||
|
|
||||||
if self.config.generation_config.override_dipole_configs is None:
|
if self.config.generation_config.override_dipole_configs is not None:
|
||||||
|
override_names = self.config.generation_config.override_dipole_configs.keys()
|
||||||
|
elif self.config.generation_config.override_measurement_filesets is not None:
|
||||||
|
override_names = self.config.generation_config.override_measurement_filesets.keys()
|
||||||
|
else:
|
||||||
|
override_names = None
|
||||||
|
|
||||||
|
if (override_names is not None):
|
||||||
|
_logger.debug(
|
||||||
|
f"We had overridden dipole config, using override {override_names}"
|
||||||
|
)
|
||||||
|
for override_name in override_names:
|
||||||
|
_logger.info(f"Working for subdir {override_name}")
|
||||||
|
rows = self.read_merged_coalesced_csv_override(override_name)
|
||||||
|
for row in rows:
|
||||||
|
writer.writerow(row)
|
||||||
|
else:
|
||||||
for count in self.config.generation_config.counts:
|
for count in self.config.generation_config.counts:
|
||||||
for orientation in self.config.generation_config.orientations:
|
for orientation in self.config.generation_config.orientations:
|
||||||
for replica in range(
|
for replica in range(
|
||||||
@ -169,21 +184,9 @@ class Stage04Runner:
|
|||||||
for row in rows:
|
for row in rows:
|
||||||
writer.writerow(row)
|
writer.writerow(row)
|
||||||
|
|
||||||
else:
|
|
||||||
_logger.debug(
|
|
||||||
f"We had overridden dipole config, using override {self.config.generation_config.override_dipole_configs}"
|
|
||||||
)
|
|
||||||
for (
|
|
||||||
override_name
|
|
||||||
) in self.config.generation_config.override_dipole_configs.keys():
|
|
||||||
_logger.info(f"Working for subdir {override_name}")
|
|
||||||
rows = self.read_merged_coalesced_csv_override(override_name)
|
|
||||||
for row in rows:
|
|
||||||
writer.writerow(row)
|
|
||||||
|
|
||||||
# merge with inference
|
# merge with inference
|
||||||
|
|
||||||
if self.config.generation_config.override_dipole_configs is None:
|
if override_names is None:
|
||||||
|
|
||||||
with megamerged_path.open(mode="r", newline="") as infile:
|
with megamerged_path.open(mode="r", newline="") as infile:
|
||||||
# Note that if you pass in fieldnames to a DictReader it doesn't skip. So this is bad:
|
# Note that if you pass in fieldnames to a DictReader it doesn't skip. So this is bad:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user