Skip to content

Commit f0f4b5c

Browse files
committed
Add some more handling of options
1 parent 0cb621c commit f0f4b5c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/python/visclaw/plotpages.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,7 +2617,6 @@ def plotclaw2html(plotdata):
26172617
html.write('<html><meta http-equiv="expires" content="0">\n')
26182618
html.write('<title>Plots</title>')
26192619
html.write('<body><center>\n')
2620-
breakpoint()
26212620
html.write('\n<h3>Gauge %i ' % gaugeno)
26222621
if numfigs > 1:
26232622
html.write(' &nbsp;---&nbsp; %s' % fignames[figno] )
@@ -2960,13 +2959,20 @@ def plotclaw_driver(plotdata, verbose=False, format='ascii'):
29602959
# Gauges:
29612960
# -------
29622961
if os.path.exists(os.path.join(plotdata.outdir,"gauges.data")):
2963-
if plotdata.print_gaugenos.lower() == 'none':
2962+
if isinstance(plotdata.print_gaugenos, str):
2963+
if plotdata.print_gaugenos.lower() == 'all':
2964+
setgauges = gaugetools.read_setgauges(plotdata.outdir)
2965+
gaugenos = setgauges.gauge_numbers
2966+
elif plotdata.print_gaugenos.lower() == 'none':
2967+
plotdata.print_gaugenos = []
2968+
gaugenos = []
2969+
else:
2970+
raise ValueError(f"Unknown option {plotdata.print_gaguenos}" +
2971+
"given for print_gaugenos.")
2972+
elif not plotdata.print_gaugenos:
2973+
# Handle None, also handles False, but not True
29642974
plotdata.print_gaugenos = []
2965-
gaugenos = plotdata.print_gaugenos
2966-
if gaugenos == 'all':
2967-
# Read gauge numbers from setgauges.data if it exists:
2968-
setgauges = gaugetools.read_setgauges(plotdata.outdir)
2969-
gaugenos = setgauges.gauge_numbers
2975+
gaugenos = []
29702976

29712977
plotdata.gauges_gaugenos = gaugenos
29722978
plotdata.gauges_fignos = fignos_each_gauge

0 commit comments

Comments
 (0)