Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
lscsoft
bilby
Merge requests
!303
Resolve "Prior read in from file chokes on empty lines"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Prior read in from file chokes on empty lines"
265-prior-read-in-from-file-chokes-on-empty-lines
into
master
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Colm Talbot
requested to merge
265-prior-read-in-from-file-chokes-on-empty-lines
into
master
6 years ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
Closes
#265 (closed)
Edited
6 years ago
by
Colm Talbot
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
e07b6241
1 commit,
6 years ago
1 file
+
7
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
bilby/core/prior.py
+
7
−
2
Options
@@ -66,12 +66,17 @@ class PriorDict(OrderedDict):
----------
filename: str
Name of the file to be read in
Notes
-----
Lines beginning with
'
#
'
or empty lines will be ignored.
"""
prior
=
{}
comments
=
[
'
#
'
,
'
\n
'
]
prior
=
dict
()
with
open
(
filename
,
'
r
'
)
as
f
:
for
line
in
f
:
if
line
[
0
]
==
'
#
'
:
if
line
[
0
]
in
comments
:
continue
elements
=
line
.
split
(
'
=
'
)
key
=
elements
[
0
].
replace
(
'
'
,
''
)
Loading