yirgacheffe 1.7.1__py3-none-any.whl → 1.7.2__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/operators.py CHANGED
@@ -251,7 +251,7 @@ class LayerMathMixin:
251
251
  self,
252
252
  filename: Union[Path,str],
253
253
  and_sum: bool = False,
254
- parallelism:Optional[int]=None
254
+ parallelism:Optional[Union[int,bool]]=None
255
255
  ) -> Optional[float]:
256
256
  return LayerOperation(self).to_geotiff(filename, and_sum, parallelism)
257
257
 
@@ -899,7 +899,7 @@ class LayerOperation(LayerMathMixin):
899
899
  self,
900
900
  filename: Union[Path,str],
901
901
  and_sum: bool = False,
902
- parallelism:Optional[int]=None
902
+ parallelism:Optional[Union[int,bool]] = None
903
903
  ) -> Optional[float]:
904
904
  """Saves a calculation to a raster file, optionally also returning the sum of pixels.
905
905
 
@@ -909,8 +909,9 @@ class LayerOperation(LayerMathMixin):
909
909
  Path of the raster to save the result to.
910
910
  and_sum : bool, default=False
911
911
  If true then the function will also calculate the sum of the raster as it goes and return that value.
912
- parallelism : int, optional, default=None
913
- If passed, attempt to use multiple CPU cores up to the number provided.
912
+ parallelism : int or bool, optional, default=None
913
+ If passed, attempt to use multiple CPU cores up to the number provided, or if set to True, yirgacheffe
914
+ will pick a sensible value.
914
915
 
915
916
  Returns
916
917
  -------
@@ -932,6 +933,9 @@ class LayerOperation(LayerMathMixin):
932
933
  if parallelism is None:
933
934
  result = self.save(layer, and_sum=and_sum)
934
935
  else:
936
+ if isinstance(parallelism, bool):
937
+ # Parallel save treats None as "work it out"
938
+ parallelism = None
935
939
  result = self.parallel_save(layer, and_sum=and_sum, parallelism=parallelism)
936
940
 
937
941
  os.makedirs(target_dir, exist_ok=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yirgacheffe
3
- Version: 1.7.1
3
+ Version: 1.7.2
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
@@ -1,7 +1,7 @@
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=fqk61NW_BjNuuBVPx_nvxPbgBs839cx6WztGOxrtiuE,35653
4
+ yirgacheffe/operators.py,sha256=yFO43w05YNczxpWvRu7y223Lenu1sqLUHly0R4EWUbw,35925
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
@@ -17,9 +17,9 @@ yirgacheffe/layers/h3layer.py,sha256=Ys6F-e4Jre7lbFBYErF_4oidQx22WkWMKpHpQ7pPDTs
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.1.dist-info/licenses/LICENSE,sha256=dNSHwUCJr6axStTKDEdnJtfmDdFqlE3h1NPCveqPfnY,757
21
- yirgacheffe-1.7.1.dist-info/METADATA,sha256=KJuxRRohoo57E8Vcaft3WsItttbVaFK5eAHsf0GRMos,22351
22
- yirgacheffe-1.7.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- yirgacheffe-1.7.1.dist-info/entry_points.txt,sha256=j4KgHXbVGbGyfTySc1ypBdERpfihO4WNjppvCdE9HjE,52
24
- yirgacheffe-1.7.1.dist-info/top_level.txt,sha256=9DBFlKO2Ld3hG6TuE3qOTd3Tt8ugTiXil4AN4Wr9_y0,12
25
- yirgacheffe-1.7.1.dist-info/RECORD,,
20
+ yirgacheffe-1.7.2.dist-info/licenses/LICENSE,sha256=dNSHwUCJr6axStTKDEdnJtfmDdFqlE3h1NPCveqPfnY,757
21
+ yirgacheffe-1.7.2.dist-info/METADATA,sha256=5_xSRySwK7HSzhOKEPMcUzX1RpmVXH1E-CEmo5dhtsE,22351
22
+ yirgacheffe-1.7.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ yirgacheffe-1.7.2.dist-info/entry_points.txt,sha256=j4KgHXbVGbGyfTySc1ypBdERpfihO4WNjppvCdE9HjE,52
24
+ yirgacheffe-1.7.2.dist-info/top_level.txt,sha256=9DBFlKO2Ld3hG6TuE3qOTd3Tt8ugTiXil4AN4Wr9_y0,12
25
+ yirgacheffe-1.7.2.dist-info/RECORD,,