Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
lscsoft
bilby_pipe
Commits
b9122c3e
Commit
b9122c3e
authored
Jul 27, 2020
by
Avi Vajpeyi
👽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add notification
parent
d27a5068
Pipeline
#143232
passed with stage
in 8 minutes and 59 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
1 deletion
+47
-1
bilby_pipe/job_creation/node.py
bilby_pipe/job_creation/node.py
+1
-1
bilby_pipe/main.py
bilby_pipe/main.py
+16
-0
bilby_pipe/parser.py
bilby_pipe/parser.py
+20
-0
tests/main_test.py
tests/main_test.py
+10
-0
No files found.
bilby_pipe/job_creation/node.py
View file @
b9122c3e
...
...
@@ -18,7 +18,7 @@ class Node(object):
self
.
request_disk
=
None
self
.
online_pe
=
self
.
inputs
.
online_pe
self
.
getenv
=
True
self
.
notification
=
False
self
.
notification
=
inputs
.
notification
self
.
retry
=
None
self
.
verbose
=
0
self
.
extra_lines
=
list
(
self
.
inputs
.
extra_lines
)
...
...
bilby_pipe/main.py
View file @
b9122c3e
...
...
@@ -63,6 +63,7 @@ class MainInput(Input):
self
.
webdir
=
args
.
webdir
self
.
email
=
args
.
email
self
.
notification
=
args
.
notification
self
.
existing_dir
=
args
.
existing_dir
self
.
scheduler
=
args
.
scheduler
...
...
@@ -143,6 +144,21 @@ class MainInput(Input):
raise
FileNotFoundError
(
"No ini file {} found"
.
format
(
ini
))
self
.
_ini
=
os
.
path
.
relpath
(
ini
)
@
property
def
notification
(
self
):
return
self
.
_notification
@
notification
.
setter
def
notification
(
self
,
notification
):
valid_settings
=
[
"Always"
,
"Complete"
,
"Error"
,
"Never"
]
if
notification
in
valid_settings
:
self
.
_notification
=
notification
else
:
raise
BilbyPipeError
(
"'{}' is not a valid notification setting. "
"Valid settings are {}."
.
format
(
notification
,
valid_settings
)
)
@
property
def
initialdir
(
self
):
return
os
.
getcwd
()
...
...
bilby_pipe/parser.py
View file @
b9122c3e
...
...
@@ -648,6 +648,26 @@ def create_parser(top_level=True):
"--create-summary"
,
action
=
"store_true"
,
help
=
"Create a PESummary page"
)
output_parser
.
add
(
"--email"
,
type
=
nonestr
,
help
=
"Email for notifications"
)
output_parser
.
add
(
"--notification"
,
type
=
nonestr
,
default
=
"Never"
,
help
=
(
"Notification setting for HTCondor jobs. "
"One of 'Always','Complete','Error','Never'. "
"If defined by 'Always', "
"the owner will be notified whenever the job "
"produces a checkpoint, as well as when the job completes. "
"If defined by 'Complete', "
"the owner will be notified when the job terminates. "
"If defined by 'Error', "
"the owner will only be notified if the job terminates abnormally, "
"or if the job is placed on hold because of a failure, "
"and not by user request. "
"If defined by 'Never' (the default), "
"the owner will not receive e-mail, regardless to what happens to the job. "
),
)
output_parser
.
add
(
"--existing-dir"
,
type
=
nonestr
,
...
...
tests/main_test.py
View file @
b9122c3e
...
...
@@ -75,6 +75,16 @@ class TestMainInput(unittest.TestCase):
memory
=
"{} GB"
.
format
(
self
.
args
.
request_memory_generation
)
self
.
assertEqual
(
inputs
.
request_memory_generation
,
memory
)
def
test_notification_set
(
self
):
self
.
args
.
notification
=
"Always"
inputs
=
bilby_pipe
.
main
.
MainInput
(
self
.
args
,
[])
self
.
assertEqual
(
inputs
.
notification
,
"Always"
)
def
test_notification_error_riased_set
(
self
):
self
.
args
.
notification
=
"Sometimes"
with
self
.
assertRaises
(
BilbyPipeError
):
bilby_pipe
.
main
.
MainInput
(
self
.
args
,
[])
def
test_label
(
self
):
self
.
assertEqual
(
self
.
inputs
.
label
,
self
.
args
.
label
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment