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
NIFTy
Commits
4a05f59b
Commit
4a05f59b
authored
Oct 22, 2019
by
Lukas Platz
Browse files
domain_tuple: add total_volume property
parent
156c9d79
Pipeline
#62398
passed with stages
in 7 minutes and 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/domain_tuple.py
View file @
4a05f59b
...
...
@@ -125,6 +125,13 @@ class DomainTuple(object):
"""
return
self
.
_size
@
property
def
total_volume
(
self
):
res
=
1.
for
d
in
self
.
_dom
:
res
*=
d
.
total_volume
return
res
@
property
def
axes
(
self
):
"""tuple of tuple of int : axis indices of the underlying domains"""
...
...
nifty5/field.py
View file @
4a05f59b
...
...
@@ -273,11 +273,13 @@ class Field(object):
float
the total volume of the requested sub-domain.
"""
if
spaces
is
None
:
return
self
.
_domain
.
total_volume
if
np
.
isscalar
(
spaces
):
return
self
.
_domain
[
spaces
].
total_volume
if
spaces
is
None
:
spaces
=
range
(
len
(
self
.
_domain
))
# tuple of spaces given
res
=
1.
for
i
in
spaces
:
res
*=
self
.
_domain
[
i
].
total_volume
...
...
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