From d168f9df06b9e843c7c4939825db22ea8d4622b9 Mon Sep 17 00:00:00 2001 From: Daniel Scheffler Date: Tue, 5 Mar 2019 14:35:44 +0100 Subject: [PATCH 1/4] Updated HISTORY.rst --- bin/enpt_cli.py | 3 +++ enpt/execution/controller.py | 4 ++-- enpt/model/images.py | 8 ++++---- enpt/model/metadata.py | 14 +++++++------- enpt/options/config.py | 10 ++++++---- enpt/options/options_default.json | 2 ++ enpt/options/options_schema.py | 2 ++ enpt/version.py | 4 ++-- tests/linting/pydocstyle.log | 32 +++++++++++++++---------------- 9 files changed, 44 insertions(+), 35 deletions(-) diff --git a/bin/enpt_cli.py b/bin/enpt_cli.py index eb890e5..20a6cec 100644 --- a/bin/enpt_cli.py +++ b/bin/enpt_cli.py @@ -42,6 +42,9 @@ def get_enpt_argparser(): help='input path of digital elevation model in map or sensor geometry; GDAL compatible file format ' '(must cover the EnMAP L1B data completely if given in map geometry or must have the same pixel ' 'dimensions like the EnMAP L1B data if given in sensor geometry)') + add('-dummyfmt', '--is_dummy_dataformat', type=bool, default=False, + help='Set to true in case of the preliminary, GFZ-internal dataformat as used for the Alpine test dataset. ' + '(default: False. Note: This will be removed in future.)') add('-ele', '--average_elevation', type=int, default=0, help='average elevation in meters above sea level; may be provided if no DEM is available; ' 'ignored if DEM is given') diff --git a/enpt/execution/controller.py b/enpt/execution/controller.py index a1001f2..a069b95 100644 --- a/enpt/execution/controller.py +++ b/enpt/execution/controller.py @@ -42,7 +42,7 @@ class EnPT_Controller(object): :param subdir: subdirectory name to be created within temporary directory :return: /tmp/tmpk2qp0yri/rootdir/ """ - outdir = os.path.join(self.tempDir, subdir) if self.cfg.is_dlr_dataformat else self.tempDir + outdir = os.path.join(self.tempDir, subdir) if not self.cfg.is_dummy_dataformat else self.tempDir with zipfile.ZipFile(path_zipfile, "r") as zf: zf.extractall(outdir) @@ -50,7 +50,7 @@ class EnPT_Controller(object): if not os.path.isdir(outdir): raise NotADirectoryError(outdir) - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: return outdir else: return os.path.join(self.tempDir, os.path.basename(path_zipfile).split('.zip')[0]) diff --git a/enpt/model/images.py b/enpt/model/images.py index 0984818..860edc8 100644 --- a/enpt/model/images.py +++ b/enpt/model/images.py @@ -445,7 +445,7 @@ class EnMAP_Detector_SensorGeo(_EnMAP_Image): :param n_lines: number of line to be added :return: None """ - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: basename_img1 = self.detector_meta.data_filename.split('-SPECTRAL_IMAGE')[0] + '::%s' % self.detector_name basename_img2 = img2.detector_meta.data_filename.split('-SPECTRAL_IMAGE')[0] + '::%s' % img2.detector_name else: @@ -489,7 +489,7 @@ class EnMAP_Detector_SensorGeo(_EnMAP_Image): self.detector_meta.nrows += n_lines # Create new corner coordinate - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: enmapIm_cornerCoords = tuple(zip(img2.detector_meta.lon_UL_UR_LL_LR, img2.detector_meta.lat_UL_UR_LL_LR)) dem_validated = DEM_Processor(img2.cfg.path_dem, @@ -532,7 +532,7 @@ class EnMAP_Detector_SensorGeo(_EnMAP_Image): # append the raster data self.data = np.append(self.data, img2.data[0:n_lines, :, :], axis=0) self.mask_clouds = np.append(self.mask_clouds, img2.mask_clouds[0:n_lines, :], axis=0) - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: self.deadpixelmap = np.append(self.deadpixelmap, img2.deadpixelmap[0:n_lines, :], axis=0) # TODO append remaining raster layers - additional cloud masks, ... @@ -620,7 +620,7 @@ class EnMAPL1Product_SensorGeo(object): self.logger = logger # Read metadata here in order to get all information needed by to get paths. - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: self.meta = EnMAP_Metadata_L1B_SensorGeo(glob(path.join(root_dir, "*METADATA.XML"))[0], config=self.cfg, logger=self.logger) else: diff --git a/enpt/model/metadata.py b/enpt/model/metadata.py index 299c403..38eb75b 100644 --- a/enpt/model/metadata.py +++ b/enpt/model/metadata.py @@ -77,7 +77,7 @@ class EnMAP_Metadata_L1B_Detector_SensorGeo(object): """ self.cfg = config self.detector_name = detector_name # type: str - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: self.detector_label = L1B_product_props_DLR['xml_detector_label'][detector_name] else: self.detector_label = L1B_product_props['xml_detector_label'][detector_name] @@ -125,7 +125,7 @@ class EnMAP_Metadata_L1B_Detector_SensorGeo(object): """ xml = ElementTree.parse(path_xml).getroot() - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: lbl = self.detector_label self.logger.info("Reading metadata for %s detector..." % self.detector_name) @@ -472,7 +472,7 @@ class EnMAP_Metadata_L1B_SensorGeo(object): self.metaxml_filename = os.path.basename(path_xml) - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: # read processing level self.proc_level = xml.find("base/level").text if self.proc_level != 'L1B': @@ -558,7 +558,7 @@ class EnMAP_Metadata_L1B_SensorGeo(object): """ xml = ElementTree.parse(self.path_xml).getroot() - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: for detName, detMeta in zip(['VNIR', 'SWIR'], [self.vnir, self.swir]): lbl = L1B_product_props_DLR['xml_detector_label'][detName] xml.find("product/image/%s/dimension/rows" % lbl).text = str(detMeta.nrows) @@ -611,7 +611,7 @@ class EnMAP_Metadata_L2A_MapGeo(object): self.earthSunDist = meta_l1b.earthSunDist # type: float # earth-sun distance # generate file names for L2A output - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: self.scene_basename = meta_l1b.vnir.data_filename.split('-SPECTRAL_IMAGE')[0].replace('L1B-', 'L2A-') else: self.scene_basename = os.path.splitext(meta_l1b.vnir.data_filename)[0] @@ -644,7 +644,7 @@ class EnMAP_Metadata_L2A_MapGeo(object): self.smile_coef = np.vstack([meta_l1b.vnir.smile_coef, meta_l1b.swir.smile_coef])[bandidx_order, :] self.smile = np.hstack([meta_l1b.vnir.smile, meta_l1b.swir.smile])[:, bandidx_order] - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: self.rpc_coeffs = OrderedDict(zip( ['band_%d' % (i + 1) for i in range(dims_mapgeo[2])], [meta_l1b.vnir.rpc_coeffs['band_%d' % (i + 1)] if 'band_%d' % (i + 1) in meta_l1b.vnir.rpc_coeffs else @@ -730,7 +730,7 @@ class EnMAP_Metadata_L2A_MapGeo(object): # parse (use L1B metadata as template) xml = ElementTree.parse(self._meta_l1b.path_xml, parser).getroot() - if not self.cfg.is_dlr_dataformat: + if self.cfg.is_dummy_dataformat: self.logger.warning('No XML metadata conversion implemented for datasets different to the DLR format.' 'Metadata XML file will be empty.') return '' diff --git a/enpt/options/config.py b/enpt/options/config.py index 14f0f8f..0913777 100644 --- a/enpt/options/config.py +++ b/enpt/options/config.py @@ -105,10 +105,12 @@ class EnPTConfig(object): # general options # ################### - try: - self.is_dlr_dataformat = gp('is_dlr_dataformat') - except: # noqa E722 # FIXME - self.is_dlr_dataformat = False + self.is_dummy_dataformat = gp('is_dummy_dataformat') + if 'is_dlr_dataformat' in user_opts: + warnings.warn("The 'is_dlr_dataformat' flag is deprectated and will not exist in future. " + "Please set 'is_dummy_dataformat' to False instead.", DeprecationWarning) + self.is_dummy_dataformat = user_opts['is_dlr_dataformat'] is False + self.CPUs = gp('CPUs', fallback=cpu_count()) self.log_level = gp('log_level') self.create_logfile = gp('create_logfile') diff --git a/enpt/options/options_default.json b/enpt/options/options_default.json index 474a279..b87685e 100644 --- a/enpt/options/options_default.json +++ b/enpt/options/options_default.json @@ -9,6 +9,8 @@ "path_dem": "", /*input path of digital elevation model in map or sensor geometry; GDAL compatible file format (must cover the EnMAP L1B data completely if given in map geometry or must have the same pixel dimensions like the EnMAP L1B data if given in sensor geometry)*/ + "is_dummy_dataformat": false, /*Set to true in case of the preliminary, GFZ-internal dataformat as used for the + Alpine test dataset. (default: False. Note: This will be removed in future.)*/ "average_elevation": 0, /*average elevation in meters above sea level; may be provided if no DEM is available; ignored if DEM is given*/ "path_l1b_snr_model": "./resources/EnMAP_Sensor/EnMAP_Level_1B_SNR.zip", /*input path of the EnMAP SNR model*/ diff --git a/enpt/options/options_schema.py b/enpt/options/options_schema.py index f10af6d..902659e 100644 --- a/enpt/options/options_schema.py +++ b/enpt/options/options_schema.py @@ -10,6 +10,7 @@ enpt_schema_input = dict( path_l1b_enmap_image=dict(type='string', required=False), path_l1b_enmap_image_gapfill=dict(type='string', required=False), path_dem=dict(type='string', required=False), + is_dummy_dataformat=dict(type='boolean', required=False), average_elevation=dict(type='integer', required=False), path_l1b_snr_model=dict(type='string', required=False), working_dir=dict(type='string', required=False, nullable=True), @@ -85,6 +86,7 @@ parameter_mapping = dict( path_l1b_enmap_image=('general_opts', 'path_l1b_enmap_image'), path_l1b_enmap_image_gapfill=('general_opts', 'path_l1b_enmap_image_gapfill'), path_dem=('general_opts', 'path_dem'), + is_dummy_dataformat=('general_opts', 'is_dummy_dataformat'), average_elevation=('general_opts', 'average_elevation'), path_l1b_snr_model=('general_opts', 'path_l1b_snr_model'), working_dir=('general_opts', 'working_dir'), diff --git a/enpt/version.py b/enpt/version.py index ec82885..a1b766c 100644 --- a/enpt/version.py +++ b/enpt/version.py @@ -1,2 +1,2 @@ -__version__ = '0.7.0' -__versionalias__ = '20180121.01' +__version__ = '0.7.1' +__versionalias__ = '20180305.01' diff --git a/tests/linting/pydocstyle.log b/tests/linting/pydocstyle.log index 6c091c5..ca71bb2 100644 --- a/tests/linting/pydocstyle.log +++ b/tests/linting/pydocstyle.log @@ -176,37 +176,37 @@ enpt/options/config.py:79 in public class `EnPTConfig`: D101: Missing docstring in public class enpt/options/config.py:80 in public method `__init__`: D202: No blank lines allowed after function docstring (found 1) -enpt/options/config.py:170 in public method `absPath`: +enpt/options/config.py:172 in public method `absPath`: D102: Missing docstring in public method -enpt/options/config.py:173 in public method `get_parameter`: +enpt/options/config.py:175 in public method `get_parameter`: D102: Missing docstring in public method -enpt/options/config.py:236 in public method `to_dict`: +enpt/options/config.py:238 in public method `to_dict`: D202: No blank lines allowed after function docstring (found 1) -enpt/options/config.py:250 in public method `to_jsonable_dict`: +enpt/options/config.py:252 in public method `to_jsonable_dict`: D102: Missing docstring in public method -enpt/options/config.py:261 in public method `__repr__`: +enpt/options/config.py:263 in public method `__repr__`: D105: Missing docstring in magic method -enpt/options/config.py:265 in public function `json_to_python`: +enpt/options/config.py:267 in public function `json_to_python`: D103: Missing docstring in public function -enpt/options/config.py:298 in public function `python_to_json`: +enpt/options/config.py:300 in public function `python_to_json`: D103: Missing docstring in public function -enpt/options/config.py:320 in public class `EnPTValidator`: +enpt/options/config.py:322 in public class `EnPTValidator`: D101: Missing docstring in public class -enpt/options/config.py:321 in public method `__init__`: +enpt/options/config.py:323 in public method `__init__`: D205: 1 blank line required between summary line and description (found 0) -enpt/options/config.py:321 in public method `__init__`: +enpt/options/config.py:323 in public method `__init__`: D400: First line should end with a period (not 'r') -enpt/options/config.py:329 in public method `validate`: +enpt/options/config.py:331 in public method `validate`: D102: Missing docstring in public method -enpt/options/config.py:334 in public function `get_options`: +enpt/options/config.py:336 in public function `get_options`: D202: No blank lines allowed after function docstring (found 1) enpt/options/__init__.py:1 at module level: D104: Missing docstring in public package -enpt/options/options_schema.py:128 in public function `get_updated_schema`: +enpt/options/options_schema.py:130 in public function `get_updated_schema`: D103: Missing docstring in public function -enpt/options/options_schema.py:129 in private nested function `deep_update`: +enpt/options/options_schema.py:131 in private nested function `deep_update`: D202: No blank lines allowed after function docstring (found 1) -enpt/options/options_schema.py:129 in private nested function `deep_update`: +enpt/options/options_schema.py:131 in private nested function `deep_update`: D400: First line should end with a period (not 'e') -enpt/options/options_schema.py:148 in public function `get_param_from_json_config`: +enpt/options/options_schema.py:150 in public function `get_param_from_json_config`: D103: Missing docstring in public function -- GitLab From 763a53f5ca056da57cecab0721f27f5e6293adb6 Mon Sep 17 00:00:00 2001 From: Daniel Scheffler Date: Tue, 5 Mar 2019 14:35:44 +0100 Subject: [PATCH 2/4] Replaced config flag 'is_dlr_dataformat' with falsified 'is_dummy_format' and exposed the flag to the CLI parser and the default options. --- bin/enpt_cli.py | 3 +++ enpt/execution/controller.py | 4 ++-- enpt/model/images.py | 8 ++++---- enpt/model/metadata.py | 14 +++++++------- enpt/options/config.py | 10 ++++++---- enpt/options/options_default.json | 2 ++ enpt/options/options_schema.py | 2 ++ enpt/version.py | 4 ++-- tests/linting/pydocstyle.log | 32 +++++++++++++++---------------- 9 files changed, 44 insertions(+), 35 deletions(-) diff --git a/bin/enpt_cli.py b/bin/enpt_cli.py index eb890e5..20a6cec 100644 --- a/bin/enpt_cli.py +++ b/bin/enpt_cli.py @@ -42,6 +42,9 @@ def get_enpt_argparser(): help='input path of digital elevation model in map or sensor geometry; GDAL compatible file format ' '(must cover the EnMAP L1B data completely if given in map geometry or must have the same pixel ' 'dimensions like the EnMAP L1B data if given in sensor geometry)') + add('-dummyfmt', '--is_dummy_dataformat', type=bool, default=False, + help='Set to true in case of the preliminary, GFZ-internal dataformat as used for the Alpine test dataset. ' + '(default: False. Note: This will be removed in future.)') add('-ele', '--average_elevation', type=int, default=0, help='average elevation in meters above sea level; may be provided if no DEM is available; ' 'ignored if DEM is given') diff --git a/enpt/execution/controller.py b/enpt/execution/controller.py index a1001f2..a069b95 100644 --- a/enpt/execution/controller.py +++ b/enpt/execution/controller.py @@ -42,7 +42,7 @@ class EnPT_Controller(object): :param subdir: subdirectory name to be created within temporary directory :return: /tmp/tmpk2qp0yri/rootdir/ """ - outdir = os.path.join(self.tempDir, subdir) if self.cfg.is_dlr_dataformat else self.tempDir + outdir = os.path.join(self.tempDir, subdir) if not self.cfg.is_dummy_dataformat else self.tempDir with zipfile.ZipFile(path_zipfile, "r") as zf: zf.extractall(outdir) @@ -50,7 +50,7 @@ class EnPT_Controller(object): if not os.path.isdir(outdir): raise NotADirectoryError(outdir) - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: return outdir else: return os.path.join(self.tempDir, os.path.basename(path_zipfile).split('.zip')[0]) diff --git a/enpt/model/images.py b/enpt/model/images.py index 0984818..860edc8 100644 --- a/enpt/model/images.py +++ b/enpt/model/images.py @@ -445,7 +445,7 @@ class EnMAP_Detector_SensorGeo(_EnMAP_Image): :param n_lines: number of line to be added :return: None """ - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: basename_img1 = self.detector_meta.data_filename.split('-SPECTRAL_IMAGE')[0] + '::%s' % self.detector_name basename_img2 = img2.detector_meta.data_filename.split('-SPECTRAL_IMAGE')[0] + '::%s' % img2.detector_name else: @@ -489,7 +489,7 @@ class EnMAP_Detector_SensorGeo(_EnMAP_Image): self.detector_meta.nrows += n_lines # Create new corner coordinate - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: enmapIm_cornerCoords = tuple(zip(img2.detector_meta.lon_UL_UR_LL_LR, img2.detector_meta.lat_UL_UR_LL_LR)) dem_validated = DEM_Processor(img2.cfg.path_dem, @@ -532,7 +532,7 @@ class EnMAP_Detector_SensorGeo(_EnMAP_Image): # append the raster data self.data = np.append(self.data, img2.data[0:n_lines, :, :], axis=0) self.mask_clouds = np.append(self.mask_clouds, img2.mask_clouds[0:n_lines, :], axis=0) - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: self.deadpixelmap = np.append(self.deadpixelmap, img2.deadpixelmap[0:n_lines, :], axis=0) # TODO append remaining raster layers - additional cloud masks, ... @@ -620,7 +620,7 @@ class EnMAPL1Product_SensorGeo(object): self.logger = logger # Read metadata here in order to get all information needed by to get paths. - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: self.meta = EnMAP_Metadata_L1B_SensorGeo(glob(path.join(root_dir, "*METADATA.XML"))[0], config=self.cfg, logger=self.logger) else: diff --git a/enpt/model/metadata.py b/enpt/model/metadata.py index 299c403..38eb75b 100644 --- a/enpt/model/metadata.py +++ b/enpt/model/metadata.py @@ -77,7 +77,7 @@ class EnMAP_Metadata_L1B_Detector_SensorGeo(object): """ self.cfg = config self.detector_name = detector_name # type: str - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: self.detector_label = L1B_product_props_DLR['xml_detector_label'][detector_name] else: self.detector_label = L1B_product_props['xml_detector_label'][detector_name] @@ -125,7 +125,7 @@ class EnMAP_Metadata_L1B_Detector_SensorGeo(object): """ xml = ElementTree.parse(path_xml).getroot() - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: lbl = self.detector_label self.logger.info("Reading metadata for %s detector..." % self.detector_name) @@ -472,7 +472,7 @@ class EnMAP_Metadata_L1B_SensorGeo(object): self.metaxml_filename = os.path.basename(path_xml) - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: # read processing level self.proc_level = xml.find("base/level").text if self.proc_level != 'L1B': @@ -558,7 +558,7 @@ class EnMAP_Metadata_L1B_SensorGeo(object): """ xml = ElementTree.parse(self.path_xml).getroot() - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: for detName, detMeta in zip(['VNIR', 'SWIR'], [self.vnir, self.swir]): lbl = L1B_product_props_DLR['xml_detector_label'][detName] xml.find("product/image/%s/dimension/rows" % lbl).text = str(detMeta.nrows) @@ -611,7 +611,7 @@ class EnMAP_Metadata_L2A_MapGeo(object): self.earthSunDist = meta_l1b.earthSunDist # type: float # earth-sun distance # generate file names for L2A output - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: self.scene_basename = meta_l1b.vnir.data_filename.split('-SPECTRAL_IMAGE')[0].replace('L1B-', 'L2A-') else: self.scene_basename = os.path.splitext(meta_l1b.vnir.data_filename)[0] @@ -644,7 +644,7 @@ class EnMAP_Metadata_L2A_MapGeo(object): self.smile_coef = np.vstack([meta_l1b.vnir.smile_coef, meta_l1b.swir.smile_coef])[bandidx_order, :] self.smile = np.hstack([meta_l1b.vnir.smile, meta_l1b.swir.smile])[:, bandidx_order] - if self.cfg.is_dlr_dataformat: + if not self.cfg.is_dummy_dataformat: self.rpc_coeffs = OrderedDict(zip( ['band_%d' % (i + 1) for i in range(dims_mapgeo[2])], [meta_l1b.vnir.rpc_coeffs['band_%d' % (i + 1)] if 'band_%d' % (i + 1) in meta_l1b.vnir.rpc_coeffs else @@ -730,7 +730,7 @@ class EnMAP_Metadata_L2A_MapGeo(object): # parse (use L1B metadata as template) xml = ElementTree.parse(self._meta_l1b.path_xml, parser).getroot() - if not self.cfg.is_dlr_dataformat: + if self.cfg.is_dummy_dataformat: self.logger.warning('No XML metadata conversion implemented for datasets different to the DLR format.' 'Metadata XML file will be empty.') return '' diff --git a/enpt/options/config.py b/enpt/options/config.py index 14f0f8f..0913777 100644 --- a/enpt/options/config.py +++ b/enpt/options/config.py @@ -105,10 +105,12 @@ class EnPTConfig(object): # general options # ################### - try: - self.is_dlr_dataformat = gp('is_dlr_dataformat') - except: # noqa E722 # FIXME - self.is_dlr_dataformat = False + self.is_dummy_dataformat = gp('is_dummy_dataformat') + if 'is_dlr_dataformat' in user_opts: + warnings.warn("The 'is_dlr_dataformat' flag is deprectated and will not exist in future. " + "Please set 'is_dummy_dataformat' to False instead.", DeprecationWarning) + self.is_dummy_dataformat = user_opts['is_dlr_dataformat'] is False + self.CPUs = gp('CPUs', fallback=cpu_count()) self.log_level = gp('log_level') self.create_logfile = gp('create_logfile') diff --git a/enpt/options/options_default.json b/enpt/options/options_default.json index 474a279..b87685e 100644 --- a/enpt/options/options_default.json +++ b/enpt/options/options_default.json @@ -9,6 +9,8 @@ "path_dem": "", /*input path of digital elevation model in map or sensor geometry; GDAL compatible file format (must cover the EnMAP L1B data completely if given in map geometry or must have the same pixel dimensions like the EnMAP L1B data if given in sensor geometry)*/ + "is_dummy_dataformat": false, /*Set to true in case of the preliminary, GFZ-internal dataformat as used for the + Alpine test dataset. (default: False. Note: This will be removed in future.)*/ "average_elevation": 0, /*average elevation in meters above sea level; may be provided if no DEM is available; ignored if DEM is given*/ "path_l1b_snr_model": "./resources/EnMAP_Sensor/EnMAP_Level_1B_SNR.zip", /*input path of the EnMAP SNR model*/ diff --git a/enpt/options/options_schema.py b/enpt/options/options_schema.py index f10af6d..902659e 100644 --- a/enpt/options/options_schema.py +++ b/enpt/options/options_schema.py @@ -10,6 +10,7 @@ enpt_schema_input = dict( path_l1b_enmap_image=dict(type='string', required=False), path_l1b_enmap_image_gapfill=dict(type='string', required=False), path_dem=dict(type='string', required=False), + is_dummy_dataformat=dict(type='boolean', required=False), average_elevation=dict(type='integer', required=False), path_l1b_snr_model=dict(type='string', required=False), working_dir=dict(type='string', required=False, nullable=True), @@ -85,6 +86,7 @@ parameter_mapping = dict( path_l1b_enmap_image=('general_opts', 'path_l1b_enmap_image'), path_l1b_enmap_image_gapfill=('general_opts', 'path_l1b_enmap_image_gapfill'), path_dem=('general_opts', 'path_dem'), + is_dummy_dataformat=('general_opts', 'is_dummy_dataformat'), average_elevation=('general_opts', 'average_elevation'), path_l1b_snr_model=('general_opts', 'path_l1b_snr_model'), working_dir=('general_opts', 'working_dir'), diff --git a/enpt/version.py b/enpt/version.py index ec82885..a1b766c 100644 --- a/enpt/version.py +++ b/enpt/version.py @@ -1,2 +1,2 @@ -__version__ = '0.7.0' -__versionalias__ = '20180121.01' +__version__ = '0.7.1' +__versionalias__ = '20180305.01' diff --git a/tests/linting/pydocstyle.log b/tests/linting/pydocstyle.log index 6c091c5..ca71bb2 100644 --- a/tests/linting/pydocstyle.log +++ b/tests/linting/pydocstyle.log @@ -176,37 +176,37 @@ enpt/options/config.py:79 in public class `EnPTConfig`: D101: Missing docstring in public class enpt/options/config.py:80 in public method `__init__`: D202: No blank lines allowed after function docstring (found 1) -enpt/options/config.py:170 in public method `absPath`: +enpt/options/config.py:172 in public method `absPath`: D102: Missing docstring in public method -enpt/options/config.py:173 in public method `get_parameter`: +enpt/options/config.py:175 in public method `get_parameter`: D102: Missing docstring in public method -enpt/options/config.py:236 in public method `to_dict`: +enpt/options/config.py:238 in public method `to_dict`: D202: No blank lines allowed after function docstring (found 1) -enpt/options/config.py:250 in public method `to_jsonable_dict`: +enpt/options/config.py:252 in public method `to_jsonable_dict`: D102: Missing docstring in public method -enpt/options/config.py:261 in public method `__repr__`: +enpt/options/config.py:263 in public method `__repr__`: D105: Missing docstring in magic method -enpt/options/config.py:265 in public function `json_to_python`: +enpt/options/config.py:267 in public function `json_to_python`: D103: Missing docstring in public function -enpt/options/config.py:298 in public function `python_to_json`: +enpt/options/config.py:300 in public function `python_to_json`: D103: Missing docstring in public function -enpt/options/config.py:320 in public class `EnPTValidator`: +enpt/options/config.py:322 in public class `EnPTValidator`: D101: Missing docstring in public class -enpt/options/config.py:321 in public method `__init__`: +enpt/options/config.py:323 in public method `__init__`: D205: 1 blank line required between summary line and description (found 0) -enpt/options/config.py:321 in public method `__init__`: +enpt/options/config.py:323 in public method `__init__`: D400: First line should end with a period (not 'r') -enpt/options/config.py:329 in public method `validate`: +enpt/options/config.py:331 in public method `validate`: D102: Missing docstring in public method -enpt/options/config.py:334 in public function `get_options`: +enpt/options/config.py:336 in public function `get_options`: D202: No blank lines allowed after function docstring (found 1) enpt/options/__init__.py:1 at module level: D104: Missing docstring in public package -enpt/options/options_schema.py:128 in public function `get_updated_schema`: +enpt/options/options_schema.py:130 in public function `get_updated_schema`: D103: Missing docstring in public function -enpt/options/options_schema.py:129 in private nested function `deep_update`: +enpt/options/options_schema.py:131 in private nested function `deep_update`: D202: No blank lines allowed after function docstring (found 1) -enpt/options/options_schema.py:129 in private nested function `deep_update`: +enpt/options/options_schema.py:131 in private nested function `deep_update`: D400: First line should end with a period (not 'e') -enpt/options/options_schema.py:148 in public function `get_param_from_json_config`: +enpt/options/options_schema.py:150 in public function `get_param_from_json_config`: D103: Missing docstring in public function -- GitLab From 79373afe6264fa682d328e2cb4aaac8cd870bf08 Mon Sep 17 00:00:00 2001 From: Daniel Scheffler Date: Tue, 5 Mar 2019 14:45:11 +0100 Subject: [PATCH 3/4] Updated test config. --- enpt/options/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enpt/options/config.py b/enpt/options/config.py index 0913777..49d4da4 100644 --- a/enpt/options/config.py +++ b/enpt/options/config.py @@ -44,7 +44,7 @@ config_for_testing = dict( output_dir=os.path.join(path_enptlib, '..', 'tests', 'data', 'test_outputs'), n_lines_to_append=50, disable_progress_bars=True, - is_dlr_dataformat=False, + is_dummy_dataformat=True, enable_ac=False ) @@ -64,7 +64,7 @@ config_for_testing_dlr = dict( output_dir=os.path.join(path_enptlib, '..', 'tests', 'data', 'test_outputs'), n_lines_to_append=50, disable_progress_bars=True, - is_dlr_dataformat=True, + is_dummy_dataformat=False, enable_ac=False, ortho_resampAlg='gauss' ) -- GitLab From 15de54219b0b50e480596059eb2a4b5fc8468663 Mon Sep 17 00:00:00 2001 From: Daniel Scheffler Date: Tue, 5 Mar 2019 16:56:32 +0100 Subject: [PATCH 4/4] Updated minimal version of geoarray. --- .gitlab-ci.yml | 3 +++ requirements.txt | 2 +- setup.py | 2 +- tests/gitlab_CI_docker/context/environment_enpt.yml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92164cb..14c8492 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,9 @@ test_enpt: - export GDAL_DATA=/root/miniconda3/envs/enpt/share/gdal - export PYTHONPATH=$PYTHONPATH:/root # /root <- here are the sicor tables + # update geoarray + - pip install 'geoarray>=0.8.11' + # update py_tools_ds - pip install 'py_tools_ds>=0.14.8' diff --git a/requirements.txt b/requirements.txt index 2626286..e4976b5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ numpy pandas scipy -geoarray>=0.8.9 +geoarray>=0.8.11 py_tools_ds>=0.14.8 cerberus jsmin diff --git a/setup.py b/setup.py index b5aa6c8..ca3404d 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ with open("enpt/version.py") as version_file: exec(version_file.read(), version) requirements = [ # put package requirements here - 'numpy', 'pandas', 'scipy', 'geoarray>=0.8.9', 'py_tools_ds>=0.14.8', 'cerberus', 'jsmin', 'matplotlib', 'tqdm', + 'numpy', 'pandas', 'scipy', 'geoarray>=0.8.11', 'py_tools_ds>=0.14.8', 'cerberus', 'jsmin', 'matplotlib', 'tqdm', 'utm', 'lxml', 'numpy-indexed' # 'sicor', # pip install git+https://gitext.gfz-potsdam.de/EnMAP/sicor.git ] diff --git a/tests/gitlab_CI_docker/context/environment_enpt.yml b/tests/gitlab_CI_docker/context/environment_enpt.yml index 00aa1be..b132de2 100644 --- a/tests/gitlab_CI_docker/context/environment_enpt.yml +++ b/tests/gitlab_CI_docker/context/environment_enpt.yml @@ -43,7 +43,7 @@ dependencies: - pip: - scipy - - geoarray>=0.8.9 + - geoarray>=0.8.11 - py_tools_ds>=0.14.8 - cerberus - jsmin -- GitLab