Skip to content

Commit 264005d

Browse files
Figure title, less verbose
1 parent 2a252c1 commit 264005d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "git-lines-graph"
3-
version = "2.2.0"
3+
version = "2.3.0"
44
description = "Git commit lines graph"
55
readme = "README.md"
66
license = "GPL-3.0-or-later"

src/git_lines_graph/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import argparse
22
import os
3+
import logging
34

45
import git
56
import matplotlib as mpl
67
import matplotlib.pyplot as plt
78
import pandas as pd
89

10+
logging.getLogger("matplotlib").setLevel(logging.ERROR)
11+
912

1013
def main():
1114
parser = argparse.ArgumentParser()
@@ -22,7 +25,7 @@ def main():
2225

2326
try:
2427
repo = git.Repo(args.git_dir, search_parent_directories=True)
25-
except git.exc.InvalidGitRepositoryError as e:
28+
except git.exc.InvalidGitRepositoryError:
2629
print("Not part of a valid git project: {}".format(args.git_dir))
2730
exit()
2831

@@ -34,11 +37,12 @@ def main():
3437
data = pd.DataFrame(data, columns=["date", "add", "remove"])
3538
data["delta"] = data["add"] - data["remove"]
3639
data["total"] = data.delta.cumsum()
37-
data.date = pd.to_datetime(data.date)
40+
data.date = pd.to_datetime(data.date, utc=True)
3841
data.set_index(["date"], inplace=True)
3942

4043
with plt.xkcd():
41-
plt.figure("Code Lines Progress in project {}".format(os.path.basename(repo.working_tree_dir)))
44+
plt.figure()
45+
plt.title("Code Lines Progress in project {}".format(os.path.basename(repo.working_tree_dir)), pad=10)
4246
plt.ylabel("# of lines")
4347
ax = data["total"].plot()
4448
ax.yaxis.set_major_formatter(mpl.ticker.StrMethodFormatter("{x:,.0f}"))

0 commit comments

Comments
 (0)