-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from dyson-ai/feature/refactor_plot_return_types
Feature/refactor plot return types
- Loading branch information
Showing
7 changed files
with
72 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
from typing import List | ||
import panel as pn | ||
from bencher.plotting.plot_types import PlotTypes | ||
|
||
from bencher.plotting.plot_filter import PlotInput | ||
from bencher.plotting.plot_types import PlotTypes | ||
|
||
|
||
class Tables: | ||
"""A class to display the result data in tabular form""" | ||
|
||
def dataframe_flat(self, pl_in: PlotInput) -> List[pn.panel]: | ||
def dataframe_flat(self, pl_in: PlotInput) -> pn.panel: | ||
"""Returns a list of panel objects containing a flat dataframe.""" | ||
df = pl_in.bench_cfg.get_dataframe() | ||
return [pn.pane.DataFrame(df, name=PlotTypes.dataframe_flat)] | ||
return pn.pane.DataFrame(df, name=PlotTypes.dataframe_flat) | ||
|
||
def dataframe_multi_index(self, pl_in: PlotInput) -> List[pn.panel]: | ||
def dataframe_multi_index(self, pl_in: PlotInput) -> pn.panel: | ||
"""Returns a list of panel objects containing a multi-index dataframe.""" | ||
df = pl_in.bench_cfg.ds.to_dataframe() | ||
return [pn.pane.DataFrame(df, name=PlotTypes.dataframe_multi_index)] | ||
return pn.pane.DataFrame(df, name=PlotTypes.dataframe_multi_index) | ||
|
||
def dataframe_mean(self, pl_in: PlotInput) -> List[pn.panel]: | ||
def dataframe_mean(self, pl_in: PlotInput) -> pn.panel: | ||
"""Returns a list of panel objects containing a mean dataframe.""" | ||
df = pl_in.bench_cfg.ds.mean("repeat").to_dataframe().reset_index() | ||
return [pn.pane.DataFrame(df, name=PlotTypes.dataframe_mean)] | ||
return pn.pane.DataFrame(df, name=PlotTypes.dataframe_mean) | ||
|
||
def xarray(self, pl_in: PlotInput) -> List[pn.panel]: | ||
def xarray(self, pl_in: PlotInput) -> pn.panel: | ||
"""Returns a list of panel objects containing an xarray object.""" | ||
return [pn.panel(pl_in.bench_cfg.ds, name=PlotTypes.xarray)] | ||
return pn.panel(pl_in.bench_cfg.ds, name=PlotTypes.xarray) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters