Skip to content

Commit a89d5f0

Browse files
committed
rename
Signed-off-by: Tin Lai <[email protected]>
1 parent d73f8b5 commit a89d5f0

File tree

12 files changed

+148
-68
lines changed

12 files changed

+148
-68
lines changed

README.md

Lines changed: 88 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,97 @@
1-
# Terminal-plot for Tensorboard
1+
# Terminal-plot for Tensorboard and CSV
22

3-
[![pypi](https://img.shields.io/pypi/v/tensorboard-termplot)](https://pypi.org/project/tensorboard-termplot/)
4-
[![python-version](https://img.shields.io/pypi/pyversions/tensorboard-termplot)](https://pypi.org/project/tensorboard-termplot/)
5-
[![Master Update](https://img.shields.io/github/last-commit/soraxas/tensorboard-termplot/master.svg)](https://github.com/soraxas/tensorboard-termplot/commits/master)
3+
[![pypi](https://img.shields.io/pypi/v/terminal-plot)](https://pypi.org/project/terminal-plot/)
4+
[![python-version](https://img.shields.io/pypi/pyversions/terminal-plot)](https://pypi.org/project/terminal-plot/)
5+
[![Master Update](https://img.shields.io/github/last-commit/soraxas/termplot/master.svg)](https://github.com/soraxas/termplot/commits/master)
66
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
7-
[![License](https://img.shields.io/github/license/soraxas/tensorboard-termplot.svg)](https://github.com/soraxas/tensorboard-termplot/blob/master/LICENSE)
7+
[![License](https://img.shields.io/github/license/soraxas/termplot.svg)](https://github.com/soraxas/termplot/blob/master/LICENSE)
88

9-
A plotter for tensorboard, directly within your terminal. This is useful when you are training your neural network on a remote server, and you just want to quickly peek at the training curve without launching a tensorboard instance and mess with forwarding ports.
9+
A plotter for multiple different tensorboard, directly within your terminal. This is useful when you are training your neural network on a remote server, and you just want to quickly peek at the training curve without launching a tensorboard instance and mess with forwarding ports.
1010

1111
## Install
1212

1313
You can install the package published in PyPI with
1414
```sh
15-
$ pip install tensorboard-termplot
15+
$ pip install terminal-plot
16+
# or install with matplotlib backend dependency
17+
$ pip install terminal-plot[matplotlib-backend]
18+
1619
# or install with an isolated environment
17-
# $ pipx install tensorboard-termplot
20+
# $ pipx install terminal-plot
1821
```
1922

2023
## Usage
2124

2225
```sh
23-
$ tensorboard-termplot FOLDER
26+
$ termplot FOLDER/FILE
2427
```
2528
For example,
2629
```sh
27-
$ tensorboard-termplot ~/my_amazing_nn/runs
30+
$ termplot ~/my_amazing_nn/runs
2831
```
2932
where `runs` is the folder that tensorboard had created.
3033

34+
Or, using csv as a data source:
35+
```sh
36+
$ termplot ~/my_stats/output.csv --csv
37+
# use the -x flag to select which stat will be used as x-axis
38+
# $ termplot ~/my_stats/output.csv --csv -x time
39+
```
40+
41+
Or, using matplotlib as a plotting backend:
42+
```sh
43+
$ termplot ~/my_stats/output.csv --csv -m
44+
```
3145

3246
# Example
3347

3448
Running the executable on a tensorboard output folder:
3549

36-
![](https://raw.githubusercontent.com/soraxas/tensorboard-termplot/master/docs/images/example-output.png)
50+
![](https://raw.githubusercontent.com/soraxas/termplot/master/docs/images/example-output.png)
3751

38-
Or with the consolidate flag `-c/--consolidate` to combine multiple stats with a common prefix (most stats in the bottom figure had empty values):
52+
Or with the consolidated flag `-c/--consolidate` to combine multiple stats with a common prefix (most stats in the bottom figure had empty values):
3953

40-
![](https://raw.githubusercontent.com/soraxas/tensorboard-termplot/master/docs/images/example-output-consolidated.png)
54+
![](https://raw.githubusercontent.com/soraxas/termplot/master/docs/images/example-output-consolidated.png)
4155

4256

4357
# Help
4458

4559
```
46-
$ tensorboard-termplot --help
47-
usage: tensorboard-termplot [-h] [--canvas-color CANVAS_COLOR]
48-
[--axes-color AXES_COLOR]
49-
[--ticks-color TICKS_COLOR] [--colorless] [-d]
50-
[--grid] [--plotsize WIDTH,HEIGHT] [--force-label]
51-
[--no-iter-color] [-c] [-f] [-n secs]
52-
[--log_interval LOG_INTERVAL]
53-
FOLDER
60+
$ termplot --help
61+
usage: termplot [-h] [--version]
62+
[--backend {plotext,matplotlib,matplotlib-terminal}]
63+
[--data-source {tensorboard,csv}] [-m] [--csv]
64+
[--plotsize WIDTH,HEIGHT] [-c] [--as-scatter]
65+
[--canvas-color CANVAS_COLOR] [--axes-color AXES_COLOR]
66+
[--ticks-color TICKS_COLOR] [--grid] [--colorless] [-d]
67+
[--no-iter-color] [--force-label] [-f] [-n secs]
68+
[-w keyword [keyword ...]] [-b keyword [keyword ...]]
69+
[-x XAXIS_TYPE] [--xlog [row,col ...]] [--ylog [row,col ...]]
70+
[--xsymlog [row,col ...]] [--ysymlog [row,col ...]]
71+
[--xlim row,col=min,max [row,col=min,max ...]]
72+
[--ylim row,col=min,max [row,col=min,max ...]] [--as-raw-bytes]
73+
[-s [0-1]] [--smooth-poly-order poly-order]
74+
[--terminal-width TERMINAL_WIDTH]
75+
[--terminal-height TERMINAL_HEIGHT]
76+
FOLDER
5477
5578
positional arguments:
56-
FOLDER Folder of a tensorboard runs
79+
FOLDER Source folder or file
5780
5881
optional arguments:
5982
-h, --help show this help message and exit
83+
--version show program's version number and exit
84+
--backend {plotext,matplotlib,matplotlib-terminal}
85+
Set the plotting backend
86+
--data-source {tensorboard,csv}
87+
Set the plotting data source
88+
-m, --matplotlib Alias of --backend matplotlib
89+
--csv Alias of --data-source csv
90+
--plotsize WIDTH,HEIGHT
91+
Manually set the size of each subplot, e.g., 50,20.
92+
-c, --consolidate Consolidate based on prefix. If -cc is given,
93+
everything will consolidated regardless of prefix
94+
--as-scatter Plot as scatter (instead of line plot)
6095
--canvas-color CANVAS_COLOR
6196
set the color of the plot canvas (the area where the
6297
data is plotted)
@@ -67,18 +102,44 @@ optional arguments:
67102
--ticks-color TICKS_COLOR
68103
sets the (full-ground) color of the axes ticks and of
69104
the grid lines.
105+
--grid Show grid.
70106
--colorless Remove color.
71107
-d, --dark-theme A collection of flags. If set, it is equivalent to
72108
setting canvas-color and axes-color to black, and
73109
setting ticks-color to red. Can be overwritten
74110
individually.
75-
--grid Show grid.
76-
--plotsize WIDTH,HEIGHT
77-
Manually set the size of each subplot, e.g., 50,20.
78-
--force-label Force showing label even for plot with one series.
79111
--no-iter-color Stop iterating through different colors per plot.
80-
-c, --consolidate Consolidate based on prefix.
112+
--force-label Force showing label even for plot with one series.
81113
-f, --follow Run in a loop to update display periodic.
82114
-n secs, --interval secs
83115
seconds to wait between updates
116+
-w keyword [keyword ...], --whitelist keyword [keyword ...]
117+
Keyword that the stat must contain for it to be
118+
plotted, case sensitive.
119+
-b keyword [keyword ...], --blacklist keyword [keyword ...]
120+
Keyword that the stat must not contain for it to be
121+
plotted, case sensitive.
122+
-x XAXIS_TYPE, --xaxis-type XAXIS_TYPE
123+
Set value type to be used for x-axis. Tensorboard only
124+
supports 'step' or 'time' as x-axis.
125+
--xlog [row,col ...] Set the list of subplots to use log scale in x-axis
126+
--ylog [row,col ...] Set the list of subplots to use log scale in y-axis
127+
--xsymlog [row,col ...]
128+
Set the list of subplots to use symlog scale in x-axis
129+
--ysymlog [row,col ...]
130+
Set the list of subplots to use symlog scale in y-axis
131+
--xlim row,col=min,max [row,col=min,max ...]
132+
Set the list of xlim for the specified subplot.
133+
--ylim row,col=min,max [row,col=min,max ...]
134+
Set the list of ylim for the specified subplot.
135+
--as-raw-bytes Writes the raw image bytes to stdout.
136+
-s [0-1], --smooth [0-1]
137+
A value from 0 to 1 as a smoothing factor.
138+
--smooth-poly-order poly-order
139+
Polynomial order for the savgol smoothing algorithm.
140+
--terminal-width TERMINAL_WIDTH
141+
Manually set the terminal width.
142+
--terminal-height TERMINAL_HEIGHT
143+
Manually set the terminal height.
144+
84145
```

setup.py

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,52 @@
1-
from setuptools import setup
1+
import re
22
from os import path
33

4+
from setuptools import setup
5+
46
# read the contents of README file
57
this_directory = path.abspath(path.dirname(__file__))
68
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
79
long_description = f.read()
810

11+
# read the version file
12+
VERSIONFILE = "termplot/_version.py"
13+
verstrline = open(VERSIONFILE, "rt").read()
14+
mo = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", verstrline, re.M)
15+
if not mo:
16+
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
17+
version_str = mo.group(1)
18+
919
setup(
10-
name="tensorboard-termplot",
11-
version="1.3.2",
12-
description="View tensorboard stats inside terminal.",
20+
name="terminal-plot",
21+
version=version_str,
22+
description="View plotted stats directly inside terminal.",
1323
long_description=long_description,
1424
long_description_content_type="text/markdown",
1525
author="Tin Lai (@soraxas)",
1626
author_email="[email protected]",
1727
license="MIT",
18-
url="https://github.com/soraxas/tensorboard-termplot",
19-
keywords="tui tensorboard termplot stats",
28+
url="https://github.com/soraxas/termplot",
29+
keywords="tui termplot stats tensorboard csv",
2030
python_requires=">=3.6",
21-
packages=["tensorboard_termplot", "tensorboard_termplot.backend", "tensorboard_termplot.data_source"],
22-
install_requires=["tensorboard>=2.5", "plotext==4.0", "mock", "pillow", "pandas", "numpy", "scipy"],
23-
extras_require={"matplotlib-backend": ["matplotlib"]},
31+
packages=[
32+
"termplot",
33+
"termplot.backend",
34+
"termplot.data_source",
35+
],
36+
install_requires=[
37+
"tensorboard>=2.5",
38+
"plotext==4.0",
39+
"mock",
40+
"pandas",
41+
"numpy",
42+
"scipy",
43+
],
44+
extras_require={"matplotlib-backend": ["matplotlib", "pillow"]},
2445
entry_points={
25-
"console_scripts": ["tensorboard-termplot=tensorboard_termplot.main:run"]
46+
"console_scripts": [
47+
"termplot=termplot.main:run",
48+
"terminal-plot=termplot.main:run",
49+
]
2650
},
2751
classifiers=[
2852
"Environment :: Console",

termplot/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "1.3.3"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tensorboard_termplot/data_source/csv_source.py renamed to termplot/data_source/csv_source.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import numpy as np
66
import pandas as pd
77

8-
from tensorboard_termplot.data_source import DataSource, FigureData
9-
from tensorboard_termplot.main import EmptyEventFileError
8+
from termplot.data_source import DataSource, FigureData
9+
from termplot.main import EmptyEventFileError
1010

1111

1212
class CsvDataSource(DataSource):

0 commit comments

Comments
 (0)