Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Commit

Permalink
load plots in the order that they were saved in (partly #51)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed May 11, 2016
1 parent 5062b31 commit ba49da4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions shapeout/tlabwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def _ImportDumped(self, indexname):
# import configurations
datadict = dfn.LoadConfiguration(indexname, capitalize=False)
keys = list(datadict.keys())
# The identifier (in brackets []) contains a number before the first
# underscore "_" which determines the order of the plots:
keys.sort(key=lambda x: int(x.split("_")[0]))
for key in keys:
data = datadict[key]
name = data["name"]
Expand All @@ -91,6 +94,7 @@ def _ImportDumped(self, indexname):
mm.UpdateConfiguration(cfg)
self.measurements.append(mm)


def DumpData(self, directory, fullout=False):
""" Dumps all the data from the analysis to a `directory`
Expand All @@ -106,8 +110,12 @@ def DumpData(self, directory, fullout=False):
for mm in self.measurements:
i += 1
ident = "{}_{}".format(i,mm.name)
# the directory in the session zip file where all information
# will be stored:
mmdir = os.path.join(directory, ident)
while True:
# If the directory already exists, append a number to that
# directory to distinguish different measurements.
g=0
if os.path.exists(mmdir):
mmdir = mmdir+str(g)
Expand Down

0 comments on commit ba49da4

Please sign in to comment.