Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
1f5a6c6c
Commit
1f5a6c6c
authored
May 01, 2017
by
Theo Steininger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed infer_dtype in Field
parent
6c70837a
Pipeline
#11886
passed with stage
in 10 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
nifty/field.py
nifty/field.py
+7
-2
No files found.
nifty/field.py
View file @
1f5a6c6c
...
...
@@ -90,9 +90,11 @@ class Field(Loggable, Versionable, object):
try
:
dtype
=
val
.
dtype
except
AttributeError
:
if
val
is
not
None
:
try
:
if
val
is
None
:
raise
TypeError
dtype
=
np
.
result_type
(
val
)
else
:
except
(
TypeError
)
:
dtype
=
np
.
dtype
(
gc
[
'default_field_dtype'
])
else
:
dtype
=
np
.
dtype
(
dtype
)
...
...
@@ -307,6 +309,9 @@ class Field(Loggable, Versionable, object):
# check if the `spaces` input is valid
spaces
=
utilities
.
cast_axis_to_tuple
(
spaces
,
len
(
self
.
domain
))
if
spaces
is
None
:
spaces
=
range
(
len
(
self
.
domain
))
for
power_space_index
in
spaces
:
power_space
=
self
.
domain
[
power_space_index
]
if
not
isinstance
(
power_space
,
PowerSpace
):
...
...
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