Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-ws-static
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Maintenance scheduled for Thursday, April 10, from 5 PM to 6 PM ET.
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-ws-static
Commits
102c8cf4
Commit
102c8cf4
authored
4 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
add netcdf file name arg
parent
cc084b0b
No related branches found
No related tags found
1 merge request
!53
Convert to NetCDF
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/python/gov/usgs/earthquake/nshmp/netcdf/application_inputs.py
+10
-6
10 additions, 6 deletions
...on/gov/usgs/earthquake/nshmp/netcdf/application_inputs.py
with
10 additions
and
6 deletions
src/main/python/gov/usgs/earthquake/nshmp/netcdf/application_inputs.py
+
10
−
6
View file @
102c8cf4
...
...
@@ -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_d
b_dir
(
db_
dir
=
value
))
if
key
==
"
db_dir
"
or
key
==
"
netcdf_filename
"
:
setattr
(
inputs
,
key
,
ApplicationInputs
.
_check_d
ir
(
dir
=
value
))
else
:
setattr
(
inputs
,
key
,
value
)
return
inputs
@staticmethod
def
_check_d
b_dir
(
db_
dir
:
str
)
->
Path
:
if
d
b_dir
.
startswith
(
"
~
"
)
:
db_dir
=
db_dir
.
replace
(
"
~
"
,
str
(
Path
.
home
()))
def
_check_d
ir
(
dir
:
str
)
->
Path
:
if
d
ir
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
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment