From 610d449031abf9cb56a47a40371edd45781ca283 Mon Sep 17 00:00:00 2001 From: giumas Date: Sat, 4 May 2024 12:26:40 +0200 Subject: [PATCH] adopted absolute import for local packages --- .github/workflows/bag_on_linux.yml | 3 ++- .github/workflows/bag_on_windows.yml | 4 +++- README.rst | 4 ++-- hyo2/bag/__init__.py | 2 +- hyo2/bag/bag.py | 10 ++++---- hyo2/bag/base.py | 28 ++++++---------------- hyo2/bag/bbox.py | 17 +++++++------- hyo2/bag/density.py | 28 ++++++++++------------ hyo2/bag/elevation.py | 33 ++++++++++++-------------- hyo2/bag/meta.py | 26 +++++++++------------ hyo2/bag/tools/__init__.py | 4 ++-- hyo2/bag/tracklist.py | 23 ++++++++---------- hyo2/bag/uncertainty.py | 35 +++++++++++++--------------- setup.py | 1 + 14 files changed, 95 insertions(+), 123 deletions(-) diff --git a/.github/workflows/bag_on_linux.yml b/.github/workflows/bag_on_linux.yml index 1af0390..57ed20c 100644 --- a/.github/workflows/bag_on_linux.yml +++ b/.github/workflows/bag_on_linux.yml @@ -22,9 +22,10 @@ jobs: - name: Install dependencies run: | conda config --add channels conda-forge - conda install appdirs cartopy gdal matplotlib-base numpy psutil pyproj qt-material hyo2.abc2 + conda install appdirs cartopy gdal matplotlib-base numpy psutil pyproj qt-material pip install PySide6 sudo apt-get install -y libegl1 + pip install hyo2.abc2 pip install --no-deps . - name: Lint with flake8 run: | diff --git a/.github/workflows/bag_on_windows.yml b/.github/workflows/bag_on_windows.yml index ab44b24..193b62c 100644 --- a/.github/workflows/bag_on_windows.yml +++ b/.github/workflows/bag_on_windows.yml @@ -22,8 +22,10 @@ jobs: - name: Install dependencies run: | conda config --add channels conda-forge - conda install appdirs cartopy gdal matplotlib-base numpy psutil pyproj qt-material hyo2.abc2 + conda install appdirs cartopy gdal matplotlib-base numpy psutil pyproj qt-material + conda install h5py dateutil lxml pip install PySide6 + pip install hyo2.abc2 pip install --no-deps . - name: Lint with flake8 run: | diff --git a/README.rst b/README.rst index 739c7ec..7808b20 100644 --- a/README.rst +++ b/README.rst @@ -22,8 +22,8 @@ HydrOffice BAG Tools :target: https://www.hydroffice.org/manuals/bag/index.html :alt: Latest Documentation -.. image:: https://api.codacy.com/project/badge/Grade/c7551d8f90ba4b0086c7b8dc81376260 - :target: https://www.codacy.com/app/hydroffice/hyo2_bag/dashboard +.. image:: https://app.codacy.com/project/badge/Grade/b39ce4141d3e412fa789c7d5ee4971f3 + :target: https://app.codacy.com/gh/hydroffice/hyo2_bag/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade :alt: codacy .. image:: https://coveralls.io/repos/github/hydroffice/hyo2_bag/badge.svg?branch=master diff --git a/hyo2/bag/__init__.py b/hyo2/bag/__init__.py index a5515cf..c50ea79 100644 --- a/hyo2/bag/__init__.py +++ b/hyo2/bag/__init__.py @@ -4,7 +4,7 @@ """ name = 'BAG' -__version__ = '1.2.2' +__version__ = '1.2.3' __author__ = 'gmasetti@ccom.unh.edu' __license__ = 'LGPLv3 license' __copyright__ = 'Copyright (c) 2024, University of New Hampshire, Center for Coastal and Ocean Mapping' diff --git a/hyo2/bag/bag.py b/hyo2/bag/bag.py index 49785d4..d1eb60a 100644 --- a/hyo2/bag/bag.py +++ b/hyo2/bag/bag.py @@ -60,7 +60,7 @@ def __init__(self, name, mode='r', driver=None, self._str = None @classmethod - def is_bag(cls, bag_path:str, advanced: bool = False) -> bool: + def is_bag(cls, bag_path: str, advanced: bool = False) -> bool: if not advanced: return os.path.splitext(bag_path)[-1].lower() == ".bag" @@ -154,7 +154,7 @@ def elevation_min_max(self) -> Tuple[float, float]: # logger.debug('shape: %s, %s' % (rows, cols)) mem_row = cols * 32 / 1024 / 1024 - mem = mem_row * rows + # mem = mem_row * rows # logger.debug('estimated memory: %.1f MB' % mem) chunk_size = 8096 chunk_rows = int(chunk_size / mem_row) + 1 @@ -190,7 +190,7 @@ def vr_refinements_shape(self): return self[BAGFile._bag_varres_refinements].shape def vr_elevation_min_max(self) -> Tuple[float, float]: - rows, cols = self.vr_refinements_shape() + # rows, cols = self.vr_refinements_shape() # logger.debug('refinements shape: %s, %s' % (rows, cols)) vr_el = self[BAGFile._bag_varres_refinements][0]['depth'] @@ -253,7 +253,7 @@ def uncertainty_min_max(self) -> Tuple[float, float]: # logger.debug('shape: %s, %s' % (rows, cols)) mem_row = cols * 32 / 1024 / 1024 - mem = mem_row * rows + # mem = mem_row * rows # logger.debug('estimated memory: %.1f MB' % mem) chunk_size = 8096 chunk_rows = int(chunk_size / mem_row) + 1 @@ -282,7 +282,7 @@ def uncertainty_min_max(self) -> Tuple[float, float]: return unc_min, unc_max def vr_uncertainty_min_max(self) -> Tuple[float, float]: - rows, cols = self.vr_refinements_shape() + # rows, cols = self.vr_refinements_shape() # logger.debug('shape: %s, %s' % (rows, cols)) vr_unc = self[BAGFile._bag_varres_refinements][0]['depth_uncrt'] diff --git a/hyo2/bag/base.py b/hyo2/bag/base.py index e1a8499..1c6513d 100644 --- a/hyo2/bag/base.py +++ b/hyo2/bag/base.py @@ -1,22 +1,10 @@ import os -import sys import logging -log = logging.getLogger(__name__) - import h5py from h5py._hl.base import with_phil -from .helper import BAGError - - -PY3 = sys.version_info[0] == 3 -if PY3: - def u(s): - return s -else: - def u(s): - return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape") +logger = logging.getLogger(__name__) def is_bag(file_name): @@ -69,19 +57,19 @@ def __init__(self, name, mode: str = "r", driver=None, def close(self): """ Close the file. All open objects become invalid """ - log.debug("closing") + logger.debug("closing") super(File, self).close() def flush(self): """ Tell the BAG library to flush its buffers. """ - log.debug("flushing") + logger.debug("flushing") super(File, self).flush() @with_phil def __repr__(self): if not self.id: - log.info("closed file") - r = u('\n') + logger.info("closed file") + r = '\n' r += " " else: # Filename has to be forced to Unicode if it comes back bytes @@ -89,13 +77,11 @@ def __repr__(self): filename = self.filename if isinstance(filename, bytes): # Can't decode fname filename = filename.decode('utf8', 'replace') - r = u('') % (os.path.basename(filename), self.mode) + r = '' % (os.path.basename(filename), self.mode) r += " \n" r += " \n" % self.id r += " \n" % self.name r += " \n" % self.driver r += " \n" % self.userblock_size - if PY3: - return r - return r.encode('utf8') + return r diff --git a/hyo2/bag/bbox.py b/hyo2/bag/bbox.py index ab9720a..d5fbeae 100644 --- a/hyo2/bag/bbox.py +++ b/hyo2/bag/bbox.py @@ -1,13 +1,13 @@ import os import logging -log = logging.getLogger(__name__) - from osgeo import ogr, osr -from .meta import Meta -from .helper import BAGError, Helper -from . import __version__ +from hyo2.bag.meta import Meta +from hyo2.bag.helper import BAGError, Helper +from hyo2.bag import __version__ + +logger = logging.getLogger(__name__) ogr.UseExceptions() @@ -20,8 +20,7 @@ class Bbox2Gdal(object): 'shp': ["ESRI Shapefile", "bag.shp"], } - def __init__(self, bag_meta, fmt="kml", title=None, out_file=None): - assert isinstance(bag_meta, Meta) + def __init__(self, bag_meta: Meta, fmt="kml", title=None, out_file=None): self.bag_meta = bag_meta if not self.bag_meta.valid_bbox(): raise BAGError("invalid bbox read in BAG metadata") @@ -29,7 +28,7 @@ def __init__(self, bag_meta, fmt="kml", title=None, out_file=None): self.title = title if self.title is None: self.title = "Metadata" - log.debug("title: %s" % self.title) + logger.debug("title: %s" % self.title) # get the ogr driver self.drv = ogr.GetDriverByName(self.formats[fmt][0]) @@ -40,7 +39,7 @@ def __init__(self, bag_meta, fmt="kml", title=None, out_file=None): self.out_file = out_file if self.out_file is None: self.out_file = os.path.abspath(self.formats[fmt][1]) - log.debug("output: %s" % self.out_file) + logger.debug("output: %s" % self.out_file) if os.path.exists(self.out_file): os.remove(self.out_file) diff --git a/hyo2/bag/density.py b/hyo2/bag/density.py index 51765b5..4a5a13e 100644 --- a/hyo2/bag/density.py +++ b/hyo2/bag/density.py @@ -1,16 +1,14 @@ import os import logging - -log = logging.getLogger(__name__) - import numpy as np from osgeo import gdal, osr from .meta import Meta -from .helper import BAGError, Helper -from . import __version__ +from .helper import BAGError from .bag import BAGFile + +logger = logging.getLogger(__name__) gdal.UseExceptions() @@ -22,10 +20,8 @@ class Density2Gdal(object): 'xyz': [b"XYZ", "bag.leidos.density.xyz"], } - def __init__(self, bag_density, bag_meta, fmt="geotiff", out_file=None, epsg=None): + def __init__(self, bag_density: np.ndarray, bag_meta: Meta, fmt="geotiff", out_file=None, epsg=None): """Export the elevation layer in one of the listed formats""" - assert isinstance(bag_density, np.ndarray) - assert isinstance(bag_meta, Meta) self.bag_den = bag_density self.bag_meta = bag_meta @@ -33,18 +29,18 @@ def __init__(self, bag_density, bag_meta, fmt="geotiff", out_file=None, epsg=Non self.mem = gdal.GetDriverByName(b"MEM") if self.mem is None: raise BAGError("%s driver not available.\n" % self.formats[fmt][0]) - log.debug("format: %s" % fmt) + logger.debug("format: %s" % fmt) # set the output file self.out_file = out_file if self.out_file is None: self.out_file = os.path.abspath(self.formats[fmt][1]) - log.debug("output: %s" % self.out_file) + logger.debug("output: %s" % self.out_file) if os.path.exists(self.out_file): os.remove(self.out_file) - log.debug("dtype: %s" % self.bag_den.dtype) + logger.debug("dtype: %s" % self.bag_den.dtype) self.rst = self.mem.Create(utf8_path=self.out_file, xsize=self.bag_meta.cols, ysize=self.bag_meta.rows, bands=1, eType=gdal.GDT_Float32) # GDAL geo-transform refers to the top left corner of the top left pixel of the raster. @@ -58,7 +54,7 @@ def __init__(self, bag_density, bag_meta, fmt="geotiff", out_file=None, epsg=Non if self.bag_meta.wkt_srs is not None: self.srs.ImportFromWkt(self.bag_meta.wkt_srs) else: - log.warning("unable to recover valid spatial reference info") + logger.warning("unable to recover valid spatial reference info") self.rst.SetProjection(self.srs.ExportToWkt()) self.bnd.FlushCache() @@ -68,8 +64,8 @@ def __init__(self, bag_density, bag_meta, fmt="geotiff", out_file=None, epsg=Non # check if re-projection is required if not epsg: # if not, we just create a copy in the selected format - dst_ds = self.drv.CreateCopy(self.out_file, self.rst) - dst_ds = None + _ = self.drv.CreateCopy(self.out_file, self.rst) + _ = None self.rst = None return @@ -87,6 +83,6 @@ def __init__(self, bag_density, bag_meta, fmt="geotiff", out_file=None, epsg=Non 0.125 # error threshold --> use same value as in gdalwarp ) # Create the final warped raster - dst_ds = self.drv.CreateCopy(self.out_file, tmp_ds) - dst_ds = None + _ = self.drv.CreateCopy(self.out_file, tmp_ds) + _ = None self.rst = None diff --git a/hyo2/bag/elevation.py b/hyo2/bag/elevation.py index 364a60a..826a423 100644 --- a/hyo2/bag/elevation.py +++ b/hyo2/bag/elevation.py @@ -1,15 +1,15 @@ import os import logging -log = logging.getLogger(__name__) - import numpy as np - from osgeo import gdal, osr -from .meta import Meta -from .helper import BAGError -from .bag import BAGFile +from hyo2.bag.meta import Meta +from hyo2.bag.helper import BAGError +from hyo2.bag.bag import BAGFile + + +logger = logging.getLogger(__name__) gdal.UseExceptions() @@ -21,10 +21,8 @@ class Elevation2Gdal: 'xyz': ["XYZ", "bag.elevation.xyz"], } - def __init__(self, bag_elevation, bag_meta, fmt="geotiff", out_file=None, epsg=None): + def __init__(self, bag_elevation: np.ndarray, bag_meta: Meta, fmt="geotiff", out_file=None, epsg=None): """Export the elevation layer in one of the listed formats""" - assert isinstance(bag_elevation, np.ndarray) - assert isinstance(bag_meta, Meta) self.bag_elv = bag_elevation self.bag_meta = bag_meta @@ -32,18 +30,18 @@ def __init__(self, bag_elevation, bag_meta, fmt="geotiff", out_file=None, epsg=N self.mem = gdal.GetDriverByName("MEM") if self.mem is None: raise BAGError("%s driver not available.\n" % self.formats[fmt][0]) - log.debug("format: %s" % fmt) + logger.debug("format: %s" % fmt) # set the output file self.out_file = out_file if self.out_file is None: self.out_file = os.path.abspath(self.formats[fmt][1]) - log.debug("output: %s" % self.out_file) + logger.debug("output: %s" % self.out_file) if os.path.exists(self.out_file): os.remove(self.out_file) - log.debug("dtype: %s" % self.bag_elv.dtype) + logger.debug("dtype: %s" % self.bag_elv.dtype) self.rst = self.mem.Create(utf8_path=self.out_file, xsize=self.bag_meta.cols, ysize=self.bag_meta.rows, bands=1, eType=gdal.GDT_Float32) # GDAL geo-transform refers to the top left corner of the top left pixel of the raster. @@ -57,7 +55,7 @@ def __init__(self, bag_elevation, bag_meta, fmt="geotiff", out_file=None, epsg=N if self.bag_meta.wkt_srs is not None: self.srs.ImportFromWkt(self.bag_meta.wkt_srs) else: - log.warning("unable to recover valid spatial reference info") + logger.warning("unable to recover valid spatial reference info") self.rst.SetProjection(self.srs.ExportToWkt()) self.bnd.FlushCache() @@ -67,8 +65,8 @@ def __init__(self, bag_elevation, bag_meta, fmt="geotiff", out_file=None, epsg=N # check if re-projection is required if not epsg: # if not, we just create a copy in the selected format - dst_ds = self.drv.CreateCopy(self.out_file, self.rst) - dst_ds = None + _ = self.drv.CreateCopy(self.out_file, self.rst) + _ = None self.rst = None return @@ -86,7 +84,6 @@ def __init__(self, bag_elevation, bag_meta, fmt="geotiff", out_file=None, epsg=N 0.125 # error threshold --> use same value as in gdalwarp ) # Create the final warped raster - dst_ds = self.drv.CreateCopy(self.out_file, tmp_ds) - dst_ds = None + _ = self.drv.CreateCopy(self.out_file, tmp_ds) + _ = None self.rst = None - diff --git a/hyo2/bag/meta.py b/hyo2/bag/meta.py index b9e1d85..4b9b13d 100644 --- a/hyo2/bag/meta.py +++ b/hyo2/bag/meta.py @@ -1,15 +1,9 @@ -import os -import sys import logging -import numpy as np -import h5py -import traceback from lxml import etree +from hyo2.bag.helper import Helper logger = logging.getLogger(__name__) -from .helper import Helper - class Meta: """ Helper class to manage BAG xml metadata. """ @@ -200,7 +194,7 @@ def _read_corners_sw_and_ne(self): ret = self.xml_tree.xpath('//*/gmd:spatialRepresentationInfo/gmd:MD_Georectified/' 'gmd:cornerPoints/gml:Point/gml:coordinates', namespaces=self.ns)[0].text.split() - except (etree.Error, IndexError) as e: + except (etree.Error, IndexError): try: ret = self.xml_tree.xpath('//*/spatialRepresentationInfo/smXML:MD_Georectified/' 'cornerPoints/gml:Point/gml:coordinates', @@ -375,7 +369,7 @@ def _read_date(self): if len(ret) == 0: ret = self.xml_tree.xpath('//*/gmd:dateStamp/gco:Date', - namespaces=self.ns) + namespaces=self.ns) if len(ret) == 0: logger.warning("unable to read the date string") @@ -403,9 +397,10 @@ def _read_survey_start_date(self): """ attempts to read the survey date strings """ try: - ret_begin = self.xml_tree.xpath('//*/gmd:identificationInfo/bag:BAG_DataIdentification/gmd:extent/gmd:EX_Extent/' - 'gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition', - namespaces=self.ns) + ret_begin = self.xml_tree.xpath( + '//*/gmd:identificationInfo/bag:BAG_DataIdentification/gmd:extent/gmd:EX_Extent/' + 'gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition', + namespaces=self.ns) if len(ret_begin) == 0: ret_begin = self.xml_tree.xpath( @@ -446,9 +441,10 @@ def _read_survey_end_date(self): """ attempts to read the survey date strings """ try: - ret_end = self.xml_tree.xpath('//*/gmd:identificationInfo/bag:BAG_DataIdentification/gmd:extent/gmd:EX_Extent/' - 'gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition', - namespaces=self.ns) + ret_end = self.xml_tree.xpath( + '//*/gmd:identificationInfo/bag:BAG_DataIdentification/gmd:extent/gmd:EX_Extent/' + 'gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition', + namespaces=self.ns) if len(ret_end) == 0: ret_end = self.xml_tree.xpath( diff --git a/hyo2/bag/tools/__init__.py b/hyo2/bag/tools/__init__.py index f664f72..c10988d 100644 --- a/hyo2/bag/tools/__init__.py +++ b/hyo2/bag/tools/__init__.py @@ -1,4 +1,4 @@ import logging -log = logging.getLogger(__name__) -log.addHandler(logging.NullHandler()) +logger = logging.getLogger(__name__) +logger.addHandler(logging.NullHandler()) diff --git a/hyo2/bag/tracklist.py b/hyo2/bag/tracklist.py index aab2aa5..6211cec 100644 --- a/hyo2/bag/tracklist.py +++ b/hyo2/bag/tracklist.py @@ -1,33 +1,30 @@ import os import logging +import numpy as np +from hyo2.bag import __version__ -log = logging.getLogger(__name__) -import numpy as np -from .meta import Meta -from .helper import BAGError, Helper -from . import __version__ +logger = logging.getLogger(__name__) class TrackList2Csv(object): default_csv_name = "BAG.tracklist.csv" - def __init__(self, track_list, csv_file=None, header=None, comment=None): - assert isinstance(track_list, np.ndarray) - log.debug("track list shape: %s" % track_list.shape) - log.debug("track list size: %s" % track_list.size) + def __init__(self, track_list: np.ndarray, csv_file=None, header=None, comment=None): + logger.debug("track list shape: %s" % track_list.shape) + logger.debug("track list size: %s" % track_list.size) self.track_list = track_list if self.track_list.size == 0: - log.warning("nothing to export since the tracking list is empty") + logger.warning("nothing to export since the tracking list is empty") return self.csv_file = csv_file if csv_file is None: self.csv_file = self.default_csv_name self.csv_file = os.path.abspath(self.csv_file) - log.debug("output: %s" % self.csv_file) + logger.debug("output: %s" % self.csv_file) self.header = header if self.header is None: @@ -35,12 +32,12 @@ def __init__(self, track_list, csv_file=None, header=None, comment=None): if type(self.header) is tuple: self.header = ",".join(fld for fld in self.header) self.header += "\n" - log.debug("header: %s" % self.header) + logger.debug("header: %s" % self.header) self.comment = comment if self.comment is None: self.comment = "# Exported using BAG tools r%s\n" % __version__ - log.debug("comment: %s" % self.comment) + logger.debug("comment: %s" % self.comment) with open(self.csv_file, 'w') as f: f.write(self.comment) diff --git a/hyo2/bag/uncertainty.py b/hyo2/bag/uncertainty.py index 38ce733..436ed94 100644 --- a/hyo2/bag/uncertainty.py +++ b/hyo2/bag/uncertainty.py @@ -1,20 +1,19 @@ import os import logging -log = logging.getLogger(__name__) - import numpy as np - from osgeo import gdal, osr -from .meta import Meta -from .helper import BAGError, Helper -from . import __version__ -from .bag import BAGFile +from hyo2.bag.meta import Meta +from hyo2.bag.helper import BAGError +from hyo2.bag.bag import BAGFile + + +logger = logging.getLogger(__name__) gdal.UseExceptions() -class Uncertainty2Gdal(object): +class Uncertainty2Gdal: formats = { 'ascii': ["AAIGrid", "bag.uncertainty.asc"], @@ -22,10 +21,8 @@ class Uncertainty2Gdal(object): 'xyz': ["XYZ", "bag.uncertainty.xyz"], } - def __init__(self, bag_uncertainty, bag_meta, fmt="geotiff", out_file=None, epsg=None): + def __init__(self, bag_uncertainty: np.ndarray, bag_meta: Meta, fmt="geotiff", out_file=None, epsg=None): """Export the elevation layer in one of the listed formats""" - assert isinstance(bag_uncertainty, np.ndarray) - assert isinstance(bag_meta, Meta) self.bag_unc = bag_uncertainty self.bag_meta = bag_meta @@ -33,18 +30,18 @@ def __init__(self, bag_uncertainty, bag_meta, fmt="geotiff", out_file=None, epsg self.mem = gdal.GetDriverByName("MEM") if self.mem is None: raise BAGError("%s driver not available.\n" % self.formats[fmt][0]) - log.debug("format: %s" % fmt) + logger.debug("format: %s" % fmt) # set the output file self.out_file = out_file if self.out_file is None: self.out_file = os.path.abspath(self.formats[fmt][1]) - log.debug("output: %s" % self.out_file) + logger.debug("output: %s" % self.out_file) if os.path.exists(self.out_file): os.remove(self.out_file) - log.debug("dtype: %s" % self.bag_unc.dtype) + logger.debug("dtype: %s" % self.bag_unc.dtype) self.rst = self.mem.Create(utf8_path=self.out_file, xsize=self.bag_meta.cols, ysize=self.bag_meta.rows, bands=1, eType=gdal.GDT_Float32) # GDAL geo-transform refers to the top left corner of the top left pixel of the raster. @@ -58,7 +55,7 @@ def __init__(self, bag_uncertainty, bag_meta, fmt="geotiff", out_file=None, epsg if self.bag_meta.wkt_srs is not None: self.srs.ImportFromWkt(self.bag_meta.wkt_srs) else: - log.warning("unable to recover valid spatial reference info") + logger.warning("unable to recover valid spatial reference info") self.rst.SetProjection(self.srs.ExportToWkt()) self.bnd.FlushCache() @@ -68,8 +65,8 @@ def __init__(self, bag_uncertainty, bag_meta, fmt="geotiff", out_file=None, epsg # check if re-projection is required if not epsg: # if not, we just create a copy in the selected format - dst_ds = self.drv.CreateCopy(self.out_file, self.rst) - dst_ds = None + _ = self.drv.CreateCopy(self.out_file, self.rst) + _ = None self.rst = None return @@ -87,6 +84,6 @@ def __init__(self, bag_uncertainty, bag_meta, fmt="geotiff", out_file=None, epsg 0.125 # error threshold --> use same value as in gdalwarp ) # Create the final warped raster - dst_ds = self.drv.CreateCopy(self.out_file, tmp_ds) - dst_ds = None + _ = self.drv.CreateCopy(self.out_file, tmp_ds) + _ = None self.rst = None diff --git a/setup.py b/setup.py index 6fa2e13..01a624d 100644 --- a/setup.py +++ b/setup.py @@ -66,6 +66,7 @@ def find_version(*file_paths): ], install_requires=[ "hyo2.abc2>=2.3.7", + "dateutil", "lxml", "numpy", "gdal",