Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
calibration
pycalibration
Commits
64109856
Commit
64109856
authored
3 years ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Allow for notebook with no markdown cells
parent
53c3bace
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!575
Refactor parsing arguments and loading main notebook
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/xfel_calibrate/calibrate.py
+5
-1
5 additions, 1 deletion
src/xfel_calibrate/calibrate.py
src/xfel_calibrate/nb_args.py
+1
-1
1 addition, 1 deletion
src/xfel_calibrate/nb_args.py
with
6 additions
and
2 deletions
src/xfel_calibrate/calibrate.py
+
5
−
1
View file @
64109856
...
@@ -57,6 +57,8 @@ def extract_title_author(nb):
...
@@ -57,6 +57,8 @@ def extract_title_author(nb):
"""
"""
first_md
=
first_markdown_cell
(
nb
)
first_md
=
first_markdown_cell
(
nb
)
if
first_md
is
None
:
return
None
,
None
source
=
first_md
[
"
source
"
]
source
=
first_md
[
"
source
"
]
title
=
re
.
findall
(
r
'
#+\s*(.*)\s*#+
'
,
source
)
title
=
re
.
findall
(
r
'
#+\s*(.*)\s*#+
'
,
source
)
author
=
re
.
findall
(
author
=
re
.
findall
(
...
@@ -375,7 +377,9 @@ def prepare_job(
...
@@ -375,7 +377,9 @@ def prepare_job(
params
=
parameter_values
(
params
,
cluster_profile
=
cluster_profile
)
params
=
parameter_values
(
params
,
cluster_profile
=
cluster_profile
)
new_nb
=
replace_definitions
(
nb
,
params
,
execute
=
False
,
lang
=
'
python
'
)
new_nb
=
replace_definitions
(
nb
,
params
,
execute
=
False
,
lang
=
'
python
'
)
if
not
show_title
:
if
not
show_title
:
first_markdown_cell
(
new_nb
).
source
=
''
title_cell
=
first_markdown_cell
(
new_nb
)
if
title_cell
is
not
None
:
title_cell
.
source
=
''
set_figure_format
(
new_nb
,
args
[
"
vector_figs
"
])
set_figure_format
(
new_nb
,
args
[
"
vector_figs
"
])
new_name
=
f
"
{
nb_path
.
stem
}
__
{
cparm
}
__
{
suffix
}
.ipynb
"
new_name
=
f
"
{
nb_path
.
stem
}
__
{
cparm
}
__
{
suffix
}
.ipynb
"
...
...
This diff is collapsed.
Click to expand it.
src/xfel_calibrate/nb_args.py
+
1
−
1
View file @
64109856
...
@@ -282,7 +282,7 @@ def make_epilog(nb, caltype=None):
...
@@ -282,7 +282,7 @@ def make_epilog(nb, caltype=None):
"""
"""
msg
=
""
msg
=
""
header_cell
=
first_markdown_cell
(
nb
)
header_cell
=
first_markdown_cell
(
nb
)
lines
=
header_cell
.
source
.
split
(
"
\n
"
)
lines
=
header_cell
.
source
.
split
(
"
\n
"
)
if
header_cell
is
not
None
else
[
''
]
if
caltype
:
if
caltype
:
msg
+=
"
{:<15} {}
"
.
format
(
caltype
,
lines
[
0
])
+
"
\n
"
msg
+=
"
{:<15} {}
"
.
format
(
caltype
,
lines
[
0
])
+
"
\n
"
else
:
else
:
...
...
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