Skip to content

Commit

Permalink
Updated to plotting in CI. Added standalone plotting script for offli…
Browse files Browse the repository at this point in the history
…ne use.
  • Loading branch information
dustinswales committed May 24, 2024
1 parent f478ee6 commit 3bbce31
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions test/cmp_scmout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env python

##############################################################################
#
# This script compares SCM RT output to baselines.
#
##############################################################################
import os
import sys
from os.path import exists
import argparse
from plot_scm_out import plot_results

#
parser = argparse.ArgumentParser()
parser.add_argument('-fbl', '--file_bl', help='File containing SCM RT baselines', required=True)
parser.add_argument('-frt', '--file_rt', help='File containing SCM RT output')

#
def parse_args():
args = parser.parse_args()
file_rt = args.file_rt
file_bl = args.file_bl
return (file_bl, file_rt)

#
def main():
#
(file_bl, file_rt) = parse_args()

plot_files = plot_results(file_bl, file_rt)

# Put plots in local directory (scm_plots/)
result = os.system("mkdir -p scm_plots/")
com = "mv"
for plot_file in plot_files:
com = com + " " + plot_file
# end for
result = os.system(com+" scm_plots/")

# Housekeeping
if file_rt is not None:
result = os.system('tar -cvf scm_out_abs.tar scm_plots/*.png')
result = os.system('tar -cvf /scratch1/data_untrusted/Dustin.Swales/scm_out_abs.tar scm_plots/*.png')
else:
result = os.system('tar -cvf scm_out_diff.tar scm_plots/*.png')
result = os.system('tar -cvf /scratch1/data_untrusted/Dustin.Swales/scm_out_diff.tar scm_plots/*.png')
# end if
result = os.system('rm -rf scm_plots/')
#
if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion test/plot_scm_out.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def plot_results(file_bl, file_rt=None, vars2plt=None):

# Which fields to plot? (default is subset of full fields)
if vars2plt is None:
vars2plot = vars2plot_DEBUG
vars2plot = vars2plot_SUB
else:
vars2plot = vars2plt
# end if
Expand Down

0 comments on commit 3bbce31

Please sign in to comment.