Skip to content

Commit af0485e

Browse files
Overwrite analysis inputs file
This change quality of life of scientists because in order to update their analysis inputs file following a version update they no longer need to delete their entire config folder. The file will update in the existing config folder.
1 parent ade7d8f commit af0485e

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/mvesuvio/util/handle_config.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ def setup_config_dir(config_dir):
9191

9292

9393
def setup_default_inputs():
94-
if not os.path.isfile(VESUVIO_INPUTS_PATH):
95-
copyfile(
94+
_ = copyfile(
9695
os.path.join(VESUVIO_PACKAGE_PATH, "config", VESUVIO_INPUTS_FILE),
9796
os.path.join(VESUVIO_INPUTS_PATH),
9897
)
@@ -107,15 +106,13 @@ def setup_default_ipfile_dir():
107106
)
108107

109108

110-
def __mk_dir(type, path):
111-
success = False
112-
if not os.path.isdir(path):
113-
try:
114-
os.makedirs(path)
115-
success = True
116-
except:
117-
print(f"Unable to make {type} directory at location: {path}")
118-
return success
109+
def __mk_dir(type:str, path: str):
110+
try:
111+
os.makedirs(path, exist_ok=True)
112+
return True
113+
except:
114+
print(f"Unable to make {type} directory at location: {path}")
115+
return False
119116

120117

121118
def config_set():

0 commit comments

Comments
 (0)