Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Michael Williams
bilby
Commits
e6276945
Commit
e6276945
authored
Feb 12, 2019
by
Gregory Ashton
Browse files
Move default args into a property to avoid calling at init
parent
26822050
Changes
1
Hide whitespace changes
Inline
Side-by-side
bilby/gw/prior.py
View file @
e6276945
...
...
@@ -17,12 +17,14 @@ except ImportError:
class
Cosmological
(
Interped
):
_default_args_dict
=
dict
(
redshift
=
dict
(
name
=
'redshift'
,
latex_label
=
'$z$'
,
unit
=
None
),
luminosity_distance
=
dict
(
name
=
'luminosity_distance'
,
latex_label
=
'$d_L$'
,
unit
=
'Mpc'
),
comoving_distance
=
dict
(
name
=
'comoving_distance'
,
latex_label
=
'$d_C$'
,
unit
=
'Mpc'
))
@
property
def
_default_args_dict
(
self
):
return
dict
(
redshift
=
dict
(
name
=
'redshift'
,
latex_label
=
'$z$'
,
unit
=
None
),
luminosity_distance
=
dict
(
name
=
'luminosity_distance'
,
latex_label
=
'$d_L$'
,
unit
=
units
.
Mpc
),
comoving_distance
=
dict
(
name
=
'comoving_distance'
,
latex_label
=
'$d_C$'
,
unit
=
units
.
Mpc
))
def
__init__
(
self
,
minimum
,
maximum
,
cosmology
=
None
,
name
=
None
,
latex_label
=
None
,
unit
=
None
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment