yirgacheffe 1.7.5__py3-none-any.whl → 1.7.7__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.
- yirgacheffe/__init__.py +1 -1
- yirgacheffe/_core.py +50 -1
- yirgacheffe/_operators.py +982 -0
- yirgacheffe/layers/base.py +2 -1
- yirgacheffe/layers/constant.py +1 -2
- yirgacheffe/layers/group.py +1 -2
- yirgacheffe/layers/h3layer.py +1 -1
- yirgacheffe/layers/rasters.py +7 -3
- yirgacheffe/layers/rescaled.py +1 -1
- yirgacheffe/layers/vectors.py +9 -1
- yirgacheffe/operators.py +6 -1010
- yirgacheffe/window.py +2 -2
- {yirgacheffe-1.7.5.dist-info → yirgacheffe-1.7.7.dist-info}/METADATA +21 -5
- yirgacheffe-1.7.7.dist-info/RECORD +26 -0
- yirgacheffe-1.7.5.dist-info/RECORD +0 -25
- {yirgacheffe-1.7.5.dist-info → yirgacheffe-1.7.7.dist-info}/WHEEL +0 -0
- {yirgacheffe-1.7.5.dist-info → yirgacheffe-1.7.7.dist-info}/entry_points.txt +0 -0
- {yirgacheffe-1.7.5.dist-info → yirgacheffe-1.7.7.dist-info}/licenses/LICENSE +0 -0
- {yirgacheffe-1.7.5.dist-info → yirgacheffe-1.7.7.dist-info}/top_level.txt +0 -0
yirgacheffe/window.py
CHANGED
|
@@ -174,7 +174,7 @@ class Window:
|
|
|
174
174
|
Y axis offset
|
|
175
175
|
xsize : int
|
|
176
176
|
Width of data in pixels
|
|
177
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
Version: 1.7.7
|
|
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
|
|
@@ -262,17 +262,33 @@ Notes:
|
|
|
262
262
|
* You can have missing tiles, and these will be filled in with zeros.
|
|
263
263
|
* You can have tiles that overlap, so long as they still conform to the rule that all tiles are the same size and on a grid.
|
|
264
264
|
|
|
265
|
-
###
|
|
265
|
+
### Constants
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
At times it is useful to have a fixed constant in an expression. Typically, similar to numpy, if an expression involving layers has a constant in, Yirgacheffe will apply that to all pixels in the equation without need for further elaboration:
|
|
268
|
+
|
|
269
|
+
```python
|
|
270
|
+
with yg.read_raster("some_data.tif") as layer:
|
|
271
|
+
doubled_layer = layer * 2.0
|
|
272
|
+
...
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
This can be useful in tasks where you have an optional layer in your code. For example, here the code optionally loads an area-per-pixel layer, which if not present can just be substituted with a 1.0:
|
|
268
276
|
|
|
269
277
|
```python
|
|
270
278
|
try:
|
|
271
|
-
area_layer =
|
|
279
|
+
area_layer = yg.read_raster('myarea.tiff')
|
|
272
280
|
except FileDoesNotExist:
|
|
273
|
-
area_layer =
|
|
281
|
+
area_layer = 1.0
|
|
274
282
|
```
|
|
275
283
|
|
|
284
|
+
However, as with numpy, Python can not make the correct inference if the constant value is the first term in the equation. In that case you need to explicitly wrap the value with `constant` to help Python understand what is happening:
|
|
285
|
+
|
|
286
|
+
```python
|
|
287
|
+
with yg.read_raster("some_data.tif") as layer:
|
|
288
|
+
result = yg.constant(1.0) / layer
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
|
|
276
292
|
### H3CellLayer
|
|
277
293
|
|
|
278
294
|
If you have H3 installed, you can generate a mask layer based on an H3 cell identifier, where pixels inside the cell will have a value of 1, and those outside will have a value of 0.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
yirgacheffe/__init__.py,sha256=pY9dqmHHARfY44T-7-7y6Ah97qQHj9_0pgYTItI5TR8,567
|
|
2
|
+
yirgacheffe/_core.py,sha256=hnACrthBI8OFNoi88-Qnj-4aizBGZstFO7kj-5g9MSU,6083
|
|
3
|
+
yirgacheffe/_operators.py,sha256=wI0JPbIQyYjPKAlkfaBfshNx5JVNaTohvjucytWaFw4,35607
|
|
4
|
+
yirgacheffe/constants.py,sha256=uCWJwec3-ND-zVxYbsk1sdHKANl3ToNCTPg7MZb0j2g,434
|
|
5
|
+
yirgacheffe/operators.py,sha256=nw-BpnAwTjCwFtjosa8wKd2MGUuC0PJR5jACFdLhqCg,412
|
|
6
|
+
yirgacheffe/rounding.py,sha256=ggBG4lMyLMtHLW3dBxr3gBCcF2qhRrY5etZiFGlIoqA,2258
|
|
7
|
+
yirgacheffe/window.py,sha256=Oxf8VcslLxNacqjUcDHqZLvdMaTnIwuNwjsm1WEOc0g,9503
|
|
8
|
+
yirgacheffe/_backends/__init__.py,sha256=jN-2iRrHStnPI6cNL7XhwhsROtI0EaGfIrbF5c-ECV0,334
|
|
9
|
+
yirgacheffe/_backends/enumeration.py,sha256=Jrce2p2n4Wlk5tHBkiWntDnpLSD_0H-bnwgsKXHjkwQ,1018
|
|
10
|
+
yirgacheffe/_backends/mlx.py,sha256=kEWcJOhhUQSHkRPljv6s0MYlxcuu-LzLL55Fdd8tIqc,6171
|
|
11
|
+
yirgacheffe/_backends/numpy.py,sha256=IdAgK8oFZxjzK1I_-_yXYu_G935920GxpB6oZoJvWvQ,4110
|
|
12
|
+
yirgacheffe/layers/__init__.py,sha256=mYKjw5YTcMNv_hMy7a6K4yRzIuNUbR8WuBTw4WIAmSk,435
|
|
13
|
+
yirgacheffe/layers/area.py,sha256=OFOM1_dMblzXLW29TwEqfdgSecl6aNs04bKJwUydLH0,3914
|
|
14
|
+
yirgacheffe/layers/base.py,sha256=-7QIfAI3iGlzt-dDLztpRaLrL2sSqB1y2Yw2TdJ9VJM,14426
|
|
15
|
+
yirgacheffe/layers/constant.py,sha256=8wfyw1JOxr5FQv_M9Jzbd6vW2rjK3AJHmoe-ftDmPlM,1457
|
|
16
|
+
yirgacheffe/layers/group.py,sha256=hK84oCAweaX2eQP0DXPd_uHj1aVdTD9F-gaCRPfjxmY,16202
|
|
17
|
+
yirgacheffe/layers/h3layer.py,sha256=t8yC3c8pXU5qbFqsfP76ZX8UHkW9lK4ZgnNm4pwTjls,9886
|
|
18
|
+
yirgacheffe/layers/rasters.py,sha256=9Wgvr-WeavU7VELTz5Q-rwWQIN3g5E9TbEY8-yERpjk,13586
|
|
19
|
+
yirgacheffe/layers/rescaled.py,sha256=jbr2GxFy3I29vudX0oyMaFRTimrbEcAPI6dnHvjWpfU,3377
|
|
20
|
+
yirgacheffe/layers/vectors.py,sha256=c8QWeKF1umBGo5BYyJPl-CN_EfjxdTGNaQJDfAkvTIM,20139
|
|
21
|
+
yirgacheffe-1.7.7.dist-info/licenses/LICENSE,sha256=dNSHwUCJr6axStTKDEdnJtfmDdFqlE3h1NPCveqPfnY,757
|
|
22
|
+
yirgacheffe-1.7.7.dist-info/METADATA,sha256=FfXMda6MkjVV05yZkV3iBa72wHAu36xvyQQkXb_GQUU,23134
|
|
23
|
+
yirgacheffe-1.7.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
+
yirgacheffe-1.7.7.dist-info/entry_points.txt,sha256=j4KgHXbVGbGyfTySc1ypBdERpfihO4WNjppvCdE9HjE,52
|
|
25
|
+
yirgacheffe-1.7.7.dist-info/top_level.txt,sha256=9DBFlKO2Ld3hG6TuE3qOTd3Tt8ugTiXil4AN4Wr9_y0,12
|
|
26
|
+
yirgacheffe-1.7.7.dist-info/RECORD,,
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
yirgacheffe/__init__.py,sha256=flTXNQQs6k8nboEv9O4eJnlv8kZ11z5zrfWcmUovCLg,537
|
|
2
|
-
yirgacheffe/_core.py,sha256=2CtRkVOpXBhFnj4fnpwSQBL3lJIvAmQJ4AgsMmKJOSs,4193
|
|
3
|
-
yirgacheffe/constants.py,sha256=uCWJwec3-ND-zVxYbsk1sdHKANl3ToNCTPg7MZb0j2g,434
|
|
4
|
-
yirgacheffe/operators.py,sha256=DNZFBHRqwlZq8HHNv72vU5jDBwikDCyuwyo8RmE59bg,36228
|
|
5
|
-
yirgacheffe/rounding.py,sha256=ggBG4lMyLMtHLW3dBxr3gBCcF2qhRrY5etZiFGlIoqA,2258
|
|
6
|
-
yirgacheffe/window.py,sha256=0Wy3BT4SZLyviDwzLcX8LYOo2MeZ2zXCWAiJNpMbQpc,9505
|
|
7
|
-
yirgacheffe/_backends/__init__.py,sha256=jN-2iRrHStnPI6cNL7XhwhsROtI0EaGfIrbF5c-ECV0,334
|
|
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
|
-
yirgacheffe/layers/__init__.py,sha256=mYKjw5YTcMNv_hMy7a6K4yRzIuNUbR8WuBTw4WIAmSk,435
|
|
12
|
-
yirgacheffe/layers/area.py,sha256=OFOM1_dMblzXLW29TwEqfdgSecl6aNs04bKJwUydLH0,3914
|
|
13
|
-
yirgacheffe/layers/base.py,sha256=MPVGEsFRPuRDYtL1OBu7XP26kBDWfpS3RS3twYKBOQc,14381
|
|
14
|
-
yirgacheffe/layers/constant.py,sha256=XQ1ibeSckAcUOow-dMUlZiW5S2MKeFquOz_m8Y027GI,1437
|
|
15
|
-
yirgacheffe/layers/group.py,sha256=YgA0Bl0lAO2KwTT57126rXfyPq6MCssaaFrTQLe377s,16182
|
|
16
|
-
yirgacheffe/layers/h3layer.py,sha256=Ys6F-e4Jre7lbFBYErF_4oidQx22WkWMKpHpQ7pPDTs,9875
|
|
17
|
-
yirgacheffe/layers/rasters.py,sha256=-yECyz3Odhy1er0ilJ9bfLUseI2cTHfwqhP-H3ImUKo,13365
|
|
18
|
-
yirgacheffe/layers/rescaled.py,sha256=hkvsd7paDCyUViABxrAXdXPOZegdwiphibkdrBuRclk,3366
|
|
19
|
-
yirgacheffe/layers/vectors.py,sha256=OpZaV2MgM0v4-CbrCNy_AHv3T2bvV9PFytolIzPPXFc,19900
|
|
20
|
-
yirgacheffe-1.7.5.dist-info/licenses/LICENSE,sha256=dNSHwUCJr6axStTKDEdnJtfmDdFqlE3h1NPCveqPfnY,757
|
|
21
|
-
yirgacheffe-1.7.5.dist-info/METADATA,sha256=-XwJ5i06q614NG1srNCCZJD9GklmXjIXqZexihiujQY,22588
|
|
22
|
-
yirgacheffe-1.7.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
23
|
-
yirgacheffe-1.7.5.dist-info/entry_points.txt,sha256=j4KgHXbVGbGyfTySc1ypBdERpfihO4WNjppvCdE9HjE,52
|
|
24
|
-
yirgacheffe-1.7.5.dist-info/top_level.txt,sha256=9DBFlKO2Ld3hG6TuE3qOTd3Tt8ugTiXil4AN4Wr9_y0,12
|
|
25
|
-
yirgacheffe-1.7.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|