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
G
geoarray
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Daniel Scheffler
geoarray
Commits
f5241fee
Commit
f5241fee
authored
Sep 13, 2018
by
Daniel Scheffler
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored function name and updated docstring.
parent
56146895
Pipeline
#3200
passed with stages
in 1 minute and 41 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
geoarray/baseclasses.py
geoarray/baseclasses.py
+4
-4
No files found.
geoarray/baseclasses.py
View file @
f5241fee
...
...
@@ -826,8 +826,8 @@ class GeoArray(object):
# NOTE: # bandlist must be string because truth value of an array with more than one element is ambiguous
arr_pos
=
dict
(
rS
=
rS
,
rE
=
rE
,
cS
=
cS
,
cE
=
cE
,
bS
=
bS
,
bE
=
bE
,
bL
=
bL
)
def
_ensure_np_shape_3D_2D
(
arr
):
"""
Match numpy output shape
according to the given indexing parameters.
def
_ensure_np_shape_
consistency_
3D_2D
(
arr
):
"""
Ensure numpy output shape consistency
according to the given indexing parameters.
This may require 3D to 2D conversion in case out_arr can be represented by a 2D array AND index has been
provided as integer (avoids shapes like (1,2,2). It also may require 2D to 3D conversion in case only one
...
...
@@ -857,7 +857,7 @@ class GeoArray(object):
# check if the requested array position is already in cache -> if yes, return it from there
if
self
.
_arr_cache
is
not
None
and
self
.
_arr_cache
[
'pos'
]
==
arr_pos
:
out_arr
=
self
.
_arr_cache
[
'arr_cached'
]
out_arr
=
_ensure_np_shape_3D_2D
(
out_arr
)
out_arr
=
_ensure_np_shape_
consistency_
3D_2D
(
out_arr
)
else
:
# TODO insert a multiprocessing.Lock here in order to prevent IO bottlenecks?
...
...
@@ -886,7 +886,7 @@ class GeoArray(object):
del
ds
out_arr
=
_ensure_np_shape_3D_2D
(
out_arr
)
out_arr
=
_ensure_np_shape_
consistency_
3D_2D
(
out_arr
)
# only set self.arr if the whole cube has been read (in order to avoid sudden shape changes)
if
out_arr
.
shape
==
self
.
shape
:
...
...
Daniel Scheffler
@danschef
mentioned in issue
#18 (closed)
·
Sep 13, 2018
mentioned in issue
#18 (closed)
mentioned in issue #18
Toggle commit list
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