Skip to content

Commit

Permalink
1.9 add plotting convenience function
Browse files Browse the repository at this point in the history
  • Loading branch information
HastingsGreer committed Jan 5, 2024
1 parent e8706e3 commit 121177f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = footsteps
version = 0.1.8
version = 0.1.9
author = Hastings Greer
author_email = [email protected]
description = a minimal experiment logging package
Expand Down
8 changes: 8 additions & 0 deletions src/footsteps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,11 @@ def __getattr__(name):
initialize()
return output_dir_impl
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")

num_plots = 0
def plot(name=""):
global num_plots
import matplotlib.pyplot as plt
plt.savefig(__getattr__("output_dir") + f"{num_plots:03d}_{name}.png")
plt.clf()
num_plots += 1

0 comments on commit 121177f

Please sign in to comment.