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
Commits
62b4b816
Commit
62b4b816
authored
6 years ago
by
Colm Talbot
Browse files
Options
Downloads
Patches
Plain Diff
change prior printing to logging
parent
02b1ca4a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
peyote/prior.py
+10
-10
10 additions, 10 deletions
peyote/prior.py
with
10 additions
and
10 deletions
peyote/prior.py
+
10
−
10
View file @
62b4b816
...
...
@@ -332,9 +332,9 @@ class FromFile(Interped):
xx
,
yy
=
np
.
genfromtxt
(
self
.
id
).
T
Interped
.
__init__
(
self
,
xx
=
xx
,
yy
=
yy
,
minimum
=
minimum
,
maximum
=
maximum
,
name
=
name
,
latex_label
=
latex_label
)
except
IOError
:
pr
in
t
(
"
Can
'
t load {}.
"
.
format
(
self
.
id
))
pr
in
t
(
"
Format should be:
"
)
pr
in
t
(
r
"
x\tp(x)
"
)
logging
.
warn
in
g
(
"
Can
'
t load {}.
"
.
format
(
self
.
id
))
logging
.
warn
in
g
(
"
Format should be:
"
)
logging
.
warn
in
g
(
r
"
x\tp(x)
"
)
def
fix
(
prior
,
value
=
None
):
...
...
@@ -389,8 +389,8 @@ def parse_floats_to_fixed_priors(old_parameters):
for
key
in
parameters
:
if
type
(
parameters
[
key
])
is
not
float
and
type
(
parameters
[
key
])
is
not
int
\
and
type
(
parameters
[
key
])
is
not
Prior
:
print
(
"
Expected parameter
"
+
str
(
key
)
+
"
to be a float or int but was
"
+
str
(
type
(
parameters
[
key
]))
+
"
instead. Will not be converted.
"
)
logging
.
info
(
"
Expected parameter
"
+
str
(
key
)
+
"
to be a float or int but was
"
+
str
(
type
(
parameters
[
key
]))
+
"
instead. Will not be converted.
"
)
continue
elif
type
(
parameters
[
key
])
is
Prior
:
continue
...
...
@@ -424,10 +424,10 @@ def fill_priors(prior, waveform_generator):
continue
elif
isinstance
(
prior
[
key
],
float
)
or
isinstance
(
prior
[
key
],
int
):
prior
[
key
]
=
DeltaFunction
(
prior
[
key
])
print
(
"
{} converted to delta function prior.
"
.
format
(
key
))
logging
.
info
(
"
{} converted to delta function prior.
"
.
format
(
key
))
else
:
pr
in
t
(
"
{} cannot be converted to delta function prior.
"
.
format
(
key
))
pr
in
t
(
"
If required the default prior will be used.
"
)
logging
.
warn
in
g
(
"
{} cannot be converted to delta function prior.
"
.
format
(
key
))
logging
.
warn
in
g
(
"
If required the default prior will be used.
"
)
bad_keys
.
append
(
key
)
missing_keys
=
set
(
waveform_generator
.
parameters
)
-
set
(
prior
.
keys
())
...
...
@@ -435,8 +435,8 @@ def fill_priors(prior, waveform_generator):
for
missing_key
in
missing_keys
:
prior
[
missing_key
]
=
create_default_prior
(
missing_key
)
if
prior
[
missing_key
]
is
None
:
pr
in
t
(
"
No default prior found for unspecified variable {}.
"
.
format
(
missing_key
))
pr
in
t
(
"
This variable will NOT be sampled.
"
)
logging
.
warn
in
g
(
"
No default prior found for unspecified variable {}.
"
.
format
(
missing_key
))
logging
.
warn
in
g
(
"
This variable will NOT be sampled.
"
)
bad_keys
.
append
(
missing_key
)
for
key
in
bad_keys
:
...
...
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