Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cigale
CIGALE
Commits
a3aa09da
Commit
a3aa09da
authored
Sep 18, 2013
by
Yannick Roehlly
Browse files
Rename existing output dir in psum module
Also warn the user when an output was renamed.
parent
77d92d87
Changes
2
Hide whitespace changes
Inline
Side-by-side
pcigale/analysis_modules/psum.py
View file @
a3aa09da
...
...
@@ -17,11 +17,11 @@ and the best fitting model (the one with the least reduced χ²) is given.
"""
import
os
import
sys
import
atpy
import
json
import
numpy
as
np
from
collections
import
OrderedDict
from
datetime
import
datetime
from
copy
import
deepcopy
from
scipy
import
stats
from
progressbar
import
ProgressBar
...
...
@@ -129,13 +129,14 @@ class Module(common.AnalysisModule):
"""
# Create the output directory and stop it exists.
try
:
os
.
mkdir
(
OUT_DIR
)
except
OSError
:
print
(
"pcigale can't create the {} directory, maybe "
"it already exists."
.
format
(
OUT_DIR
))
sys
.
exit
()
if
os
.
path
.
exists
(
OUT_DIR
):
new_name
=
datetime
.
now
().
strftime
(
"%Y%m%d%H%M"
)
+
"_"
+
OUT_DIR
os
.
rename
(
OUT_DIR
,
new_name
)
print
(
"The existing {} directory was renamed to {}"
.
format
(
OUT_DIR
,
new_name
))
os
.
mkdir
(
OUT_DIR
)
# Open the warehouse
sed_warehouse
=
SedWarehouse
(
...
...
pcigale/analysis_modules/savefluxes.py
View file @
a3aa09da
...
...
@@ -85,6 +85,10 @@ class Module(common.AnalysisModule):
if
os
.
path
.
isfile
(
out_file
):
new_name
=
datetime
.
now
().
strftime
(
"%Y%m%d%H%M"
)
+
"_"
+
out_file
os
.
rename
(
out_file
,
new_name
)
print
(
"The existing {} file was renamed to {}"
.
format
(
out_file
,
new_name
))
# Get the filters in the database
filter_names
=
[
name
for
name
in
column_list
...
...
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