yirgacheffe 1.7.6__tar.gz → 1.7.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of yirgacheffe might be problematic. Click here for more details.

Files changed (58) hide show
  1. {yirgacheffe-1.7.6/yirgacheffe.egg-info → yirgacheffe-1.7.8}/PKG-INFO +12 -5
  2. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/pyproject.toml +17 -5
  3. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_operators.py +2 -1
  4. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_parallel_operators.py +35 -2
  5. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/_core.py +1 -1
  6. yirgacheffe-1.7.6/yirgacheffe/operators.py → yirgacheffe-1.7.8/yirgacheffe/_operators.py +86 -75
  7. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/layers/base.py +2 -1
  8. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/layers/constant.py +1 -2
  9. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/layers/group.py +1 -2
  10. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/layers/h3layer.py +1 -1
  11. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/layers/rasters.py +1 -1
  12. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/layers/rescaled.py +1 -1
  13. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/layers/vectors.py +1 -1
  14. yirgacheffe-1.7.8/yirgacheffe/operators.py +7 -0
  15. yirgacheffe-1.7.8/yirgacheffe/py.typed +0 -0
  16. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/window.py +2 -2
  17. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8/yirgacheffe.egg-info}/PKG-INFO +12 -5
  18. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe.egg-info/SOURCES.txt +2 -0
  19. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe.egg-info/requires.txt +3 -3
  20. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/LICENSE +0 -0
  21. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/MANIFEST.in +0 -0
  22. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/README.md +0 -0
  23. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/setup.cfg +0 -0
  24. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_area.py +0 -0
  25. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_auto_windowing.py +0 -0
  26. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_base.py +0 -0
  27. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_constants.py +0 -0
  28. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_datatypes.py +0 -0
  29. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_group.py +0 -0
  30. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_h3layer.py +0 -0
  31. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_intersection.py +0 -0
  32. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_multiband.py +0 -0
  33. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_nodata.py +0 -0
  34. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_openers.py +0 -0
  35. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_optimisation.py +0 -0
  36. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_pickle.py +0 -0
  37. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_projection.py +0 -0
  38. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_raster.py +0 -0
  39. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_rescaling.py +0 -0
  40. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_rounding.py +0 -0
  41. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_save_with_window.py +0 -0
  42. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_sum_with_window.py +0 -0
  43. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_uniform_area_layer.py +0 -0
  44. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_union.py +0 -0
  45. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_vectors.py +0 -0
  46. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/tests/test_window.py +0 -0
  47. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/__init__.py +0 -0
  48. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/_backends/__init__.py +0 -0
  49. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/_backends/enumeration.py +0 -0
  50. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/_backends/mlx.py +0 -0
  51. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/_backends/numpy.py +0 -0
  52. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/constants.py +0 -0
  53. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/layers/__init__.py +0 -0
  54. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/layers/area.py +0 -0
  55. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe/rounding.py +0 -0
  56. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe.egg-info/dependency_links.txt +0 -0
  57. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe.egg-info/entry_points.txt +0 -0
  58. {yirgacheffe-1.7.6 → yirgacheffe-1.7.8}/yirgacheffe.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yirgacheffe
3
- Version: 1.7.6
3
+ Version: 1.7.8
4
4
  Summary: Abstraction of gdal datasets for doing basic math operations
5
5
  Author-email: Michael Dales <mwd24@cam.ac.uk>
6
6
  License-Expression: ISC
@@ -8,13 +8,20 @@ Project-URL: Homepage, https://github.com/quantifyearth/yirgacheffe
8
8
  Project-URL: Repository, https://github.com/quantifyearth/yirgacheffe.git
9
9
  Project-URL: Issues, https://github.com/quantifyearth/yirgacheffe/issues
10
10
  Project-URL: Changelog, https://github.com/quantifyearth/yirgacheffe/blob/main/CHANGES.md
11
- Keywords: gdal,numpy,math
11
+ Keywords: gdal,gis,geospatial,declarative
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Scientific/Engineering :: GIS
12
19
  Requires-Python: >=3.10
13
20
  Description-Content-Type: text/markdown
14
21
  License-File: LICENSE
15
- Requires-Dist: numpy
16
- Requires-Dist: gdal[numpy]
17
- Requires-Dist: scikit-image
22
+ Requires-Dist: numpy<3.0,>=1.24
23
+ Requires-Dist: gdal[numpy]<4.0,>=3.8
24
+ Requires-Dist: scikit-image<1.0,>=0.20
18
25
  Requires-Dist: torch
19
26
  Requires-Dist: dill
20
27
  Requires-Dist: deprecation
@@ -6,16 +6,25 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "yirgacheffe"
9
- version = "1.7.6"
9
+ version = "1.7.8"
10
10
  description = "Abstraction of gdal datasets for doing basic math operations"
11
11
  readme = "README.md"
12
12
  authors = [{ name = "Michael Dales", email = "mwd24@cam.ac.uk" }]
13
13
  license = "ISC"
14
- keywords = ["gdal", "numpy", "math"]
14
+ classifiers = [
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Intended Audience :: Science/Research",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Topic :: Scientific/Engineering :: GIS",
22
+ ]
23
+ keywords = ["gdal", "gis", "geospatial", "declarative"]
15
24
  dependencies = [
16
- "numpy",
17
- "gdal[numpy]",
18
- "scikit-image",
25
+ "numpy>=1.24,<3.0",
26
+ "gdal[numpy]>=3.8,<4.0",
27
+ "scikit-image>=0.20,<1.0",
19
28
  "torch",
20
29
  "dill",
21
30
  "deprecation",
@@ -35,6 +44,9 @@ Changelog = "https://github.com/quantifyearth/yirgacheffe/blob/main/CHANGES.md"
35
44
  [project.scripts]
36
45
  realpython = "reader.__main__:main"
37
46
 
47
+ [tool.setuptools.package-data]
48
+ yirgacheffe = ["py.typed"]
49
+
38
50
  [[tool.mypy.overrides]]
39
51
  module = "osgeo.*"
40
52
  ignore_missing_imports = true
@@ -10,7 +10,8 @@ import torch
10
10
  import yirgacheffe
11
11
  from yirgacheffe.window import Area, PixelScale
12
12
  from yirgacheffe.layers import ConstantLayer, RasterLayer, VectorLayer
13
- from yirgacheffe.operators import LayerOperation, DataType
13
+ from yirgacheffe.operators import DataType
14
+ from yirgacheffe._operators import LayerOperation
14
15
  from yirgacheffe._backends import backend
15
16
  from tests.helpers import gdal_dataset_with_data, gdal_dataset_of_region, make_vectors_with_id
16
17
 
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import resource
2
3
  import tempfile
3
4
 
4
5
  import numpy as np
@@ -8,7 +9,7 @@ import torch
8
9
  import yirgacheffe
9
10
  from tests.helpers import gdal_dataset_with_data
10
11
  from yirgacheffe.layers import RasterLayer
11
- from yirgacheffe.operators import LayerOperation
12
+ from yirgacheffe._operators import LayerOperation
12
13
 
13
14
  # These tests are marked skip for MLX, because there seems to be a problem with
14
15
  # calling mx.eval in the tests for parallel save on Linux (which is what we use
@@ -42,7 +43,6 @@ def test_add_byte_layers_with_one_thread_uses_regular_save(monkeypatch) -> None:
42
43
  with pytest.raises(TypeError):
43
44
  comp.parallel_save(result)
44
45
 
45
-
46
46
  @pytest.mark.skipif(yirgacheffe._backends.BACKEND != "NUMPY", reason="Only applies for numpy")
47
47
  def test_add_byte_layers(monkeypatch) -> None:
48
48
  with monkeypatch.context() as m:
@@ -71,6 +71,39 @@ def test_add_byte_layers(monkeypatch) -> None:
71
71
 
72
72
  assert (expected == actual).all()
73
73
 
74
+ @pytest.mark.skipif(yirgacheffe._backends.BACKEND != "NUMPY", reason="Only applies for numpy")
75
+ def test_rlimit_nofiles(monkeypatch) -> None:
76
+ with monkeypatch.context() as m:
77
+ m.setattr(yirgacheffe.constants, "YSTEP", 1)
78
+ m.setattr(LayerOperation, "save", None)
79
+ with tempfile.TemporaryDirectory() as tempdir:
80
+ path1 = os.path.join(tempdir, "test1.tif")
81
+ data1 = np.array([[1, 2, 3, 4], [5, 6, 7, 8]])
82
+ dataset1 = gdal_dataset_with_data((0.0, 0.0), 0.02, data1, filename=path1)
83
+ dataset1.Close()
84
+
85
+ rlimit_log = []
86
+ def callback_rlimit_recorder(_progress: float) -> None:
87
+ rlimit_log.append(resource.getrlimit(resource.RLIMIT_NOFILE))
88
+
89
+ with RasterLayer.layer_from_file(path1) as layer:
90
+ with RasterLayer.empty_raster_layer_like(layer) as result:
91
+
92
+ before_current_fd_limit, before_max_fd_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
93
+
94
+ comp = layer * 2
95
+ comp.parallel_save(result, callback=callback_rlimit_recorder)
96
+
97
+ after_current_fd_limit, after_max_fd_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
98
+
99
+ assert after_current_fd_limit == before_current_fd_limit
100
+ assert after_max_fd_limit == before_max_fd_limit
101
+
102
+ assert len(rlimit_log) > 0
103
+ for recorded_current_fd_limit, recorded_max_fd_limit in rlimit_log:
104
+ assert recorded_current_fd_limit == before_max_fd_limit
105
+ assert recorded_max_fd_limit == before_max_fd_limit
106
+
74
107
  @pytest.mark.skipif(yirgacheffe._backends.BACKEND != "NUMPY", reason="Only applies for numpy")
75
108
  def test_add_byte_layers_and_sum(monkeypatch) -> None:
76
109
  with monkeypatch.context() as m:
@@ -8,7 +8,7 @@ from .layers.group import GroupLayer, TiledGroupLayer
8
8
  from .layers.rasters import RasterLayer
9
9
  from .layers.vectors import VectorLayer
10
10
  from .window import MapProjection
11
- from .operators import DataType
11
+ from ._backends.enumeration import dtype as DataType
12
12
 
13
13
  def read_raster(
14
14
  filename: Union[Path,str],
@@ -2,10 +2,12 @@ import logging
2
2
  import math
3
3
  import multiprocessing
4
4
  import os
5
+ import resource
5
6
  import sys
6
7
  import tempfile
7
8
  import time
8
9
  import types
10
+ from contextlib import ExitStack
9
11
  from enum import Enum
10
12
  from multiprocessing import Semaphore, Process
11
13
  from multiprocessing.managers import SharedMemoryManager
@@ -769,83 +771,92 @@ class LayerOperation(LayerMathMixin):
769
771
 
770
772
  total = 0.0
771
773
 
772
- with multiprocessing.Manager() as manager:
773
- with SharedMemoryManager() as smm:
774
-
775
- mem_sem_cast = []
776
- for _ in range(worker_count):
777
- shared_buf = smm.SharedMemory(size=np_dtype.itemsize * self.ystep * computation_window.xsize)
778
- cast_buf : npt.NDArray = np.ndarray(
779
- (self.ystep, computation_window.xsize),
780
- dtype=np_dtype,
781
- buffer=shared_buf.buf
782
- )
783
- cast_buf[:] = np.zeros((self.ystep, computation_window.xsize), np_dtype)
784
- mem_sem_cast.append((shared_buf, Semaphore(), cast_buf))
785
-
786
- source_queue = manager.Queue()
787
- result_queue = manager.Queue()
788
-
789
- for yoffset in range(0, computation_window.ysize, self.ystep):
790
- step = ((computation_window.ysize - yoffset)
791
- if yoffset+self.ystep > computation_window.ysize
792
- else self.ystep)
793
- source_queue.put((
794
- yoffset,
795
- step
796
- ))
797
- for _ in range(worker_count):
798
- source_queue.put(None)
799
-
800
- if callback:
801
- callback(0.0)
802
-
803
- workers = [Process(target=self._parallel_worker, args=(
804
- i,
805
- mem_sem_cast[i][0],
806
- mem_sem_cast[i][1],
807
- np_dtype,
808
- computation_window.xsize,
809
- source_queue,
810
- result_queue,
811
- computation_window
812
- )) for i in range(worker_count)]
813
- for worker in workers:
814
- worker.start()
815
-
816
- sentinal_count = len(workers)
817
- retired_blocks = 0
818
- while sentinal_count > 0:
819
- res = result_queue.get()
820
- if res is None:
821
- sentinal_count -= 1
822
- continue
823
- index, yoffset, step = res
824
- _, sem, arr = mem_sem_cast[index]
825
- if band:
826
- band.WriteArray(
827
- arr[0:step],
828
- destination_window.xoff,
829
- yoffset + destination_window.yoff,
774
+ with ExitStack() as stack:
775
+ # If we get this far, then we're going to do the multiprocessing path. In general we've had
776
+ # a lot of issues with limits on open file descriptors using multiprocessing on bigger machines
777
+ # with hundreds of cores, and so to avoid blowing up in a way that is confusing to non-compsci
778
+ # types, we just set the soft ulimit as high as we can
779
+ previous_fd_limit, max_fd_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
780
+ resource.setrlimit(resource.RLIMIT_NOFILE, (max_fd_limit, max_fd_limit))
781
+ stack.callback(resource.setrlimit, resource.RLIMIT_NOFILE, (previous_fd_limit, max_fd_limit))
782
+
783
+ with multiprocessing.Manager() as manager:
784
+ with SharedMemoryManager() as smm:
785
+
786
+ mem_sem_cast = []
787
+ for _ in range(worker_count):
788
+ shared_buf = smm.SharedMemory(size=np_dtype.itemsize * self.ystep * computation_window.xsize)
789
+ cast_buf : npt.NDArray = np.ndarray(
790
+ (self.ystep, computation_window.xsize),
791
+ dtype=np_dtype,
792
+ buffer=shared_buf.buf
830
793
  )
831
- if and_sum:
832
- total += np.sum(np.array(arr[0:step]).astype(np.float64))
833
- sem.release()
834
- retired_blocks += 1
794
+ cast_buf[:] = np.zeros((self.ystep, computation_window.xsize), np_dtype)
795
+ mem_sem_cast.append((shared_buf, Semaphore(), cast_buf))
796
+
797
+ source_queue = manager.Queue()
798
+ result_queue = manager.Queue()
799
+
800
+ for yoffset in range(0, computation_window.ysize, self.ystep):
801
+ step = ((computation_window.ysize - yoffset)
802
+ if yoffset+self.ystep > computation_window.ysize
803
+ else self.ystep)
804
+ source_queue.put((
805
+ yoffset,
806
+ step
807
+ ))
808
+ for _ in range(worker_count):
809
+ source_queue.put(None)
810
+
835
811
  if callback:
836
- callback(retired_blocks / work_blocks)
837
-
838
- processes = workers
839
- while processes:
840
- candidates = [x for x in processes if not x.is_alive()]
841
- for candidate in candidates:
842
- candidate.join()
843
- if candidate.exitcode:
844
- for victim in processes:
845
- victim.kill()
846
- sys.exit(candidate.exitcode)
847
- processes.remove(candidate)
848
- time.sleep(0.01)
812
+ callback(0.0)
813
+
814
+ workers = [Process(target=self._parallel_worker, args=(
815
+ i,
816
+ mem_sem_cast[i][0],
817
+ mem_sem_cast[i][1],
818
+ np_dtype,
819
+ computation_window.xsize,
820
+ source_queue,
821
+ result_queue,
822
+ computation_window
823
+ )) for i in range(worker_count)]
824
+ for worker in workers:
825
+ worker.start()
826
+
827
+ sentinal_count = len(workers)
828
+ retired_blocks = 0
829
+ while sentinal_count > 0:
830
+ res = result_queue.get()
831
+ if res is None:
832
+ sentinal_count -= 1
833
+ continue
834
+ index, yoffset, step = res
835
+ _, sem, arr = mem_sem_cast[index]
836
+ if band:
837
+ band.WriteArray(
838
+ arr[0:step],
839
+ destination_window.xoff,
840
+ yoffset + destination_window.yoff,
841
+ )
842
+ if and_sum:
843
+ total += np.sum(np.array(arr[0:step]).astype(np.float64))
844
+ sem.release()
845
+ retired_blocks += 1
846
+ if callback:
847
+ callback(retired_blocks / work_blocks)
848
+
849
+ processes = workers
850
+ while processes:
851
+ candidates = [x for x in processes if not x.is_alive()]
852
+ for candidate in candidates:
853
+ candidate.join()
854
+ if candidate.exitcode:
855
+ for victim in processes:
856
+ victim.kill()
857
+ sys.exit(candidate.exitcode)
858
+ processes.remove(candidate)
859
+ time.sleep(0.01)
849
860
 
850
861
  return total if and_sum else None
851
862
 
@@ -4,10 +4,11 @@ from typing import Any, Optional, Sequence, Tuple
4
4
  import deprecation
5
5
 
6
6
  from .. import __version__
7
- from ..operators import DataType, LayerMathMixin
7
+ from .._operators import LayerMathMixin
8
8
  from ..rounding import almost_equal, round_up_pixels, round_down_pixels
9
9
  from ..window import Area, MapProjection, PixelScale, Window
10
10
  from .._backends import backend
11
+ from .._backends.enumeration import dtype as DataType
11
12
 
12
13
  class YirgacheffeLayer(LayerMathMixin):
13
14
  """The common base class for the different layer types. Most still inherit from RasterLayer as deep down
@@ -1,10 +1,9 @@
1
1
  from typing import Any, Union
2
2
 
3
- from ..operators import DataType
4
3
  from ..window import Area, MapProjection, PixelScale, Window
5
4
  from .base import YirgacheffeLayer
6
5
  from .._backends import backend
7
-
6
+ from .._backends.enumeration import dtype as DataType
8
7
 
9
8
  class ConstantLayer(YirgacheffeLayer):
10
9
  """This is a layer that will return the identity value - can be used when an input layer is
@@ -6,13 +6,12 @@ from typing import Any, List, Optional, Sequence, Union
6
6
  import numpy as np
7
7
  from numpy import ma
8
8
 
9
- from ..operators import DataType
10
9
  from ..rounding import round_down_pixels
11
10
  from ..window import Area, Window
12
11
  from .base import YirgacheffeLayer
13
12
  from .rasters import RasterLayer
14
13
  from .._backends import backend
15
-
14
+ from .._backends.enumeration import dtype as DataType
16
15
 
17
16
  class GroupLayerEmpty(ValueError):
18
17
  def __init__(self, msg):
@@ -3,12 +3,12 @@ from typing import Any, Tuple
3
3
 
4
4
  import h3
5
5
  import numpy as np
6
- from yirgacheffe.operators import DataType
7
6
 
8
7
  from ..rounding import round_up_pixels
9
8
  from ..window import Area, MapProjection, Window
10
9
  from .base import YirgacheffeLayer
11
10
  from .._backends import backend
11
+ from .._backends.enumeration import dtype as DataType
12
12
 
13
13
  class H3CellLayer(YirgacheffeLayer):
14
14
 
@@ -10,8 +10,8 @@ from ..constants import WGS_84_PROJECTION
10
10
  from ..window import Area, MapProjection, PixelScale, Window
11
11
  from ..rounding import round_up_pixels
12
12
  from .base import YirgacheffeLayer
13
- from ..operators import DataType
14
13
  from .._backends import backend
14
+ from .._backends.enumeration import dtype as DataType
15
15
 
16
16
  class InvalidRasterBand(Exception):
17
17
  def __init__ (self, band):
@@ -4,11 +4,11 @@ from pathlib import Path
4
4
  from typing import Any, Optional, Union
5
5
 
6
6
  from skimage import transform
7
- from yirgacheffe.operators import DataType
8
7
 
9
8
  from ..window import MapProjection, PixelScale, Window
10
9
  from .rasters import RasterLayer, YirgacheffeLayer
11
10
  from .._backends import backend
11
+ from .._backends.enumeration import dtype as DataType
12
12
 
13
13
 
14
14
  class RescaledRasterLayer(YirgacheffeLayer):
@@ -8,11 +8,11 @@ import deprecation
8
8
  from osgeo import gdal, ogr
9
9
 
10
10
  from .. import __version__
11
- from ..operators import DataType
12
11
  from ..window import Area, MapProjection, PixelScale
13
12
  from .base import YirgacheffeLayer
14
13
  from .rasters import RasterLayer
15
14
  from .._backends import backend
15
+ from .._backends.enumeration import dtype as DataType
16
16
 
17
17
  def _validate_burn_value(burn_value: Any, layer: ogr.Layer) -> DataType: # pylint: disable=R0911
18
18
  if isinstance(burn_value, str):
@@ -0,0 +1,7 @@
1
+ # Eventually all this should be moved to the top level in 2.0, but for backwards compatibility in 1.x needs
2
+ # to remain here
3
+
4
+ from ._operators import where, minumum, maximum, clip, log, log2, log10, exp, exp2, nan_to_num, isin, \
5
+ floor, ceil # pylint: disable=W0611
6
+ from ._operators import abs, round # pylint: disable=W0611,W0622
7
+ from ._backends.enumeration import dtype as DataType # pylint: disable=W0611
File without changes
@@ -174,7 +174,7 @@ class Window:
174
174
  Y axis offset
175
175
  xsize : int
176
176
  Width of data in pixels
177
- bottom : float
177
+ ysize : float
178
178
  Height of data in pixels
179
179
 
180
180
  Attributes
@@ -185,7 +185,7 @@ class Window:
185
185
  Y axis offset
186
186
  xsize : int
187
187
  Width of data in pixels
188
- bottom : float
188
+ ysize : float
189
189
  Height of data in pixels
190
190
  """
191
191
  xoff: int
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yirgacheffe
3
- Version: 1.7.6
3
+ Version: 1.7.8
4
4
  Summary: Abstraction of gdal datasets for doing basic math operations
5
5
  Author-email: Michael Dales <mwd24@cam.ac.uk>
6
6
  License-Expression: ISC
@@ -8,13 +8,20 @@ Project-URL: Homepage, https://github.com/quantifyearth/yirgacheffe
8
8
  Project-URL: Repository, https://github.com/quantifyearth/yirgacheffe.git
9
9
  Project-URL: Issues, https://github.com/quantifyearth/yirgacheffe/issues
10
10
  Project-URL: Changelog, https://github.com/quantifyearth/yirgacheffe/blob/main/CHANGES.md
11
- Keywords: gdal,numpy,math
11
+ Keywords: gdal,gis,geospatial,declarative
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Scientific/Engineering :: GIS
12
19
  Requires-Python: >=3.10
13
20
  Description-Content-Type: text/markdown
14
21
  License-File: LICENSE
15
- Requires-Dist: numpy
16
- Requires-Dist: gdal[numpy]
17
- Requires-Dist: scikit-image
22
+ Requires-Dist: numpy<3.0,>=1.24
23
+ Requires-Dist: gdal[numpy]<4.0,>=3.8
24
+ Requires-Dist: scikit-image<1.0,>=0.20
18
25
  Requires-Dist: torch
19
26
  Requires-Dist: dill
20
27
  Requires-Dist: deprecation
@@ -29,8 +29,10 @@ tests/test_vectors.py
29
29
  tests/test_window.py
30
30
  yirgacheffe/__init__.py
31
31
  yirgacheffe/_core.py
32
+ yirgacheffe/_operators.py
32
33
  yirgacheffe/constants.py
33
34
  yirgacheffe/operators.py
35
+ yirgacheffe/py.typed
34
36
  yirgacheffe/rounding.py
35
37
  yirgacheffe/window.py
36
38
  yirgacheffe.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
1
- numpy
2
- gdal[numpy]
3
- scikit-image
1
+ numpy<3.0,>=1.24
2
+ gdal[numpy]<4.0,>=3.8
3
+ scikit-image<1.0,>=0.20
4
4
  torch
5
5
  dill
6
6
  deprecation
File without changes
File without changes
File without changes
File without changes