Skip to content

Commit f88d2fc

Browse files
committed
Fix some linting issues #869
1 parent 30d10bd commit f88d2fc

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

docs/conf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
# All configuration values have a default; values that are commented out
1414
# serve to show the default.
1515

16+
import datetime
17+
import os
18+
import sys
19+
1620
# If extensions (or modules to document with autodoc) are in another directory,
1721
# add these directories to sys.path here. If the directory is relative to the
1822
# documentation root, use os.path.abspath to make it absolute, like shown here.
19-
#
20-
import os
21-
import sys
22-
import datetime
2323

2424
sys.path.insert(0, os.path.abspath('.'))
2525
sys.path.insert(0, os.path.abspath('../'))
@@ -45,6 +45,7 @@
4545
]
4646

4747
import sphinx_autodoc_typehints
48+
4849
# Add any paths that contain templates here, relative to this directory.
4950
templates_path = ['_templates']
5051

docs/cookbook/sampling.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ but rather want to extract a result at specific locations.
66
Examples include extracting training data for model calibration, or computing the result for
77
areas where validation data is available.
88

9-
An important constraint is that most implementations assume that sampling is an operation
10-
on relatively small areas, of for instance up to 512x512 pixels (but often much smaller).
9+
An important constraint is that most implementations assume that sampling is an operation
10+
on relatively small areas, of for instance up to 512x512 pixels (but often much smaller).
1111
When extracting polygons with larger areas, it is recommended to look into running a separate job per 'sample'.
12-
Some more important performance notices are mentioned later in the chapter, please read them carefully
12+
Some more important performance notices are mentioned later in the chapter, please read them carefully
1313
to get best results.
1414

1515
Sampling can be done for points or polygons:
@@ -23,9 +23,9 @@ public url, and to load it in openEO using {py:meth}`openeo.rest.connection.Conn
2323

2424
## Sampling at point locations
2525

26-
To sample point locations, the `openeo.rest.datacube.DataCube.aggregate_spatial` method can be used. The reducer can be a
26+
To sample point locations, the `openeo.rest.datacube.DataCube.aggregate_spatial` method can be used. The reducer can be a
2727
commonly supported reducer like `min`, `max` or `mean` and will receive only one value as input in most cases. Note that
28-
in edge cases, a point can intersect with up to 4 pixels. If this is not desirable, it might be worth trying to align
28+
in edge cases, a point can intersect with up to 4 pixels. If this is not desirable, it might be worth trying to align
2929
points with pixel centers, which does require more advanced knowledge of the pixel grid of your data cube.
3030

3131
More information on `aggregate_spatial` is available [here](_aggregate-spatial-evi).

examples/archive/udf/udf_modify_spatial.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import numpy as np
12
import xarray
3+
4+
from openeo.metadata import CollectionMetadata
25
from openeo.udf import XarrayDataCube
36
from openeo.udf.debug import inspect
4-
from openeo.metadata import CollectionMetadata
5-
import numpy as np
7+
68

79
def apply_metadata(input_metadata:CollectionMetadata, context:dict) -> CollectionMetadata:
810

@@ -41,4 +43,4 @@ def apply_datacube(cube: XarrayDataCube, context: dict) -> XarrayDataCube:
4143
predicted_cube = xarray.DataArray(predicted_array, dims=['bands', 'x', 'y'], coords=dict(x=coord_x, y=coord_y))
4244

4345

44-
return XarrayDataCube(predicted_cube)
46+
return XarrayDataCube(predicted_cube)

openeo/udf/udf_signatures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"""
77
# Note: this module was initially developed under the ``openeo-udf`` project (https://github.com/Open-EO/openeo-udf)
88

9-
from deprecated import deprecated
109
import xarray
10+
from deprecated import deprecated
1111
from pandas import Series
1212

1313
from openeo.metadata import CollectionMetadata

0 commit comments

Comments
 (0)