Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
gwinc
pygwinc
Commits
05370968
Commit
05370968
authored
Jan 05, 2021
by
Jameson Rollins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cli: fix issue with out file handing extension parsing
parent
26aed9d0
Pipeline
#180791
passed with stages
in 6 minutes and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
gwinc/__main__.py
gwinc/__main__.py
+8
-6
No files found.
gwinc/__main__.py
View file @
05370968
...
...
@@ -181,16 +181,15 @@ def main():
print
(
fmt
.
format
(
k
,
v
,
ov
))
return
out_files
=
set
(
args
.
save
)
out_data_files
=
set
()
out_plot_files
=
set
()
if
args
.
save
:
if
out_files
:
args
.
plot
=
False
for
path
in
args
.
save
:
for
path
in
out_files
:
if
os
.
path
.
splitext
(
path
)[
1
]
in
io
.
DATA_SAVE_FORMATS
:
out_data_files
.
add
(
path
)
else
:
parser
.
exit
(
2
,
"Save file extension not specified.
\n
"
)
out_plot_files
=
set
(
args
.
save
)
-
out_data_files
out_plot_files
=
out_files
-
out_data_files
if
args
.
plot
or
out_plot_files
:
if
out_plot_files
:
...
...
@@ -338,7 +337,10 @@ In [.]: plt.savefig("foo.pdf")
if
out_plot_files
:
for
path
in
out_plot_files
:
logger
.
info
(
"saving budget plot: {}"
.
format
(
path
))
fig
.
savefig
(
path
)
try
:
fig
.
savefig
(
path
)
except
Exception
as
e
:
parser
.
exit
(
2
,
f
"Error saving plot:
{
e
}
.
\n
"
)
else
:
plt
.
show
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment