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
ift
NIFTy
Commits
4fa63fe3
Commit
4fa63fe3
authored
Nov 12, 2019
by
Philipp Haim
Browse files
Merge sugar.get_default_codomain from Independent_SLAmplitudes
parent
7b2f7e8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/sugar.py
View file @
4fa63fe3
...
...
@@ -424,14 +424,17 @@ def get_default_codomain(domainoid, space=None):
codomain. `domain[space]` must be of class `RGSpace`.
"""
from
.domains.rg_space
import
RGSpace
from
.domains.hp_space
import
HPSpace
from
.domains.gl_space
import
GLSpace
from
.domains.lm_space
import
LMSpace
if
isinstance
(
domainoid
,
RGSpace
):
return
domainoid
.
get_default_codomain
()
if
not
isinstance
(
domainoid
,
DomainTuple
):
raise
TypeError
(
'Works only on RGSpaces and DomainTuples containing those'
)
space
=
utilities
.
infer_space
(
domainoid
,
space
)
if
not
isinstance
(
domainoid
[
space
],
RGSpace
):
raise
TypeError
(
"can only codomain
RGS
paces"
)
if
not
isinstance
(
domainoid
[
space
],
(
RGSpace
,
HPSpace
,
GLSpace
,
LMSpace
)
):
raise
TypeError
(
"can only codomain
structrued s
paces"
)
ret
=
[
dom
for
dom
in
domainoid
]
ret
[
space
]
=
domainoid
[
space
].
get_default_codomain
()
return
DomainTuple
.
make
(
ret
)
...
...
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