satcube 0.1.11__tar.gz → 0.1.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.

Potentially problematic release.


This version of satcube might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: satcube
3
- Version: 0.1.11
3
+ Version: 0.1.13
4
4
  Summary: A Python package to create cloud-free monthly composites by fusing Landsat and Sentinel-2 data.
5
5
  Home-page: https://github.com/IPL-UV/satcube
6
6
  Author: Cesar Aybar
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Provides-Extra: full
14
- Requires-Dist: cubexpress (>=0.1.4)
14
+ Requires-Dist: cubexpress (>=0.1.7)
15
15
  Requires-Dist: earthengine-api (>=1.5.12)
16
16
  Requires-Dist: mlstac (>=0.4.0)
17
17
  Requires-Dist: numpy (>=1.25.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "satcube"
3
- version = "0.1.11"
3
+ version = "0.1.13"
4
4
  description = "A Python package to create cloud-free monthly composites by fusing Landsat and Sentinel-2 data."
5
5
  authors = ["Cesar Aybar <fcesar.aybar@uv.es>"]
6
6
  repository = "https://github.com/IPL-UV/satcube"
@@ -10,7 +10,7 @@ packages = [{ include = "satcube" }]
10
10
 
11
11
  [tool.poetry.dependencies]
12
12
  python = ">=3.10,<4.0"
13
- cubexpress = ">=0.1.4"
13
+ cubexpress = ">=0.1.7"
14
14
  mlstac = ">=0.4.0"
15
15
  satalign = ">=0.1.11"
16
16
  segmentation-models-pytorch = ">=0.3.0"
@@ -22,8 +22,16 @@ import rasterio as rio
22
22
  import torch
23
23
 
24
24
  from satcube.utils import DeviceManager, _reset_gpu
25
+ import warnings, re
25
26
 
26
27
 
28
+ warnings.filterwarnings(
29
+ "ignore",
30
+ message=re.escape("The secret `HF_TOKEN` does not exist in your Colab secrets."),
31
+ category=UserWarning,
32
+ module="huggingface_hub.utils._auth",
33
+ )
34
+
27
35
  def cloud_masking(
28
36
  input: str | Path, # noqa: A002 (shadowing built-in is OK here)
29
37
  output: str | Path,
@@ -32,7 +40,7 @@ def cloud_masking(
32
40
  pad: int = 64,
33
41
  save_mask: bool = False,
34
42
  device: str = "cpu",
35
- max_pix_cpu: float = 7.0e7,
43
+ max_pix_cpu: float = 7.0e7
36
44
  ) -> List[Path]:
37
45
  """Write cloud-masked Sentinel-2 images.
38
46
 
@@ -52,7 +60,7 @@ def cloud_masking(
52
60
  Tile images larger than this when running on CPU.
53
61
 
54
62
  Returns
55
- -------
63
+ ------
56
64
  list[pathlib.Path]
57
65
  Paths to the generated masked images.
58
66
  """
@@ -75,8 +83,18 @@ def cloud_masking(
75
83
  if not tif_paths:
76
84
  print(f"[cloud_masking] No .tif files found in {src}")
77
85
  return []
86
+
87
+ dir = Path("SEN2CloudEnsemble")
88
+
89
+ if not dir.exists():
90
+
91
+ mlstac.download(
92
+ file = "https://huggingface.co/tacofoundation/CloudSEN12-models/resolve/main/SEN2CloudEnsemble/mlm.json",
93
+ output_dir = "SEN2CloudEnsemble",
94
+ )
95
+
96
+ experiment = mlstac.load(dir.as_posix())
78
97
 
79
- experiment = mlstac.load("SEN2CloudEnsemble")
80
98
  dm = DeviceManager(experiment, init_device=device)
81
99
 
82
100
  masked_paths: list[Path] = []
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes