Skip to content

Commit

Permalink
Include domains in attribute overview tables even if none of their ta…
Browse files Browse the repository at this point in the history
…sks has an attribute value for all algorithms.
  • Loading branch information
jendrikseipp committed Mar 11, 2022
1 parent 7aececb commit 4705e06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ v7.1 (unreleased)

Lab
^^^
* Revamp Singularity example experiment: use runsolver to limit resource usage (Silvan Sievers and Jendrik Seipp).
* Revamp Singularity example experiment: use runsolver to limit resource usage
(Silvan Sievers and Jendrik Seipp).

Downward Lab
^^^^^^^^^^^^
* Fix header sizes in HTML reports (Jendrik Seipp).
* Include domains in attribute overview tables even if none of their tasks has an
attribute value for all algorithms (Jendrik Seipp).


v7.0 (2021-10-24)
Expand Down
13 changes: 8 additions & 5 deletions downward/reports/absolute.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _add_table_info(self, attribute, func_name, table):
"""
if not attribute.absolute:
table.info.append(
f"Only instances where all algorithms have a "
f"Only tasks where all algorithms have a "
f'value for "{attribute}" are considered.'
)
table.info.append(
Expand All @@ -235,7 +235,10 @@ def _get_suite_table(self, attribute):
func_name, func = self._get_aggregation_function(attribute)
num_probs = 0
self._add_table_info(attribute, func_name, table)
domain_algo_values = defaultdict(list)
domain_algo_values = {}
for domain in self.domains:
for algorithm in self.algorithms:
domain_algo_values[(domain, algorithm)] = []
for (domain, _), runs in self.problem_runs.items():
# If the attribute is absolute, no runs must have been filtered and
# no values must be missing.
Expand All @@ -258,8 +261,7 @@ def _get_suite_table(self, attribute):
# different problem numbers.
for domain in self.domains:
task_counts = [
str(len(domain_algo_values.get((domain, algo), [])))
for algo in self.algorithms
str(len(domain_algo_values[(domain, algo)])) for algo in self.algorithms
]
if len(set(task_counts)) == 1:
count = task_counts[0]
Expand All @@ -272,7 +274,8 @@ def _get_suite_table(self, attribute):
table.cell_formatters[domain][table.header_column] = formatter

for (domain, algo), values in domain_algo_values.items():
table.add_cell(domain, algo, func(values))
domain_value = func(values) if values else None
table.add_cell(domain, algo, domain_value)

table.num_values = num_probs
return table
Expand Down

0 comments on commit 4705e06

Please sign in to comment.