Skip to content

Commit

Permalink
Overwrite analysis inputs file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GuiMacielPereira committed Jan 15, 2025
1 parent ade7d8f commit af0485e
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/mvesuvio/util/handle_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ def setup_config_dir(config_dir):


def setup_default_inputs():
if not os.path.isfile(VESUVIO_INPUTS_PATH):
copyfile(
_ = copyfile(
os.path.join(VESUVIO_PACKAGE_PATH, "config", VESUVIO_INPUTS_FILE),
os.path.join(VESUVIO_INPUTS_PATH),
)
Expand All @@ -107,15 +106,13 @@ def setup_default_ipfile_dir():
)


def __mk_dir(type, path):
success = False
if not os.path.isdir(path):
try:
os.makedirs(path)
success = True
except:
print(f"Unable to make {type} directory at location: {path}")
return success
def __mk_dir(type:str, path: str):
try:
os.makedirs(path, exist_ok=True)
return True
except:
print(f"Unable to make {type} directory at location: {path}")
return False


def config_set():
Expand Down

0 comments on commit af0485e

Please sign in to comment.