Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pyicon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Show more breadcrumbs
Nils Brüggemann
pyicon
Commits
9b3f8e9f
Commit
9b3f8e9f
authored
2 weeks ago
by
Nils Brüggemann
Browse files
Options
Downloads
Patches
Plain Diff
pyicon_params.py: Improved handling of params.
parent
eae70d9c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#100168
passed
2 weeks ago
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pyicon/params_default.json
+4
-0
4 additions, 0 deletions
pyicon/params_default.json
pyicon/pyicon_params.py
+6
-1
6 additions, 1 deletion
pyicon/pyicon_params.py
quickstart/00_do_all.sh
+1
-0
1 addition, 0 deletions
quickstart/00_do_all.sh
with
11 additions
and
1 deletion
pyicon/params_default.json
0 → 100644
+
4
−
0
View file @
9b3f8e9f
{
"path_grid"
:
"~/pyicon_data/grids/"
,
"path_example_data"
:
"~/pyicon_data/pyicon_example_data_download/"
}
This diff is collapsed.
Click to expand it.
pyicon/pyicon_params.py
+
6
−
1
View file @
9b3f8e9f
...
...
@@ -8,6 +8,7 @@ fname = os.path.join(os.path.dirname(__file__), 'params_default.json')
#else:
# print(f'File {fname} does not exist.')
try
:
print
(
f
"
Loading default parameters from
{
fname
}
.
"
)
with
open
(
fname
,
'
r
'
)
as
f
:
params_default
=
json
.
load
(
f
)
except
:
...
...
@@ -15,11 +16,12 @@ except:
HOME
=
os
.
path
.
expanduser
(
'
~
'
)
params_default
=
{
"
path_grid
"
:
f
"
{
HOME
}
/pyicon_data/grids/
"
,
"
path_example_data
"
:
f
"
{
HOME
}
/pyicon_data/
py
icon_example_data_download/
"
"
path_example_data
"
:
f
"
{
HOME
}
/pyicon_data/icon_example_data_download/
"
}
fname
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
params_user.json
'
)
if
os
.
path
.
isfile
(
fname
):
print
(
f
"
Loading user parameters from
{
fname
}
.
"
)
with
open
(
fname
,
'
r
'
)
as
f
:
params_user
=
json
.
load
(
f
)
else
:
...
...
@@ -30,3 +32,6 @@ try:
params
=
params_default
|
params_user
except
:
params
=
params_default
for
key
in
[
'
path_grid
'
,
'
path_example_data
'
]:
params
[
key
]
=
os
.
path
.
expanduser
(
params
[
key
])
\ No newline at end of file
This diff is collapsed.
Click to expand it.
quickstart/00_do_all.sh
+
1
−
0
View file @
9b3f8e9f
...
...
@@ -24,3 +24,4 @@ cp path_data.txt ${path_data}/pyicon_output/
./06_quickplots.sh
echo
"Output written to
${
source_dir
}
/swift.dkrz.de/example_data_r2b4/pyicon_output/"
echo
"All done!"
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