Skip to content

Commit

Permalink
Inheritance addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
rjgreen-dstl committed May 18, 2020
1 parent a13ac00 commit 33503dd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
18 changes: 16 additions & 2 deletions stonesoup/metricgenerator/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class MetricManager(Base):
"""


class MetricTableGenerator(Base):
class MetricTableGenerator(MetricGenerator):
"""Metric Table base class
Takes a set of :class: `~.Metric` objects and outputs a table of the
values next to a description and target for each metric"""

@abstractmethod
def generate_table(self, **kwargs):
def compute_metric(self, **kwargs):
"""Generate table
Parameters
Expand All @@ -63,3 +63,17 @@ class PlotGenerator(MetricGenerator):
PlotGenerators generate metrics that are visualisations. Return
:class:`~.PlottingMetric` objects.
"""

@abstractmethod
def compute_metric(self, **kwargs):
"""Generate table
Parameters
----------
: set of :class: `~.Metric` objects
Returns
-------
matplotlib.Table object"""

raise NotImplementedError
2 changes: 1 addition & 1 deletion stonesoup/metricgenerator/metrictables.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, *args, **kwargs):
self.targets = dict
self.descriptions = dict

def generate_table(self, **kwargs):
def compute_metric(self, **kwargs):
"""Generate table method
Returns a matplotlib Table of metrics with their descriptions, target
Expand Down
2 changes: 1 addition & 1 deletion stonesoup/metricgenerator/tests/test_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ def test_siaptable():
generator=metric_generator))
# Generate table
table_generator = SIAPTableGenerator(metrics)
table = table_generator.generate_table()
table = table_generator.compute_metric()
assert isinstance(table, Table)

0 comments on commit 33503dd

Please sign in to comment.