Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Neel Shah
NIFTy
Commits
0acc9ff7
Commit
0acc9ff7
authored
May 27, 2021
by
Martin Reinecke
Browse files
Merge branch 'typo_in_docs' into 'NIFTy_7'
Typo in docs See merge request
ift/nifty!625
parents
f296d547
c98f82cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sugar.py
View file @
0acc9ff7
...
@@ -592,11 +592,11 @@ def calculate_position(operator, output):
...
@@ -592,11 +592,11 @@ def calculate_position(operator, output):
def
is_operator
(
obj
):
def
is_operator
(
obj
):
"""Check
s
if object is operator-like.
"""Check if object is operator-like.
Note
Note
----
----
A simple `isinstance(obj, ift.Operator)` does give the expected
A simple `isinstance(obj, ift.Operator)` does
not
give the expected
result because, e.g., :class:`~nifty7.field.Field` inherits from
result because, e.g., :class:`~nifty7.field.Field` inherits from
:class:`~nifty7.operators.operator.Operator`.
:class:`~nifty7.operators.operator.Operator`.
"""
"""
...
@@ -604,19 +604,20 @@ def is_operator(obj):
...
@@ -604,19 +604,20 @@ def is_operator(obj):
def
is_linearization
(
obj
):
def
is_linearization
(
obj
):
"""Check
s
if object is linearization-like."""
"""Check if object is linearization-like."""
return
isinstance
(
obj
,
Operator
)
and
obj
.
jac
is
not
None
return
isinstance
(
obj
,
Operator
)
and
obj
.
jac
is
not
None
def
is_fieldlike
(
obj
):
def
is_fieldlike
(
obj
):
"""Check
s
if object is field-like.
"""Check if object is field-like.
Note
Note
----
----
A simple `isinstance(obj, ift.Field)` does give the expected
A simple `isinstance(obj, ift.Field)` does
not
give the expected
result because users might have implemented another class which
result because users might have implemented another class which
behaves field-like but is not an instance of
behaves field-like but is not an instance of
:class:`~nifty7.field.Field`. Also not that instances of
:class:`~nifty7.field.Field`. Instances of
:class:`~nifty7.linearization.Linearization` behave field-like.
:class:`~nifty7.linearization.Linearization` are considered to be
field-like.
"""
"""
return
isinstance
(
obj
,
Operator
)
and
obj
.
val
is
not
None
return
isinstance
(
obj
,
Operator
)
and
obj
.
val
is
not
None
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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