yirgacheffe 1.7.3__py3-none-any.whl → 1.7.4__py3-none-any.whl

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.

@@ -38,6 +38,7 @@ class operators(Enum):
38
38
  FLOOR = 33
39
39
  ROUND = 34
40
40
  CEIL = 35
41
+ ISNAN = 36
41
42
 
42
43
  class dtype(Enum):
43
44
  Float32 = gdal.GDT_Float32
@@ -40,6 +40,7 @@ maximum = mx.maximum
40
40
  minimum = mx.minimum
41
41
  zeros = mx.zeros
42
42
  pad = mx.pad
43
+ isnan = mx.isnan
43
44
  isscalar = np.isscalar
44
45
  full = mx.full
45
46
  allclose = mx.allclose
@@ -218,4 +219,5 @@ operator_map : Dict[op,Callable] = {
218
219
  op.FLOOR: mx.floor,
219
220
  op.ROUND: mx.round,
220
221
  op.CEIL: mx.ceil,
222
+ op.ISNAN: mx.isnan,
221
223
  }
@@ -43,6 +43,7 @@ minimum = np.minimum
43
43
  zeros = np.zeros
44
44
  pad = np.pad
45
45
  sum_op = lambda a: np.sum(a.astype(np.float64))
46
+ isnan = np.isnan
46
47
  isscalar = np.isscalar
47
48
  full = np.full
48
49
  allclose = np.allclose
@@ -156,4 +157,5 @@ operator_map : Dict[op,Callable] = {
156
157
  op.FLOOR: np.floor,
157
158
  op.ROUND: np.round,
158
159
  op.CEIL: np.ceil,
160
+ op.ISNAN: np.isnan,
159
161
  }
@@ -114,8 +114,9 @@ class GroupLayer(YirgacheffeLayer):
114
114
  if (xsize <= 0) or (ysize <= 0):
115
115
  raise ValueError("Request dimensions must be positive and non-zero")
116
116
 
117
- scale = self.pixel_scale
118
- assert scale is not None
117
+ map_projection = self.map_projection
118
+ assert map_projection is not None
119
+ scale = map_projection.scale
119
120
 
120
121
  target_window = Window(
121
122
  window.xoff + xoffset,
@@ -151,7 +152,7 @@ class GroupLayer(YirgacheffeLayer):
151
152
  intersection.ysize
152
153
  )
153
154
  if layer.nodata is not None:
154
- data[data.isnan()] = 0.0
155
+ data = backend.where(backend.isnan(data), 0.0, data)
155
156
  return data
156
157
 
157
158
  result = np.zeros((ysize, xsize), dtype=float)
yirgacheffe/operators.py CHANGED
@@ -139,6 +139,13 @@ class LayerMathMixin:
139
139
  test_elements=test_elements,
140
140
  )
141
141
 
142
+ def isnan(self):
143
+ return LayerOperation(
144
+ self,
145
+ op.ISNAN,
146
+ window_op=WindowOperation.NONE,
147
+ )
148
+
142
149
  def abs(self):
143
150
  return LayerOperation(
144
151
  self,
@@ -1,10 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yirgacheffe
3
- Version: 1.7.3
3
+ Version: 1.7.4
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
7
7
  Project-URL: Homepage, https://github.com/quantifyearth/yirgacheffe
8
+ Project-URL: Repository, https://github.com/quantifyearth/yirgacheffe.git
9
+ Project-URL: Issues, https://github.com/quantifyearth/yirgacheffe/issues
10
+ Project-URL: Changelog, https://github.com/quantifyearth/yirgacheffe/blob/main/CHANGES.md
8
11
  Keywords: gdal,numpy,math
9
12
  Requires-Python: >=3.10
10
13
  Description-Content-Type: text/markdown
@@ -1,25 +1,25 @@
1
1
  yirgacheffe/__init__.py,sha256=flTXNQQs6k8nboEv9O4eJnlv8kZ11z5zrfWcmUovCLg,537
2
2
  yirgacheffe/_core.py,sha256=2CtRkVOpXBhFnj4fnpwSQBL3lJIvAmQJ4AgsMmKJOSs,4193
3
3
  yirgacheffe/constants.py,sha256=uCWJwec3-ND-zVxYbsk1sdHKANl3ToNCTPg7MZb0j2g,434
4
- yirgacheffe/operators.py,sha256=FhW6A6AQ-ElzxPT23L9UtX5hv0gcBXBwyri66rMTS-U,36081
4
+ yirgacheffe/operators.py,sha256=DNZFBHRqwlZq8HHNv72vU5jDBwikDCyuwyo8RmE59bg,36228
5
5
  yirgacheffe/rounding.py,sha256=ggBG4lMyLMtHLW3dBxr3gBCcF2qhRrY5etZiFGlIoqA,2258
6
6
  yirgacheffe/window.py,sha256=0Wy3BT4SZLyviDwzLcX8LYOo2MeZ2zXCWAiJNpMbQpc,9505
7
7
  yirgacheffe/_backends/__init__.py,sha256=jN-2iRrHStnPI6cNL7XhwhsROtI0EaGfIrbF5c-ECV0,334
8
- yirgacheffe/_backends/enumeration.py,sha256=pADawllxpW_hW-IVVvZpHWIKzvEMs9aaqfkZRD1zjnY,1003
9
- yirgacheffe/_backends/mlx.py,sha256=2vOTMqHbQbeqt81Eq_8hxWDXZHaPsDpbXkALRVGEnnw,6130
10
- yirgacheffe/_backends/numpy.py,sha256=cYO628s4-5K_-Bp3CrnHegzYSZfkt2QC8iE9oOOMtvA,4069
8
+ yirgacheffe/_backends/enumeration.py,sha256=Jrce2p2n4Wlk5tHBkiWntDnpLSD_0H-bnwgsKXHjkwQ,1018
9
+ yirgacheffe/_backends/mlx.py,sha256=kEWcJOhhUQSHkRPljv6s0MYlxcuu-LzLL55Fdd8tIqc,6171
10
+ yirgacheffe/_backends/numpy.py,sha256=IdAgK8oFZxjzK1I_-_yXYu_G935920GxpB6oZoJvWvQ,4110
11
11
  yirgacheffe/layers/__init__.py,sha256=mYKjw5YTcMNv_hMy7a6K4yRzIuNUbR8WuBTw4WIAmSk,435
12
12
  yirgacheffe/layers/area.py,sha256=OFOM1_dMblzXLW29TwEqfdgSecl6aNs04bKJwUydLH0,3914
13
13
  yirgacheffe/layers/base.py,sha256=MPVGEsFRPuRDYtL1OBu7XP26kBDWfpS3RS3twYKBOQc,14381
14
14
  yirgacheffe/layers/constant.py,sha256=XQ1ibeSckAcUOow-dMUlZiW5S2MKeFquOz_m8Y027GI,1437
15
- yirgacheffe/layers/group.py,sha256=QyrECH5IthmBVV1debqttNvZGVocE-azdayJsvd6qqI,16096
15
+ yirgacheffe/layers/group.py,sha256=YgA0Bl0lAO2KwTT57126rXfyPq6MCssaaFrTQLe377s,16182
16
16
  yirgacheffe/layers/h3layer.py,sha256=Ys6F-e4Jre7lbFBYErF_4oidQx22WkWMKpHpQ7pPDTs,9875
17
17
  yirgacheffe/layers/rasters.py,sha256=-yECyz3Odhy1er0ilJ9bfLUseI2cTHfwqhP-H3ImUKo,13365
18
18
  yirgacheffe/layers/rescaled.py,sha256=hkvsd7paDCyUViABxrAXdXPOZegdwiphibkdrBuRclk,3366
19
19
  yirgacheffe/layers/vectors.py,sha256=OpZaV2MgM0v4-CbrCNy_AHv3T2bvV9PFytolIzPPXFc,19900
20
- yirgacheffe-1.7.3.dist-info/licenses/LICENSE,sha256=dNSHwUCJr6axStTKDEdnJtfmDdFqlE3h1NPCveqPfnY,757
21
- yirgacheffe-1.7.3.dist-info/METADATA,sha256=VA_iyH9HrhwwNwHPSCmQc9K54nHPBSCSb6L3Bbvm1Zw,22351
22
- yirgacheffe-1.7.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- yirgacheffe-1.7.3.dist-info/entry_points.txt,sha256=j4KgHXbVGbGyfTySc1ypBdERpfihO4WNjppvCdE9HjE,52
24
- yirgacheffe-1.7.3.dist-info/top_level.txt,sha256=9DBFlKO2Ld3hG6TuE3qOTd3Tt8ugTiXil4AN4Wr9_y0,12
25
- yirgacheffe-1.7.3.dist-info/RECORD,,
20
+ yirgacheffe-1.7.4.dist-info/licenses/LICENSE,sha256=dNSHwUCJr6axStTKDEdnJtfmDdFqlE3h1NPCveqPfnY,757
21
+ yirgacheffe-1.7.4.dist-info/METADATA,sha256=-HBVApZog3E94bukfIQJD6SLrg9feJiLm8tLr2Kt7cU,22588
22
+ yirgacheffe-1.7.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ yirgacheffe-1.7.4.dist-info/entry_points.txt,sha256=j4KgHXbVGbGyfTySc1ypBdERpfihO4WNjppvCdE9HjE,52
24
+ yirgacheffe-1.7.4.dist-info/top_level.txt,sha256=9DBFlKO2Ld3hG6TuE3qOTd3Tt8ugTiXil4AN4Wr9_y0,12
25
+ yirgacheffe-1.7.4.dist-info/RECORD,,