min and max as properties for interpolated prior
This MR makes minimum and maximum values of interpolated priors variable. You can initialise the prior and then change them later, e.g., if you decide you want to extend the default distance prior.
The code isn't hugely pretty, anyone want to take a look? @moritz.huebner @gregory.ashton
Merge request reports
Activity
added 5 commits
- 1d1bab0d - Moritz Huebner: made minimum/maximum np.nan by default and simplified the…
- 55259c8e - Moritz Huebner: Extracted some redundant code into a separate method
- d800d8b0 - Moritz Huebner: Extracted some redundant code into a separate method
- 6277bf2e - Moritz Huebner: Added call to super class
- b597140e - Moritz Huebner: Added call to super class
Toggle commit list@colm.talbot Ok I pushed some changes and it should look a bit better now. I got rid of all the code redundancies. I am still not sure about the
if '_Interped__maximum' in self.__dict__ and self.__maximum < np.inf:
check. I feel the first part of that could possibly be avoided. However, I am not sure what the proper logic should look like.
Edited by Moritz Huebneradded 1 commit
- 3bc78be1 - make __repr__ of interpolated priors more intuitive
Thanks for this @moritz.huebner. I've just pushed a few changes to the
__repr__
function for these priors so that the printed string is exactly the command you use to instantiate the prior.There's an issue with the latex label for the other priors. I think it's due to it being a property rather than an attribute, I don't think it's necessary for this to be dynamic. Can we just have the following?
Class Prior(object): ... def __init__(..., latex_label=None,...): ... if latex_label is None: self.latex_label = self.__default_latex_label() else: self.latex_label = latex_label
Edited by Colm Talbotassigned to @moritz.huebner
@colm.talbot I tried to reproduce the error but I was not sure what you exactly meant. Does it actually cause an error or does the repr output not look like what you expect?
I actually thought about implementing some logic into the Prior class that assures that maximum > minimum using properties, so we may want to think about how to solve that issue with properties and repr anyway.
added 44 commits
-
3bc78be1...733a52e6 - 43 commits from branch
master
- 8db9b393 - Merge remote-tracking branch 'origin/master' into allow_interpolated_prior_to_change
-
3bc78be1...733a52e6 - 43 commits from branch
mentioned in commit 54abacb0