Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
multi-area-model
Manage
Activity
Members
Labels
Plan
Issues
7
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IAS-6
multi-area-model
Commits
a544b473
Commit
a544b473
authored
7 years ago
by
Maximilian Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Catch sumatra not installed case
parent
7e37845f
No related branches found
No related tags found
1 merge request
!1
Add all necessary files for the multi-area model
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
multiarea_model/simulation.py
+10
-2
10 additions, 2 deletions
multiarea_model/simulation.py
start_jobs.py
+10
-2
10 additions, 2 deletions
start_jobs.py
with
20 additions
and
4 deletions
multiarea_model/simulation.py
+
10
−
2
View file @
a544b473
...
...
@@ -28,7 +28,11 @@ from .default_params import nested_update, sim_params
from
.default_params
import
check_custom_params
from
dicthash
import
dicthash
from
.multiarea_helpers
import
extract_area_dict
,
create_vector_mask
from
.sumatra_helpers
import
register_runtime
try
:
from
.sumatra_helpers
import
register_runtime
sumatra_found
=
True
except
ImportError
:
sumatra_found
=
False
class
Simulation
:
...
...
@@ -295,7 +299,11 @@ class Simulation:
json
.
dump
(
d
,
f
)
def
register_runtime
(
self
):
register_runtime
(
self
.
label
)
if
sumatra_found
:
register_runtime
(
self
.
label
)
else
:
raise
ImportWarning
(
'
Sumatra is not installed, so
'
'
cannot register the runtime.
'
)
class
Area
:
...
...
This diff is collapsed.
Click to expand it.
start_jobs.py
+
10
−
2
View file @
a544b473
...
...
@@ -4,7 +4,11 @@ import shutil
from
config
import
base_path
,
data_path
from
multiarea_model.default_params
import
nested_update
,
sim_params
from
multiarea_model.sumatra_helpers
import
register_record
try
:
from
multiarea_model.sumatra_helpers
import
register_record
sumatra_found
=
True
except
ImportError
:
sumatra_found
=
False
def
start_job
(
label
,
submit_cmd
,
jobscript_template
,
sumatra
=
False
,
reason
=
None
,
tag
=
None
):
...
...
@@ -70,7 +74,11 @@ def start_job(label, submit_cmd, jobscript_template, sumatra=False, reason=None,
# If chosen, register simulation to sumatra
if
sumatra
:
register_record
(
label
,
reason
=
reason
,
tag
=
tag
)
if
sumatra_found
:
register_record
(
label
,
reason
=
reason
,
tag
=
tag
)
else
:
raise
ImportWarning
(
'
Sumatra is not installed, so
'
'
cannot register simulation record.
'
)
# Submit job
os
.
system
(
'
{submit_cmd} {job_script_fn}
'
.
format
(
submit_cmd
=
submit_cmd
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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