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
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
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
07fc9bc8
Commit
07fc9bc8
authored
Sep 07, 2017
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
857bb932
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
nifty2go/nifty_utilities.py
nifty2go/nifty_utilities.py
+2
-9
No files found.
nifty2go/nifty_utilities.py
View file @
07fc9bc8
...
...
@@ -65,7 +65,6 @@ def get_slice_list(shape, axes):
yield
slice_list
else
:
yield
[
slice
(
None
,
None
)]
return
def
cast_axis_to_tuple
(
axis
,
length
=
None
):
...
...
@@ -152,20 +151,14 @@ def bincount_axis(obj, minlength=None, weights=None, axis=None):
# compute the local bincount results
# -> prepare the local result array
if
weights
is
None
:
result_dtype
=
np
.
int
else
:
result_dtype
=
np
.
float
result_dtype
=
np
.
int
if
weights
is
None
else
np
.
float
local_counts
=
np
.
empty
(
flat_shape
[:
-
1
]
+
(
length
,
),
dtype
=
result_dtype
)
# iterate over all entries in the surviving axes and compute the local
# bincounts
for
slice_list
in
get_slice_list
(
flat_shape
,
axes
=
(
len
(
flat_shape
)
-
1
,
)):
if
weights
is
not
None
:
current_weights
=
weights
[
slice_list
]
else
:
current_weights
=
None
current_weights
=
None
if
weights
is
None
else
weights
[
slice_list
]
local_counts
[
slice_list
]
=
np
.
bincount
(
data
[
slice_list
],
weights
=
current_weights
,
...
...
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