Skip to content
Snippets Groups Projects
Commit 102c8cf4 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

add netcdf file name arg

parent cc084b0b
No related branches found
No related tags found
1 merge request!53Convert to NetCDF
......@@ -23,6 +23,7 @@ class ApplicationInputs:
self.clean_ascii = False
self.db_dir = Path(_DEFAULT_DB_DIR)
self.download_only = False
self.netcdf_filename = None
self.__setattr__(Nshm.NSHM_2008.name, False)
self.__setattr__(Nshm.NSHM_2014.name, False)
self.__setattr__(Nshm.NSHM_2014A.name, False)
......@@ -60,16 +61,19 @@ class ApplicationInputs:
for key, value in args.items():
if hasattr(inputs, key):
if key == "db_dir":
setattr(inputs, key, ApplicationInputs._check_db_dir(db_dir=value))
if key == "db_dir" or key == "netcdf_filename":
setattr(inputs, key, ApplicationInputs._check_dir(dir=value))
else:
setattr(inputs, key, value)
return inputs
@staticmethod
def _check_db_dir(db_dir: str) -> Path:
if db_dir.startswith("~"):
db_dir = db_dir.replace("~", str(Path.home()))
def _check_dir(dir: str) -> Path:
if dir is None:
return None
return Path(os.path.abspath(db_dir))
if dir.startswith("~"):
dir = dir.replace("~", str(Path.home()))
return Path(os.path.abspath(dir))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment