Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pyotb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Nicolas Narçon
pyotb
Commits
00e2dabf
Commit
00e2dabf
authored
1 year ago
by
Vincent Delbar
Browse files
Options
Downloads
Patches
Plain Diff
BUG: fixes
#123
parent
e819878d
No related branches found
No related tags found
1 merge request
!109
Fix for ignored uint8 pixel_type in write()
Pipeline
#14382
passed
1 year ago
Stage: Static Analysis
Stage: Tests
Stage: Documentation
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyotb/core.py
+1
-1
1 addition, 1 deletion
pyotb/core.py
tests/test_core.py
+10
-3
10 additions, 3 deletions
tests/test_core.py
with
11 additions
and
4 deletions
pyotb/core.py
+
1
−
1
View file @
00e2dabf
...
...
@@ -764,7 +764,7 @@ class App(OTBObject):
dtype: data type to use
"""
if
not
dtype
:
if
dtyp
e
is
Non
e
:
param
=
self
.
_settings
.
get
(
self
.
input_image_key
)
if
not
param
:
logger
.
warning
(
...
...
This diff is collapsed.
Click to expand it.
tests/test_core.py
+
10
−
3
View file @
00e2dabf
import
pytest
import
numpy
as
np
import
pyotb
from
tests_data
import
*
...
...
@@ -144,11 +145,17 @@ def test_xy_to_rowcol():
def
test_write
():
assert
INPUT
.
write
(
"
/dev/shm/test_write.tif
"
,
ext_fname
=
"
nodata=0
"
)
# Write string filepath
assert
INPUT
.
write
(
"
/dev/shm/test_write.tif
"
)
INPUT
[
"
out
"
].
filepath
.
unlink
()
# With Path filepath
assert
INPUT
.
write
(
Path
(
"
/dev/shm/test_write.tif
"
))
INPUT
[
"
out
"
].
filepath
.
unlink
()
assert
INPUT
.
write
(
Path
(
"
/dev/shm/test_write.tif
"
),
ext_fname
=
"
nodata=0
"
)
# Write to uint8
assert
INPUT
.
write
(
Path
(
"
/dev/shm/test_write.tif
"
),
pixel_type
=
"
uint8
"
)
assert
INPUT
[
"
out
"
].
dtype
==
"
uint8
"
INPUT
[
"
out
"
].
filepath
.
unlink
()
#
F
rozen
#
Write f
rozen
app
frozen_app
=
pyotb
.
BandMath
(
INPUT
,
exp
=
"
im1b1
"
,
frozen
=
True
)
assert
frozen_app
.
write
(
"
/dev/shm/test_frozen_app_write.tif
"
)
frozen_app
[
"
out
"
].
filepath
.
unlink
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment