Skip to content

Commit

Permalink
forcing namespace for experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
RosalynLP committed Jul 9, 2020
1 parent bcd1870 commit 471b4c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
18 changes: 2 additions & 16 deletions validphys2/src/validphys/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,22 +1164,8 @@ def produce_group_dataset_inputs_by_metadata(
for name, group in res.items()
]

def produce_group_dataset_inputs_by_experiment(
self, data_input):
res = defaultdict(list)
for dsinput in data_input:
cd = self.produce_commondata(dataset_input=dsinput)
try:
res[getattr(get_info(cd), "experiment")].append(dsinput)
except AttributeError:
raise ConfigError(
f"Unable to find key: experiment in {cd.name} "
"PLOTTING file."
)
return [
{"data_input": group, "experiment_name": name}
for name, group in res.items()
]
def produce_force_group_by_experiment(self):
return {"metadata_group": 'experiment'}


def produce_scale_variation_theories(self, theoryid, point_prescription):
Expand Down
2 changes: 1 addition & 1 deletion validphys2/src/validphys/dataplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def plot_groups_data_chi2(groups_data, groups_chi2, processed_metadata_group):
ax.set_title(r"$\chi^2$ distribution by {}".format(processed_metadata_group))
return fig

plot_experiments_chi2 = collect("plot_groups_data_chi2", ("group_dataset_inputs_by_experiment",))
plot_experiments_chi2 = collect("plot_groups_data_chi2", ("force_group_by_experiment",))

@figure
def plot_datasets_chi2(groups_data, groups_chi2, each_dataset_chi2):
Expand Down
4 changes: 2 additions & 2 deletions validphys2/src/validphys/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def group_result_table(group_result_table_no_table):
"""Duplicate of group_result_table_no_table but with a table decorator."""
return group_result_table_no_table

experiment_result_table = collect('group_result_table', ("group_dataset_inputs_by_experiment",))
experiment_result_table = collect('group_result_table', ("force_group_by_experiment",))

@table
def group_result_table_68cl(group_result_table_no_table: pd.DataFrame, pdf: PDF):
Expand Down Expand Up @@ -782,7 +782,7 @@ def groups_chi2_table(groups_data, pdf, groups_chi2,
records.append(stats)
return pd.DataFrame(records)

experiments_chi2_table = collect('groups_chi2_table', ("group_dataset_inputs_by_experiment",))
experiments_chi2_table = collect('groups_chi2_table', ("force_group_by_experiment",))

@check_cuts_considered
@table
Expand Down

0 comments on commit 471b4c5

Please sign in to comment.