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
335a3c52
Commit
335a3c52
authored
May 22, 2019
by
Daniel Scheffler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix.
Signed-off-by:
Daniel Scheffler
<
danschef@gfz-potsdam.de
>
parent
c249500e
Pipeline
#4003
passed with stages
in 1 minute and 44 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
geoarray/baseclasses.py
geoarray/baseclasses.py
+1
-1
geoarray/version.py
geoarray/version.py
+2
-2
tests/test_geoarray.py
tests/test_geoarray.py
+15
-0
No files found.
geoarray/baseclasses.py
View file @
335a3c52
...
...
@@ -866,7 +866,7 @@ class GeoArray(object):
arr
=
arr
[:,
:,
np
.
newaxis
]
# 3D -> 2D
if
1
in
arr
.
shape
:
if
1
in
arr
.
shape
and
len
(
getitem_params
)
!=
1
:
outshape
=
[]
for
i
,
sh
in
enumerate
(
arr
.
shape
):
if
sh
==
1
and
isinstance
(
getitem_params
[
i
],
(
int
,
np
.
integer
,
float
,
np
.
floating
)):
...
...
geoarray/version.py
View file @
335a3c52
__version__
=
'0.8.1
8
'
__versionalias__
=
'201905
14
.01'
__version__
=
'0.8.1
9
'
__versionalias__
=
'201905
22
.01'
tests/test_geoarray.py
View file @
335a3c52
...
...
@@ -346,6 +346,21 @@ class Test_GeoarrayAppliedOnPathArray(unittest.TestCase):
self
.
assertEqual
(
inmem_res
.
ndim
,
notinmem_res
.
ndim
)
self
.
assertEqual
(
inmem_res
.
shape
,
notinmem_res
.
shape
)
def
test___getitem__consistency_3d_array_1_column
(
self
):
testarr
=
np
.
array
([[
1
,
2
],
[
3
,
4
]]).
reshape
(
2
,
1
,
2
)
gA_inmem
=
GeoArray
(
testarr
)
inmem_res
=
gA_inmem
[:]
with
tempfile
.
TemporaryDirectory
()
as
tf
:
gA_inmem
.
save
(
os
.
path
.
join
(
tf
,
'test.bsq'
))
gA_notinmem
=
GeoArray
(
os
.
path
.
join
(
tf
,
'test.bsq'
))
notinmem_res
=
gA_notinmem
[:]
self
.
assertEqual
(
inmem_res
.
ndim
,
notinmem_res
.
ndim
)
self
.
assertEqual
(
inmem_res
.
shape
,
notinmem_res
.
shape
)
def
test___getitem__consistency_2d_array
(
self
):
testarr
=
np
.
zeros
((
2
,
2
))
testarr
[:,
:]
=
[[
11
,
12
],
[
13
,
14
]]
...
...
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