Commits

Panagiotis Mavrogiorgos committed fd87670

Added some syntactic sugar (more funtions).

  • Participants
  • Parent commits 8c72935

Comments (0)

Files changed (1)

     # If not invoked then all subsequent prints will contain the previous ones.
     plt.close()
 
-def save_cycle(db, path, cycle):
-    """
-    Syntactic sugar for saving all the data for a specific cycle.
+def save_cycle_all(db, path, cycle):
+    save_data(db, "Ss", path, cycle = cycle, png = True, pdf = True)
+    save_data(db, "Sc", path, cycle = cycle, png = True, pdf = True)
+    save_data(db, "t", path, cycle = cycle, png = True, pdf = True)
+    save_data(db, "tred", path, cycle = cycle, png = True, pdf = True)
+    save_data(db, "es", path, cycle = cycle, png = True, pdf = True)
+    save_data(db, "ec", path, cycle = cycle, png = True, pdf = True)
+    save_data(db, "s", path, cycle = cycle, png = True, pdf = True)
 
-    db : dictionary
-    path : sting
-    cycle : integer
-    """
-    save_data(db, "Ss", path, cycle)
-    save_data(db, "Sc", path, cycle)
-    save_data(db, "t", path, cycle)
-    save_data(db, "tred", path, cycle)
-    save_data(db, "es", path, cycle)
-    save_data(db, "ec", path, cycle)
-    save_data(db, "s", path, cycle)
+def save_cycle_png(db, path, cycle):
+    save_data(db, "Ss", path, cycle = cycle, png = True)
+    save_data(db, "Sc", path, cycle = cycle, png = True)
+    save_data(db, "t", path, cycle = cycle, png = True)
+    save_data(db, "tred", path, cycle = cycle, png = True)
+    save_data(db, "es", path, cycle = cycle, png = True)
+    save_data(db, "ec", path, cycle = cycle, png = True)
+    save_data(db, "s", path, cycle = cycle, png = True)
+
+def save_cycle_pdf(db, path, cycle):
+    save_data(db, "Ss", path, cycle = cycle, pdf = True)
+    save_data(db, "Sc", path, cycle = cycle, pdf = True)
+    save_data(db, "t", path, cycle = cycle, pdf = True)
+    save_data(db, "tred", path, cycle = cycle, pdf = True)
+    save_data(db, "es", path, cycle = cycle, pdf = True)
+    save_data(db, "ec", path, cycle = cycle, pdf = True)
+    save_data(db, "s", path, cycle = cycle, pdf = True)
+
+def save_cumulative_all(db, path):
+    save_data(db, "Ss", path, cycle = 0, png = True, pdf = True)
+    save_data(db, "Sc", path, cycle = 0, png = True, pdf = True)
+    save_data(db, "t", path, cycle = 0, png = True, pdf = True)
+    save_data(db, "tred", path, cycle = 0, png = True, pdf = True)
+    save_data(db, "es", path, cycle = 0, png = True, pdf = True)
+    save_data(db, "ec", path, cycle = 0, png = True, pdf = True)
+    save_data(db, "s", path, cycle = 0, png = True, pdf = True)
+
+def save_cumulative_png(db, path):
+    save_data(db, "Ss", path, cycle = 0, png = True)
+    save_data(db, "Sc", path, cycle = 0, png = True)
+    save_data(db, "t", path, cycle = 0, png = True)
+    save_data(db, "tred", path, cycle = 0, png = True)
+    save_data(db, "es", path, cycle = 0, png = True)
+    save_data(db, "ec", path, cycle = 0, png = True)
+    save_data(db, "s", path, cycle = 0, png = True)
+
+def save_cumulative_pdf(db, path):
+    save_data(db, "Ss", path, cycle = 0, pdf = True)
+    save_data(db, "Sc", path, cycle = 0, pdf = True)
+    save_data(db, "t", path, cycle = 0, pdf = True)
+    save_data(db, "tred", path, cycle = 0, pdf = True)
+    save_data(db, "es", path, cycle = 0, pdf = True)
+    save_data(db, "ec", path, cycle = 0, pdf = True)
+    save_data(db, "s", path, cycle = 0, pdf = True)
 
 def plot_bond(db, i, x_label="Slip (mm)", y_label = "Bond Stress (MPa)"):
     """