yirgacheffe 1.6.0__tar.gz → 1.6.1__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 (55) hide show
  1. {yirgacheffe-1.6.0/yirgacheffe.egg-info → yirgacheffe-1.6.1}/PKG-INFO +3 -3
  2. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/README.md +2 -2
  3. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/pyproject.toml +1 -1
  4. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_operators.py +12 -0
  5. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/operators.py +8 -0
  6. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1/yirgacheffe.egg-info}/PKG-INFO +3 -3
  7. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/LICENSE +0 -0
  8. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/MANIFEST.in +0 -0
  9. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/setup.cfg +0 -0
  10. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_area.py +0 -0
  11. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_auto_windowing.py +0 -0
  12. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_base.py +0 -0
  13. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_constants.py +0 -0
  14. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_datatypes.py +0 -0
  15. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_group.py +0 -0
  16. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_h3layer.py +0 -0
  17. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_intersection.py +0 -0
  18. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_multiband.py +0 -0
  19. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_nodata.py +0 -0
  20. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_openers.py +0 -0
  21. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_optimisation.py +0 -0
  22. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_parallel_operators.py +0 -0
  23. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_pickle.py +0 -0
  24. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_raster.py +0 -0
  25. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_rescaling.py +0 -0
  26. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_rounding.py +0 -0
  27. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_save_with_window.py +0 -0
  28. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_sum_with_window.py +0 -0
  29. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_uniform_area_layer.py +0 -0
  30. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_union.py +0 -0
  31. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_vectors.py +0 -0
  32. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/tests/test_window.py +0 -0
  33. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/__init__.py +0 -0
  34. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/_backends/__init__.py +0 -0
  35. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/_backends/enumeration.py +0 -0
  36. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/_backends/mlx.py +0 -0
  37. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/_backends/numpy.py +0 -0
  38. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/_core.py +0 -0
  39. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/constants.py +0 -0
  40. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/layers/__init__.py +0 -0
  41. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/layers/area.py +0 -0
  42. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/layers/base.py +0 -0
  43. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/layers/constant.py +0 -0
  44. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/layers/group.py +0 -0
  45. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/layers/h3layer.py +0 -0
  46. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/layers/rasters.py +0 -0
  47. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/layers/rescaled.py +0 -0
  48. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/layers/vectors.py +0 -0
  49. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/rounding.py +0 -0
  50. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe/window.py +0 -0
  51. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe.egg-info/SOURCES.txt +0 -0
  52. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe.egg-info/dependency_links.txt +0 -0
  53. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe.egg-info/entry_points.txt +0 -0
  54. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/yirgacheffe.egg-info/requires.txt +0 -0
  55. {yirgacheffe-1.6.0 → yirgacheffe-1.6.1}/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.6.0
3
+ Version: 1.6.1
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
@@ -71,8 +71,8 @@ print(f'area for species 123: {aoh.sum()}')
71
71
  Similarly, you could save the result to a new raster layer:
72
72
 
73
73
  ```python
74
- ...
75
- aoh.to_geotiff("result.tif")
74
+ ...
75
+ aoh.to_geotiff("result.tif")
76
76
  ```
77
77
 
78
78
  Yirgacheffe will automatically infer if you want to do an intersection of maps or a union of the maps based on the operators you use (see below for a full table). You can explicitly override that if you want.
@@ -46,8 +46,8 @@ print(f'area for species 123: {aoh.sum()}')
46
46
  Similarly, you could save the result to a new raster layer:
47
47
 
48
48
  ```python
49
- ...
50
- aoh.to_geotiff("result.tif")
49
+ ...
50
+ aoh.to_geotiff("result.tif")
51
51
  ```
52
52
 
53
53
  Yirgacheffe will automatically infer if you want to do an intersection of maps or a union of the maps based on the operators you use (see below for a full table). You can explicitly override that if you want.
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "yirgacheffe"
9
- version = "1.6.0"
9
+ version = "1.6.1"
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" }]
@@ -1416,6 +1416,18 @@ def test_ceil_module() -> None:
1416
1416
  actual = result.read_array(0, 0, 4, 2)
1417
1417
  assert (expected == actual).all()
1418
1418
 
1419
+ def test_to_geotiff_on_layer() -> None:
1420
+ data1 = np.array([[1, 2, 3, 4], [5, 6, 7, 8]])
1421
+ layer1 = RasterLayer(gdal_dataset_with_data((0.0, 0.0), 0.02, data1))
1422
+
1423
+ with tempfile.TemporaryDirectory() as tempdir:
1424
+ filename = os.path.join(tempdir, "test.tif")
1425
+ layer1.to_geotiff(filename)
1426
+
1427
+ with RasterLayer.layer_from_file(filename) as result:
1428
+ actual = result.read_array(0, 0, 4, 2)
1429
+ assert (data1 == actual).all()
1430
+
1419
1431
  def test_to_geotiff_single_thread() -> None:
1420
1432
  data1 = np.array([[1, 2, 3, 4], [5, 6, 7, 8]])
1421
1433
  layer1 = RasterLayer(gdal_dataset_with_data((0.0, 0.0), 0.02, data1))
@@ -229,6 +229,14 @@ class LayerMathMixin:
229
229
  def parallel_sum(self, callback=None, parallelism=None, band=1):
230
230
  return LayerOperation(self).parallel_sum(callback, parallelism, band)
231
231
 
232
+ def to_geotiff(
233
+ self,
234
+ filename: Union[Path,str],
235
+ and_sum: bool = False,
236
+ parallelism:Optional[int]=None
237
+ ) -> Optional[float]:
238
+ return LayerOperation(self).to_geotiff(filename, and_sum, parallelism)
239
+
232
240
  def sum(self):
233
241
  return LayerOperation(self).sum()
234
242
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yirgacheffe
3
- Version: 1.6.0
3
+ Version: 1.6.1
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
@@ -71,8 +71,8 @@ print(f'area for species 123: {aoh.sum()}')
71
71
  Similarly, you could save the result to a new raster layer:
72
72
 
73
73
  ```python
74
- ...
75
- aoh.to_geotiff("result.tif")
74
+ ...
75
+ aoh.to_geotiff("result.tif")
76
76
  ```
77
77
 
78
78
  Yirgacheffe will automatically infer if you want to do an intersection of maps or a union of the maps based on the operators you use (see below for a full table). You can explicitly override that if you want.
File without changes
File without changes
File without changes