ssb-sgis 1.0.11__tar.gz → 1.0.13__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.
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/PKG-INFO +1 -1
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/pyproject.toml +1 -1
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/maps/explore.py +37 -16
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/raster/image_collection.py +37 -47
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/LICENSE +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/README.md +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/__init__.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/debug_config.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/exceptions.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/__init__.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/bounds.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/buffer_dissolve_explode.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/centerlines.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/cleaning.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/conversion.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/duplicates.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/general.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/geocoding.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/geometry_types.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/neighbors.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/overlay.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/point_operations.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/polygon_operations.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/polygons_as_rings.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/geopandas_tools/sfilter.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/helpers.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/io/_is_dapla.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/io/dapla_functions.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/io/opener.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/io/read_parquet.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/maps/__init__.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/maps/examine.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/maps/httpserver.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/maps/legend.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/maps/map.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/maps/maps.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/maps/thematicmap.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/maps/tilesources.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/__init__.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/_get_route.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/_od_cost_matrix.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/_points.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/_service_area.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/closing_network_holes.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/cutting_lines.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/directednetwork.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/finding_isolated_networks.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/network.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/networkanalysis.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/networkanalysisrules.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/nodes.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/networkanalysis/traveling_salesman.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/parallel/parallel.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/py.typed +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/raster/__init__.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/raster/base.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/raster/indices.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/raster/regex.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/raster/sentinel_config.py +0 -0
- {ssb_sgis-1.0.11 → ssb_sgis-1.0.13}/src/sgis/raster/zonal.py +0 -0
|
@@ -183,7 +183,9 @@ def to_tile(tile: str | xyzservices.TileProvider, max_zoom: int) -> folium.TileL
|
|
|
183
183
|
return folium.TileLayer(provider, name=name, attr=attr, max_zoom=max_zoom)
|
|
184
184
|
|
|
185
185
|
|
|
186
|
-
def
|
|
186
|
+
def _single_band_to_arr_is_too_much_nodata(
|
|
187
|
+
band, mask, name, raster_data_dict, max_nodata_percentage
|
|
188
|
+
) -> bool:
|
|
187
189
|
if band.has_array and mask is None:
|
|
188
190
|
arr = band.values
|
|
189
191
|
elif band.has_array:
|
|
@@ -191,8 +193,8 @@ def _single_band_to_arr(band, mask, name, raster_data_dict):
|
|
|
191
193
|
else:
|
|
192
194
|
arr = band.load(indexes=1, bounds=mask).values
|
|
193
195
|
|
|
194
|
-
if _is_too_much_nodata([arr], band.nodata):
|
|
195
|
-
return
|
|
196
|
+
if _is_too_much_nodata([arr], band.nodata, max_nodata_percentage):
|
|
197
|
+
return True
|
|
196
198
|
|
|
197
199
|
bounds: tuple = (
|
|
198
200
|
_any_to_bbox_crs4326(mask, band.crs)
|
|
@@ -211,26 +213,33 @@ def _single_band_to_arr(band, mask, name, raster_data_dict):
|
|
|
211
213
|
raster_data_dict["arr"] = arr
|
|
212
214
|
raster_data_dict["bounds"] = bounds
|
|
213
215
|
raster_data_dict["label"] = band.name or name
|
|
214
|
-
|
|
215
|
-
|
|
216
|
+
try:
|
|
217
|
+
raster_data_dict["date"] = band.date
|
|
218
|
+
except Exception:
|
|
219
|
+
raster_data_dict["date"] = None
|
|
220
|
+
|
|
221
|
+
return False
|
|
216
222
|
|
|
217
223
|
|
|
218
224
|
def _is_too_much_nodata(
|
|
219
225
|
arrays: list[np.ndarray],
|
|
220
|
-
nodata: int | None
|
|
221
|
-
max_nodata_percentage: int
|
|
226
|
+
nodata: int | None,
|
|
227
|
+
max_nodata_percentage: int,
|
|
222
228
|
) -> bool:
|
|
223
229
|
return (
|
|
224
230
|
any(arr.shape[0] == 0 for arr in arrays)
|
|
225
231
|
or any(
|
|
226
232
|
(
|
|
227
233
|
isinstance(arr, np.ma.core.MaskedArray)
|
|
228
|
-
and np.mean((arr.mask) | (arr.data == nodata) | (np.isnan(arr.data)))
|
|
234
|
+
and np.mean(((arr.mask) | (arr.data == nodata) | (np.isnan(arr.data))))
|
|
229
235
|
> (max_nodata_percentage / 100)
|
|
230
236
|
)
|
|
231
237
|
for arr in arrays
|
|
232
238
|
)
|
|
233
|
-
or any(
|
|
239
|
+
or any(
|
|
240
|
+
np.mean((arr == nodata) | (np.isnan(arr))) > (max_nodata_percentage / 100)
|
|
241
|
+
for arr in arrays
|
|
242
|
+
)
|
|
234
243
|
)
|
|
235
244
|
|
|
236
245
|
|
|
@@ -267,6 +276,7 @@ class Explore(Map):
|
|
|
267
276
|
decimals: int = 6,
|
|
268
277
|
max_images: int = 10,
|
|
269
278
|
max_nodata_percentage: int = 100,
|
|
279
|
+
display: bool = True,
|
|
270
280
|
**kwargs,
|
|
271
281
|
) -> None:
|
|
272
282
|
"""Initialiser.
|
|
@@ -295,6 +305,7 @@ class Explore(Map):
|
|
|
295
305
|
decimals: Number of decimals in the coordinates.
|
|
296
306
|
max_nodata_percentage: Maximum percentage nodata values (e.g. clouds) ro allow in
|
|
297
307
|
image arrays.
|
|
308
|
+
display: Whether to display the map interactively.
|
|
298
309
|
**kwargs: Additional keyword arguments. Can also be geometry-like objects
|
|
299
310
|
where the key is the label.
|
|
300
311
|
"""
|
|
@@ -310,6 +321,7 @@ class Explore(Map):
|
|
|
310
321
|
self.decimals = decimals
|
|
311
322
|
self.max_images = max_images
|
|
312
323
|
self.max_nodata_percentage = max_nodata_percentage
|
|
324
|
+
self.display = display
|
|
313
325
|
self.legend = None
|
|
314
326
|
|
|
315
327
|
self.browser = browser
|
|
@@ -453,8 +465,7 @@ class Explore(Map):
|
|
|
453
465
|
|
|
454
466
|
if center is None:
|
|
455
467
|
self.to_show = self._gdfs
|
|
456
|
-
self._explore(**kwargs)
|
|
457
|
-
return
|
|
468
|
+
return self._explore(**kwargs)
|
|
458
469
|
|
|
459
470
|
size = size if size else 1000
|
|
460
471
|
|
|
@@ -618,6 +629,8 @@ class Explore(Map):
|
|
|
618
629
|
f.write(self.map._repr_html_())
|
|
619
630
|
elif self.browser:
|
|
620
631
|
run_html_server(self.map._repr_html_())
|
|
632
|
+
elif not self.display:
|
|
633
|
+
return
|
|
621
634
|
else:
|
|
622
635
|
display(self.map)
|
|
623
636
|
|
|
@@ -1341,7 +1354,10 @@ def _add_one_image(
|
|
|
1341
1354
|
if len(image) < 3:
|
|
1342
1355
|
for band in image:
|
|
1343
1356
|
name = _determine_label(band, band.name or name)
|
|
1344
|
-
|
|
1357
|
+
if _single_band_to_arr_is_too_much_nodata(
|
|
1358
|
+
band, mask, name, raster_data_dict, max_nodata_percentage
|
|
1359
|
+
):
|
|
1360
|
+
return
|
|
1345
1361
|
return raster_data_dict
|
|
1346
1362
|
|
|
1347
1363
|
def load(band_id: str) -> Band:
|
|
@@ -1386,7 +1402,10 @@ def _add_one_image(
|
|
|
1386
1402
|
raster_data_dict["bounds"] = bounds
|
|
1387
1403
|
raster_data_dict["cmap"] = None
|
|
1388
1404
|
raster_data_dict["label"] = _determine_label(image, image.name or name)
|
|
1389
|
-
|
|
1405
|
+
try:
|
|
1406
|
+
raster_data_dict["date"] = image.date
|
|
1407
|
+
except Exception:
|
|
1408
|
+
raster_data_dict["date"] = None
|
|
1390
1409
|
|
|
1391
1410
|
return raster_data_dict
|
|
1392
1411
|
|
|
@@ -1421,8 +1440,10 @@ def _image_collection_to_background_map(
|
|
|
1421
1440
|
return out
|
|
1422
1441
|
|
|
1423
1442
|
raster_data_dict = {}
|
|
1424
|
-
|
|
1425
|
-
|
|
1443
|
+
if not _single_band_to_arr_is_too_much_nodata(
|
|
1444
|
+
band, mask, name, raster_data_dict, max_nodata_percentage
|
|
1445
|
+
):
|
|
1446
|
+
out.append(raster_data_dict)
|
|
1426
1447
|
return out
|
|
1427
1448
|
|
|
1428
1449
|
else:
|
|
@@ -1455,7 +1476,7 @@ def _image_collection_to_background_map(
|
|
|
1455
1476
|
continue
|
|
1456
1477
|
i = 1
|
|
1457
1478
|
while x["label"] in {y["label"] for y in out}:
|
|
1458
|
-
x["label"] = x["label"].rstrip(f"_{i}"
|
|
1479
|
+
x["label"] = x["label"].rstrip(f"_{i}") + f"_{i + 1}"
|
|
1459
1480
|
i += 1
|
|
1460
1481
|
|
|
1461
1482
|
n_added_images += 1
|
|
@@ -499,6 +499,14 @@ class _ImageBase:
|
|
|
499
499
|
"metadata": self.metadata,
|
|
500
500
|
}
|
|
501
501
|
|
|
502
|
+
@property
|
|
503
|
+
def _common_init_kwargs_after_load(self) -> dict:
|
|
504
|
+
return {
|
|
505
|
+
k: v
|
|
506
|
+
for k, v in self._common_init_kwargs.items()
|
|
507
|
+
if k not in {"res", "metadata"}
|
|
508
|
+
}
|
|
509
|
+
|
|
502
510
|
@property
|
|
503
511
|
def path(self) -> str:
|
|
504
512
|
try:
|
|
@@ -1136,8 +1144,8 @@ class Band(_ImageBandBase):
|
|
|
1136
1144
|
if self.nodata is None or np.isnan(self.nodata):
|
|
1137
1145
|
self.nodata = src.nodata
|
|
1138
1146
|
else:
|
|
1139
|
-
dtype_min_value =
|
|
1140
|
-
dtype_max_value =
|
|
1147
|
+
dtype_min_value = _get_dtype_min_value(src.dtypes[0])
|
|
1148
|
+
dtype_max_value = _get_dtype_max_value(src.dtypes[0])
|
|
1141
1149
|
if self.nodata > dtype_max_value or self.nodata < dtype_min_value:
|
|
1142
1150
|
src._dtypes = tuple(
|
|
1143
1151
|
rasterio.dtypes.get_minimum_dtype(self.nodata)
|
|
@@ -1240,17 +1248,17 @@ class Band(_ImageBandBase):
|
|
|
1240
1248
|
if self.crs is None:
|
|
1241
1249
|
raise ValueError("Cannot write None crs to image.")
|
|
1242
1250
|
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1251
|
+
try:
|
|
1252
|
+
data = self.values.data
|
|
1253
|
+
except AttributeError:
|
|
1254
|
+
data = self.values
|
|
1255
|
+
data = np.array([np.min(data), np.max(data), self.nodata or 0])
|
|
1256
|
+
min_dtype = rasterio.dtypes.get_minimum_dtype(data)
|
|
1257
|
+
|
|
1250
1258
|
profile = {
|
|
1251
1259
|
"driver": driver,
|
|
1252
1260
|
"compress": compress,
|
|
1253
|
-
"dtype":
|
|
1261
|
+
"dtype": min_dtype,
|
|
1254
1262
|
"crs": self.crs,
|
|
1255
1263
|
"transform": self.transform,
|
|
1256
1264
|
"nodata": self.nodata,
|
|
@@ -1263,7 +1271,7 @@ class Band(_ImageBandBase):
|
|
|
1263
1271
|
with rasterio.open(f, "w", **profile) as dst:
|
|
1264
1272
|
|
|
1265
1273
|
if dst.nodata is None:
|
|
1266
|
-
dst.nodata =
|
|
1274
|
+
dst.nodata = _get_dtype_min_value(dst.dtypes[0])
|
|
1267
1275
|
|
|
1268
1276
|
if (
|
|
1269
1277
|
isinstance(self.values, np.ma.core.MaskedArray)
|
|
@@ -1515,12 +1523,6 @@ class NDVIBand(Band):
|
|
|
1515
1523
|
cmap: str = "Greens"
|
|
1516
1524
|
|
|
1517
1525
|
|
|
1518
|
-
def median_as_int_and_minimum_dtype(arr: np.ndarray) -> np.ndarray:
|
|
1519
|
-
arr = np.median(arr, axis=0).astype(int)
|
|
1520
|
-
min_dtype = rasterio.dtypes.get_minimum_dtype(arr)
|
|
1521
|
-
return arr.astype(min_dtype)
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
1526
|
class Image(_ImageBandBase):
|
|
1525
1527
|
"""Image consisting of one or more Bands."""
|
|
1526
1528
|
|
|
@@ -1742,7 +1744,7 @@ class Image(_ImageBandBase):
|
|
|
1742
1744
|
arr,
|
|
1743
1745
|
bounds=red.bounds,
|
|
1744
1746
|
crs=red.crs,
|
|
1745
|
-
**
|
|
1747
|
+
**red._common_init_kwargs_after_load,
|
|
1746
1748
|
)
|
|
1747
1749
|
|
|
1748
1750
|
def get_brightness(
|
|
@@ -1773,7 +1775,7 @@ class Image(_ImageBandBase):
|
|
|
1773
1775
|
brightness,
|
|
1774
1776
|
bounds=red.bounds,
|
|
1775
1777
|
crs=self.crs,
|
|
1776
|
-
**
|
|
1778
|
+
**self._common_init_kwargs_after_load,
|
|
1777
1779
|
)
|
|
1778
1780
|
|
|
1779
1781
|
def to_xarray(self) -> DataArray:
|
|
@@ -2102,7 +2104,7 @@ class ImageCollection(_ImageBase):
|
|
|
2102
2104
|
|
|
2103
2105
|
for attr in by:
|
|
2104
2106
|
if attr == "bounds":
|
|
2105
|
-
# need integers to check equality when grouping
|
|
2107
|
+
# need integers to properly check equality when grouping
|
|
2106
2108
|
df[attr] = [
|
|
2107
2109
|
tuple(int(x) for x in band.bounds) for img in self for band in img
|
|
2108
2110
|
]
|
|
@@ -2322,9 +2324,8 @@ class ImageCollection(_ImageBase):
|
|
|
2322
2324
|
arr,
|
|
2323
2325
|
bounds=bounds,
|
|
2324
2326
|
crs=crs,
|
|
2325
|
-
**
|
|
2327
|
+
**self._common_init_kwargs_after_load,
|
|
2326
2328
|
)
|
|
2327
|
-
|
|
2328
2329
|
band._merged = True
|
|
2329
2330
|
return band
|
|
2330
2331
|
|
|
@@ -2390,19 +2391,20 @@ class ImageCollection(_ImageBase):
|
|
|
2390
2391
|
|
|
2391
2392
|
arrs.append(arr)
|
|
2392
2393
|
bands.append(
|
|
2393
|
-
self.band_class(
|
|
2394
|
+
# self.band_class(
|
|
2395
|
+
Band(
|
|
2394
2396
|
arr,
|
|
2395
2397
|
bounds=out_bounds,
|
|
2396
2398
|
crs=crs,
|
|
2397
2399
|
band_id=band_id,
|
|
2398
|
-
**
|
|
2400
|
+
**self._common_init_kwargs_after_load,
|
|
2399
2401
|
)
|
|
2400
2402
|
)
|
|
2401
2403
|
|
|
2402
2404
|
# return self.image_class( # TODO
|
|
2403
2405
|
image = Image(
|
|
2404
2406
|
bands,
|
|
2405
|
-
band_class=self.band_class,
|
|
2407
|
+
# band_class=self.band_class,
|
|
2406
2408
|
**self._common_init_kwargs,
|
|
2407
2409
|
)
|
|
2408
2410
|
|
|
@@ -2431,25 +2433,17 @@ class ImageCollection(_ImageBase):
|
|
|
2431
2433
|
continue
|
|
2432
2434
|
|
|
2433
2435
|
_bounds = to_bbox(_bounds)
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
(
|
|
2437
|
-
# band.load(
|
|
2438
|
-
# bounds=(_bounds if _bounds is not None else None),
|
|
2439
|
-
# **kwargs,
|
|
2440
|
-
# )
|
|
2441
|
-
# if not band.has_array
|
|
2442
|
-
# else
|
|
2443
|
-
band
|
|
2444
|
-
).values
|
|
2445
|
-
for img in collection
|
|
2446
|
-
for band in img
|
|
2447
|
-
]
|
|
2448
|
-
)
|
|
2436
|
+
collection.load(bounds=(_bounds if _bounds is not None else None), **kwargs)
|
|
2437
|
+
arr = np.array([band.values for img in collection for band in img])
|
|
2449
2438
|
arr = numpy_func(arr, axis=0)
|
|
2450
2439
|
if as_int:
|
|
2451
2440
|
arr = arr.astype(int)
|
|
2452
|
-
|
|
2441
|
+
try:
|
|
2442
|
+
data = arr.data
|
|
2443
|
+
except AttributeError:
|
|
2444
|
+
data = arr
|
|
2445
|
+
data = np.array([np.min(data), np.max(data), self.nodata or 0])
|
|
2446
|
+
min_dtype = rasterio.dtypes.get_minimum_dtype(data)
|
|
2453
2447
|
arr = arr.astype(min_dtype)
|
|
2454
2448
|
|
|
2455
2449
|
if len(arr.shape) == 2:
|
|
@@ -3429,24 +3423,20 @@ def _date_is_within(
|
|
|
3429
3423
|
return False
|
|
3430
3424
|
|
|
3431
3425
|
|
|
3432
|
-
def
|
|
3426
|
+
def _get_dtype_min_value(dtype: str | type) -> int | float:
|
|
3433
3427
|
try:
|
|
3434
3428
|
return np.iinfo(dtype).min
|
|
3435
3429
|
except ValueError:
|
|
3436
3430
|
return np.finfo(dtype).min
|
|
3437
3431
|
|
|
3438
3432
|
|
|
3439
|
-
def
|
|
3433
|
+
def _get_dtype_max_value(dtype: str | type) -> int | float:
|
|
3440
3434
|
try:
|
|
3441
3435
|
return np.iinfo(dtype).max
|
|
3442
3436
|
except ValueError:
|
|
3443
3437
|
return np.finfo(dtype).max
|
|
3444
3438
|
|
|
3445
3439
|
|
|
3446
|
-
def _intesects(x, other) -> bool:
|
|
3447
|
-
return box(*x.bounds).intersects(other)
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
3440
|
def _copy_and_add_df_parallel(
|
|
3451
3441
|
group_values: tuple[Any, ...],
|
|
3452
3442
|
group_df: pd.DataFrame,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|