Skip to content

Commit

Permalink
A few convenience properties
Browse files Browse the repository at this point in the history
  • Loading branch information
markgw committed Oct 9, 2020
1 parent 50a2f5f commit 6b508e0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/python/pimlico/datatypes/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class PlotOutput(NamedFileCollection):
Contains the dataset being plotted, a script to build the plot, and the output PDF.
Also supplies additional datatypes to point to the individual files.
"""
datatype_supports_python2 = True

Expand Down Expand Up @@ -44,6 +42,18 @@ def plot(self):
else:
self.task_complete("write_plot.pdf")

@property
def data_path(self):
return self.get_absolute_path("data.csv")

@property
def code_path(self):
return self.get_absolute_path("plot.py")

@property
def plot_path(self):
return self.get_absolute_path("plot.pdf")

def __exit__(self, exc_type, exc_val, exc_tb):
incomplete = self.incomplete_tasks
if "write_plot.pdf" in incomplete and "write_plot.py" not in incomplete and "write_data.csv" not in incomplete:
Expand Down

0 comments on commit 6b508e0

Please sign in to comment.