Commit 1ff121c6 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed some type hints.

parent 283d2ff7
Pipeline #3180 passed with stages
in 18 minutes and 24 seconds
......@@ -73,7 +73,7 @@ class MinimumDistance_Classifier(_ImageClassifier):
class kNN_Classifier(_ImageClassifier):
def __init__(self, train_spectra, train_labels, CPUs=1, n_neighbors=10):
# type: (np.ndarray, Union[np.ndarray, List[int]], int) -> None
# type: (np.ndarray, Union[np.ndarray, List[int]], int, int) -> None
super(kNN_Classifier, self).__init__(train_spectra, train_labels, CPUs=CPUs)
self.clf = KNeighborsClassifier(n_neighbors=n_neighbors, n_jobs=CPUs)
......
......@@ -176,7 +176,7 @@ def get_list_GMSfiles(dataset_list, target):
def SRF_reader(GMS_id, no_thermal=None, no_pan=None, v=False):
# type: (GMS_identifier, bool) -> collections.OrderedDict
# type: (GMS_identifier, bool, bool, bool) -> collections.OrderedDict
"""Read SRF for any sensor and return a dictionary containing band names as keys and SRF numpy arrays as values.
:param GMS_id:
......@@ -217,7 +217,7 @@ def SRF_reader(GMS_id, no_thermal=None, no_pan=None, v=False):
class SRF(object):
def __init__(self, GMS_id=None, wvl_unit='nanometers', specres_nm=1, format_bandnames=False,
no_thermal=None, no_pan=None, v=False):
# type: (GMS_identifier, str, float, bool, bool) -> None
# type: (GMS_identifier, str, float, bool, bool, bool, bool) -> None
"""SRF instance provides SRF functions, wavelength positions, etc..
:param GMS_id: GMS_identifier as provided by GMS_object
......
......@@ -315,7 +315,7 @@ def increment_decrement_arrayCol_in_postgreSQLdb(conn_params, tablename, col2upd
def create_record_in_postgreSQLdb(conn_params, tablename, vals2write_dict, timeout=15000):
# type: (str, str, dict, dict, int) -> Union[int, str]
# type: (str, str, dict, int) -> Union[int, str]
"""Creates a single new record in a postgreSQL database and pupulates its columns with the given values.
:param conn_params: <str> connection parameters as provided by CFG.conn_params
......@@ -345,7 +345,7 @@ def create_record_in_postgreSQLdb(conn_params, tablename, vals2write_dict, timeo
def delete_record_in_postgreSQLdb(conn_params, tablename, record_id, timeout=15000):
# type: (str, str, dict, dict, int) -> Union[int, str]
# type: (str, str, dict, int) -> Union[int, str]
"""Delete a single record in a postgreSQL database.
:param conn_params: <str> connection parameters as provided by CFG.conn_params
......
......@@ -1188,7 +1188,7 @@ class GMS_object(object):
@classmethod
def from_tiles(cls, list_GMS_tiles):
# type: (list) -> cls
# type: (list) -> GMS_object
"""Merge separate GMS objects with different spatial coverage but belonging to the same scene-ID to ONE GMS object.
:param list_GMS_tiles: <list> of GMS objects that have been created by cut_GMS_obj_into_blocks()
......@@ -1254,7 +1254,7 @@ class GMS_object(object):
def get_subset_obj(self, imBounds=None, mapBounds=None, mapBounds_prj=None, out_prj=None, logmsg=None,
progress=False, v=False):
# type: (tuple) -> self
# type: (tuple, tuple, str, str, str, bool, bool) -> GMS_object
"""Returns a subset of the given GMS object, based on the given bounds coordinates.
Array attributes are clipped and relevant metadata keys are updated according to new extent.
......@@ -1626,7 +1626,7 @@ class GMS_object(object):
self.MetaObj.to_odict(), overwrite=overwrite)
def to_tiles(self, blocksize=(2048, 2048)):
# type: (tuple) -> self
# type: (tuple) -> GMS_object
"""Returns a generator object where items represent tiles of the given block size for the GMS object.
# NOTE: it's better to call get_subset_obj (also takes care of tile map infos)
......@@ -1646,7 +1646,7 @@ class GMS_object(object):
yield tileObj
def to_MGRS_tiles(self, pixbuffer=10, v=False):
# type: (int) -> self
# type: (int, bool) -> GMS_object
"""Returns a generator object where items represent the MGRS tiles for the GMS object.
:param pixbuffer: <int> a buffer in pixel values used to generate an overlap between the returned MGRS tiles
......@@ -2319,7 +2319,7 @@ class failed_GMS_object(GMS_object):
class finished_GMS_object(GMS_object):
def __init__(self, GMS_obj):
# type: (GMS_obj) -> None
# type: (GMS_object) -> None
super(finished_GMS_object, self).__init__()
self.proc_level = GMS_obj.proc_level
self.image_type = GMS_obj.image_type
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment