Skip to content

Commit

Permalink
fix: included ground truth in comparison matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Aug 7, 2024
1 parent 2ab3a11 commit c33d34c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 6 additions & 4 deletions worker/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ def _execute_sbml_job(self):
steps = self.job_params.get('steps', 100)
rtol = self.job_params.get('rTol')
atol = self.job_params.get('aTol')
truth = self.job_params.get('ground_truth_report_path')

result = self._run_comparison_from_sbml(sbml_fp=local_fp, start=output_start, dur=end, steps=steps, rTol=rtol, aTol=atol)
result = self._run_comparison_from_sbml(sbml_fp=local_fp, start=output_start, dur=end, steps=steps, rTol=rtol, aTol=atol, ground_truth=truth)
self.job_result = result
except Exception as e:
self.job_result = {"bio-check-message": f"Job for {self.job_params['comparison_id']} could not be completed because:\n{str(e)}"}
Expand Down Expand Up @@ -250,7 +251,7 @@ def _run_comparison_from_omex(
# id=comparison_id,
# simulators=simulators)

def _run_comparison_from_sbml(self, sbml_fp, start, dur, steps, rTol=None, aTol=None, simulators=None) -> Dict:
def _run_comparison_from_sbml(self, sbml_fp, start, dur, steps, rTol=None, aTol=None, simulators=None, ground_truth=None) -> Dict:
species_mapping = get_sbml_species_mapping(sbml_fp)
results = {'results': {}}
for species_name in species_mapping.keys():
Expand All @@ -262,7 +263,8 @@ def _run_comparison_from_sbml(self, sbml_fp, start, dur, steps, rTol=None, aTol=
species_name=species_name,
rTol=rTol,
aTol=aTol,
simulators=simulators
simulators=simulators,
ground_truth=ground_truth
)
results['results'][species_name] = species_comparison

Expand Down Expand Up @@ -310,7 +312,7 @@ def _generate_sbml_utc_species_comparison(self, sbml_filepath, start, dur, steps
if "amici" in simulators:
simulators.remove("amici")

output_data = generate_sbml_utc_outputs(sbml_fp=sbml_filepath, start=start, dur=dur, steps=steps)
output_data = generate_sbml_utc_outputs(sbml_fp=sbml_filepath, start=start, dur=dur, steps=steps, truth=ground_truth)
outputs = sbml_output_stack(species_name, output_data)
methods = ['mse', 'proximity']
matrix_vals = list(map(
Expand Down
2 changes: 0 additions & 2 deletions worker/output_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ def generate_sbml_utc_outputs(sbml_fp: str, start: int, dur: int, steps: int, tr
spec_name = datum['dataset_label']
spec_data = datum['data']
output['truth'][spec_name] = spec_data
print(len(spec_data))


return output

Expand Down

0 comments on commit c33d34c

Please sign in to comment.