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
3490f7e2
There was a problem fetching the pipeline summary.
Commit
3490f7e2
authored
6 years ago
by
Gregory Ashton
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git.ligo.org:Monash/tupak
parents
704c1ab4
25852946
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tupak/prior.py
+10
-10
10 additions, 10 deletions
tupak/prior.py
with
10 additions
and
10 deletions
tupak/prior.py
+
10
−
10
View file @
3490f7e2
...
...
@@ -70,9 +70,9 @@ class Prior(object):
raise
ValueError
(
"
Number to be rescaled should be in [0, 1]
"
)
def
__repr__
(
self
):
return
self
.
subclass_repr_helper
()
return
self
.
_
subclass_repr_helper
()
def
subclass_repr_helper
(
self
,
subclass_args
=
list
()):
def
_
subclass_repr_helper
(
self
,
subclass_args
=
list
()):
prior_name
=
self
.
__class__
.
__name__
args
=
[
'
name
'
,
'
latex_label
'
,
'
minimum
'
,
'
maximum
'
]
args
.
extend
(
subclass_args
)
...
...
@@ -169,7 +169,7 @@ class DeltaFunction(Prior):
return
0
def
__repr__
(
self
):
return
Prior
.
subclass_repr_helper
(
self
,
subclass_args
=
[
'
peak
'
])
return
Prior
.
_
subclass_repr_helper
(
self
,
subclass_args
=
[
'
peak
'
])
class
PowerLaw
(
Prior
):
...
...
@@ -209,7 +209,7 @@ class PowerLaw(Prior):
return
self
.
alpha
*
np
.
log
(
val
)
*
np
.
log
(
normalising
)
*
in_prior
def
__repr__
(
self
):
return
Prior
.
subclass_repr_helper
(
self
,
subclass_args
=
[
'
alpha
'
])
return
Prior
.
_
subclass_repr_helper
(
self
,
subclass_args
=
[
'
alpha
'
])
class
Uniform
(
PowerLaw
):
...
...
@@ -256,7 +256,7 @@ class Cosine(Prior):
return
np
.
cos
(
val
)
/
2
*
in_prior
def
__repr__
(
self
,
subclass_keys
=
list
(),
subclass_names
=
list
()):
return
Prior
.
subclass_repr_helper
(
self
)
return
Prior
.
_
subclass_repr_helper
(
self
)
class
Sine
(
Prior
):
...
...
@@ -279,7 +279,7 @@ class Sine(Prior):
return
np
.
sin
(
val
)
/
2
*
in_prior
def
__repr__
(
self
,
subclass_keys
=
list
(),
subclass_names
=
list
()):
return
Prior
.
subclass_repr_helper
(
self
)
return
Prior
.
_
subclass_repr_helper
(
self
)
class
Gaussian
(
Prior
):
...
...
@@ -308,7 +308,7 @@ class Gaussian(Prior):
return
-
0.5
*
((
self
.
mu
-
val
)
**
2
/
self
.
sigma
**
2
+
np
.
log
(
2
*
np
.
pi
*
self
.
sigma
**
2
))
def
__repr__
(
self
):
return
Prior
.
subclass_repr_helper
(
self
,
subclass_args
=
[
'
mu
'
,
'
sigma
'
])
return
Prior
.
_
subclass_repr_helper
(
self
,
subclass_args
=
[
'
mu
'
,
'
sigma
'
])
class
TruncatedGaussian
(
Prior
):
...
...
@@ -344,7 +344,7 @@ class TruncatedGaussian(Prior):
2
*
np
.
pi
)
**
0.5
/
self
.
sigma
/
self
.
normalisation
*
in_prior
def
__repr__
(
self
):
return
Prior
.
subclass_repr_helper
(
self
,
subclass_args
=
[
'
mu
'
,
'
sigma
'
])
return
Prior
.
_
subclass_repr_helper
(
self
,
subclass_args
=
[
'
mu
'
,
'
sigma
'
])
class
Interped
(
Prior
):
...
...
@@ -376,7 +376,7 @@ class Interped(Prior):
return
rescaled
def
__repr__
(
self
):
return
Prior
.
subclass_repr_helper
(
self
,
subclass_args
=
[
'
xx
'
,
'
yy
'
])
return
Prior
.
_
subclass_repr_helper
(
self
,
subclass_args
=
[
'
xx
'
,
'
yy
'
])
@property
def
minimum
(
self
):
...
...
@@ -430,7 +430,7 @@ class FromFile(Interped):
logging
.
warning
(
r
"
x\tp(x)
"
)
def
__repr__
(
self
,
subclass_keys
=
list
(),
subclass_names
=
list
()):
return
Prior
.
subclass_repr_helper
(
self
,
subclass_args
=
[
'
xx
'
,
'
yy
'
,
'
id
'
])
return
Prior
.
_
subclass_repr_helper
(
self
,
subclass_args
=
[
'
xx
'
,
'
yy
'
,
'
id
'
])
class
UniformComovingVolume
(
FromFile
):
...
...
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