General fix up of priors
Things this MR will include
-
Make a PriorSet
class which is a dictionary containing the priors -
Add a method to read in a PriorSet
from file -
Move the BBH default priors to a text file which is read in to a super PriorSet
of default priors -
Allow users to choose there default priors file (or a default will be chosen, maybe even based on the source model?) -
Ensure thatgw
andcore
don't overlap anymore
@colm.talbot @paul-lasky @moritz.huebner feel free to chip in (and anyone else of course).
Merge request reports
Activity
added 2 commits
added 13 commits
-
2b45350c...c319118b - 12 commits from branch
master
- 46640420 - Merge branch 'master' into updating-priors
-
2b45350c...c319118b - 12 commits from branch
mentioned in issue #61 (closed)
I'm done with this now. It doesn't change any functionality, but should make it easier in future if we want other default priors etc. Any objections to merging this in @colm.talbot @moritz.huebner ?
Things to do
- Create a
PriorSet
(class containing all thePrior
s) - Updates
Uniform
prior to not use thePowerLaw
. This printed analpha=0
parameter which broke reading in priors (and is also confusing).
- Create a
I like the idea of using
.prior
files, shall we make the prior print tolabel.prior
? We could also add a catch of adding.prior
to the givenfilename
.I've touched up the
LogUniform
prior, this is how I would have rewritten theUniform
prior (it doesn't printalpha=-1
), but your way definitely works.I've added
sample
andrescale
functions to thePriorSet
. I think we can use the rescaling in the sampler if we convert the given prior to aPriorSet
.I'm happy to merge at this stage although I'm going to keep working on this branch for the following reasons.
I'd really like to make the
core
independent of thegw
. I think there are only a few things we need to do.-
Remove the GW specific default latex labels from
core
, this method can be overwritten ingw
. -
Move the
binary_black_holes.prior
fromcore
togw
? -
Have an empty
PriorSet.test_redundancy
which just does nothing which can be overwritten by whichever prior set you like, this will naturally be done by defining a subclass ofPriorSet
ingw/prior.py
. -
Make
create_default_prior
require the second argument.
I'm happy to take over and do these things.
-
Okay fine by me if you take over (either merge and create a new MR or continue on this one). A few minor comments
-
I think we should passively use the
.prior
filetype. There's no reason to insist that people name them.prior
, it should just as well readprior.txt
(but all the ones we write can be.prior
to make it clear?) -
We could move move everything currently in
core/prior_files
togw/prior_files
(or something similar). We'd also need to fix thesetup.py
file to see this, but its all gw-specific. -
Definitely like the idea of an empty
test_redundancy
. -
I'm not at all tied to the way I implemented
Uniform
, it was just the first thing that came to my mind. If you prefer to have everything be done in some consistent fashion that is fine, it just needs the printed version to be executable (i.e. when you read it back in from the string it makes the same Prior type with the same prior args).
-
assigned to @colm.talbot
mentioned in commit 68a2b920
mentioned in merge request !59 (merged)