Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
IMAGINE
Commits
61cc64d5
Commit
61cc64d5
authored
Mar 07, 2017
by
Theo Steininger
Browse files
Fixed Sample class: partial initialization (with Nones) works again.
parent
b2458cee
Changes
1
Hide whitespace changes
Inline
Side-by-side
imagine/sample.py
View file @
61cc64d5
...
...
@@ -14,11 +14,30 @@ from imagine.magnetic_fields import MagneticField
class
Sample
(
Loggable
,
Versionable
,
object
):
def
__init__
(
self
,
variables
=
None
,
magnetic_field
=
None
,
observables
=
None
,
likelihood
=
None
,
total_likelihood
=
None
):
self
.
variables
=
variables
self
.
magnetic_field
=
magnetic_field
self
.
observables
=
observables
self
.
likelihood
=
likelihood
self
.
total_likelihood
=
total_likelihood
if
variables
is
not
None
:
self
.
variables
=
variables
else
:
self
.
_variables
=
None
if
magnetic_field
is
not
None
:
self
.
magnetic_field
=
magnetic_field
else
:
self
.
_magnetic_field
=
None
if
observables
is
not
None
:
self
.
observables
=
observables
else
:
self
.
_observables
=
None
if
likelihood
is
not
None
:
self
.
likelihood
=
likelihood
else
:
self
.
_likelihood
=
None
if
total_likelihood
is
not
None
:
self
.
total_likelihood
=
total_likelihood
else
:
self
.
_total_likelihood
=
None
@
property
def
variables
(
self
):
...
...
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