Skip to content

Commit 852eb5d

Browse files
committed
various cli fixes including for #35
1 parent af66c0b commit 852eb5d

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

pypop/cli/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ def hybrid_cli_metrics():
271271

272272
metrics = MPI_OpenMP_Metrics(statistics)
273273

274+
print(config.metric_table)
275+
274276
# Create and save table
275277
if not config.no_metric_table:
276278
metric_table = metrics.plot_table(

pypop/notebook_interface/plotting.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,13 @@ def _repr_html_(self):
9090

9191
return file_html(self.figure, INLINE, "")
9292

93-
def _repr_png_(self):
94-
if not environ.get("PYPOP_HEADLESS"):
93+
def _repr_png_(self, force=False):
94+
if not environ.get("PYPOP_HEADLESS") and not force:
9595
return None
9696

97-
try:
98-
window_size = [int(1.1 * x) for x in self._plot_dims]
99-
except AttributeError:
100-
window_size = (900, 600)
97+
self.figure.min_border = 10
98+
99+
window_size = [1.1*self.figure.plot_width, 1.1*self.figure.plot_height]
101100

102101
self.figure.toolbar_location = None
103102

@@ -119,7 +118,7 @@ def save_html(self, path):
119118
fh.write(imgcode)
120119

121120
def save_png(self, path):
122-
imgdata = self._repr_png_()
121+
imgdata = self._repr_png_(force=True)
123122

124123
with open(path, "wb") as fh:
125124
fh.write(imgdata)
@@ -511,7 +510,7 @@ def _build_plot(self):
511510
tools=["save"],
512511
min_border=0,
513512
aspect_ratio=1.5,
514-
sizing_mode="scale_width",
513+
sizing_mode="fixed",
515514
x_range=x_axis_range,
516515
y_range=y_axis_range,
517516
title=self.title

setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
include_package_data=True,
3131
entry_points={
3232
"console_scripts": [
33-
"pypop-mpi-metrics = pypop.cli:mpi_cli_metrics",
34-
"pypop-hybrid-metrics = pypop.cli:hybrid_cli_metrics",
35-
"pypop-openmp-metrics = pypop.cli:openmp_cli_metrics",
36-
"pypop-preprocess = pypop.cli:preprocess_traces",
37-
"pypop-idealise-prv = pypop.cli:dimemas_idealise_cli",
38-
"pypop-copy-examples = pypop.cli:copy_examples",
39-
"pypop-gui = pypop.cli:pypop_gui",
33+
"pypop-mpi-metrics = pypop.cli.cli:mpi_cli_metrics",
34+
"pypop-hybrid-metrics = pypop.cli.cli:hybrid_cli_metrics",
35+
"pypop-openmp-metrics = pypop.cli.cli:openmp_cli_metrics",
36+
"pypop-preprocess = pypop.cli.cli:preprocess_traces",
37+
"pypop-idealise-prv = pypop.cli.cli:dimemas_idealise_cli",
38+
"pypop-copy-examples = pypop.cli.cli:copy_examples",
39+
"pypop-gui = pypop.cli.cli:pypop_gui",
4040
]
4141
},
4242
)

0 commit comments

Comments
 (0)