samgis_core 3.4.3__tar.gz → 3.5.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.
- {samgis_core-3.4.3 → samgis_core-3.5.1}/PKG-INFO +5 -5
- {samgis_core-3.4.3 → samgis_core-3.5.1}/pyproject.toml +6 -8
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/utilities/create_folders_if_not_exists.py +5 -4
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/utilities/frontend_builder.py +18 -9
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/utilities/plot_images.py +6 -4
- {samgis_core-3.4.3 → samgis_core-3.5.1}/LICENSE +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/README.md +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/__init__.py +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/__version__.py +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/prediction_api/__init__.py +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/prediction_api/sam_onnx2.py +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/prediction_api/sam_onnx_inference.py +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/utilities/__init__.py +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/utilities/constants.py +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/utilities/serialize.py +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/utilities/session_logger.py +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/utilities/type_hints.py +0 -0
- {samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/utilities/utilities.py +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: samgis_core
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.5.1
|
|
4
4
|
Summary: SamGIS CORE
|
|
5
5
|
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
6
7
|
Author: alessandro trinca tornidor
|
|
7
8
|
Author-email: alessandro@trinca.tornidor.com
|
|
8
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.12, <3.14
|
|
9
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
11
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
14
|
Requires-Dist: bson (>=0.5.10,<0.6.0)
|
|
15
15
|
Requires-Dist: numpy (>=2.2.4,<3.0.0)
|
|
16
16
|
Requires-Dist: pillow (>=11.1.0,<12.0.0)
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "samgis_core"
|
|
3
|
-
version = "3.
|
|
3
|
+
version = "3.5.1"
|
|
4
4
|
description = "SamGIS CORE"
|
|
5
|
-
authors = [
|
|
6
|
-
{name = "alessandro trinca tornidor", email = "alessandro@trinca.tornidor.com"}
|
|
7
|
-
]
|
|
5
|
+
authors = [{name = "alessandro trinca tornidor", email = "alessandro@trinca.tornidor.com"}]
|
|
8
6
|
license = {text = "MIT license"}
|
|
9
7
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.
|
|
8
|
+
requires-python = ">=3.12, <3.14"
|
|
11
9
|
dependencies = [
|
|
12
10
|
"bson (>=0.5.10,<0.6.0)",
|
|
13
11
|
"numpy (>=2.2.4,<3.0.0)",
|
|
@@ -32,9 +30,9 @@ optional = true
|
|
|
32
30
|
|
|
33
31
|
[tool.poetry.group.test.dependencies]
|
|
34
32
|
mpld3 = "^0.5.10"
|
|
35
|
-
pytest = "^
|
|
36
|
-
pytest-cov = "^
|
|
37
|
-
rasterio = "^1.
|
|
33
|
+
pytest = "^9.0.2"
|
|
34
|
+
pytest-cov = "^7.0.0"
|
|
35
|
+
rasterio = "^1.5.0"
|
|
38
36
|
|
|
39
37
|
[build-system]
|
|
40
38
|
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
{samgis_core-3.4.3 → samgis_core-3.5.1}/samgis_core/utilities/create_folders_if_not_exists.py
RENAMED
|
@@ -36,7 +36,8 @@ def create_folder_if_not_exists(pathname: Path | str):
|
|
|
36
36
|
|
|
37
37
|
print(f"assertion: pathname exists and is a folder: {current_pathname} ...")
|
|
38
38
|
logging.info(f"assertion: pathname exists and is a folder: {current_pathname} ...")
|
|
39
|
-
|
|
39
|
+
if not current_pathname.is_dir():
|
|
40
|
+
raise OSError(f"folder not found: {current_pathname}.")
|
|
40
41
|
|
|
41
42
|
|
|
42
43
|
def folders_creation(folders_map: dict | str = None, ignore_errors: bool = True):
|
|
@@ -60,9 +61,9 @@ def folders_creation(folders_map: dict | str = None, ignore_errors: bool = True)
|
|
|
60
61
|
for folder_env_ref, folder_env_path in folders_dict.items():
|
|
61
62
|
logging.info(f"folder_env_ref:{folder_env_ref}, folder_env_path:{folder_env_path}.")
|
|
62
63
|
create_folder_if_not_exists(folder_env_path)
|
|
63
|
-
print("
|
|
64
|
-
if enforce_validation_with_getenv:
|
|
65
|
-
|
|
64
|
+
print("="*20)
|
|
65
|
+
if enforce_validation_with_getenv and os.getenv(folder_env_ref) != folder_env_path:
|
|
66
|
+
raise IOError(f"wrong folder path: {folder_env_path} #")
|
|
66
67
|
except (json.JSONDecodeError, TypeError) as jde:
|
|
67
68
|
logging.error(f"jde:{jde}.")
|
|
68
69
|
msg = "double check your variables, e.g. for misspelling like 'FOLDER_MAP'"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
import os
|
|
2
3
|
import subprocess
|
|
3
4
|
from pathlib import Path
|
|
@@ -26,11 +27,13 @@ def assert_envs(envs_list: ListStr) -> None:
|
|
|
26
27
|
|
|
27
28
|
"""
|
|
28
29
|
for current_env in envs_list:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
if not current_env:
|
|
31
|
+
raise EnvironmentError(f"error on assertion for current_env: {current_env}.")
|
|
32
|
+
# try:
|
|
33
|
+
# assert current_env is not None and current_env != ""
|
|
34
|
+
# except AssertionError as aex:
|
|
35
|
+
# app_logger.error(f"error on assertion for current_env: {current_env}.")
|
|
36
|
+
# raise aex
|
|
34
37
|
|
|
35
38
|
|
|
36
39
|
def read_std_out_err(std_out_err: str, output_type: str, command: ListStr) -> None:
|
|
@@ -161,16 +164,22 @@ def get_installed_node():
|
|
|
161
164
|
if not (node_dir and Path(node_dir).exists() and Path(node_dir).is_dir()):
|
|
162
165
|
app_logger.error(f"node_dir:{node_dir} not found.")
|
|
163
166
|
node_dir_env = os.getenv("NODE_DIR_PARENT")
|
|
164
|
-
assert node_dir_env is not None and node_dir_env != "", "NODE_DIR_PARENT/NODE_DIR env variable not found."
|
|
167
|
+
# assert node_dir_env is not None and node_dir_env != "", "NODE_DIR_PARENT/NODE_DIR env variable not found."
|
|
168
|
+
logging.warning(f"node_dir_env: {type(node_dir_env)}, {node_dir_env} #")
|
|
169
|
+
if node_dir_env is None or node_dir_env == "":
|
|
170
|
+
raise ValueError("NODE_DIR_PARENT/NODE_DIR env variable not found.")
|
|
165
171
|
node_dir_parent = Path(os.getenv("NODE_DIR_PARENT"))
|
|
166
172
|
app_logger.error(f"try with '{node_dir_parent}' ...")
|
|
167
|
-
|
|
173
|
+
if not (node_dir_parent.exists() and node_dir_parent.is_dir()):
|
|
174
|
+
raise FileNotFoundError("node_dir_parent not found")
|
|
168
175
|
list_node_folders = [f.path for f in os.scandir(node_dir_parent) if f.is_dir()]
|
|
169
176
|
list_node_folders.sort()
|
|
170
|
-
|
|
177
|
+
if not isinstance(list_node_folders, list) or len(list_node_folders) < 1:
|
|
178
|
+
raise FileNotFoundError("no node folders found.")
|
|
171
179
|
node_dir = list_node_folders.pop()
|
|
172
180
|
node_dir_bin = Path(node_dir) / "bin"
|
|
173
|
-
|
|
181
|
+
if not (node_dir_bin.exists() and node_dir_bin.is_dir()):
|
|
182
|
+
raise FileNotFoundError(f"node's bin not found or not a directory: {node_dir}.")
|
|
174
183
|
return node_dir_bin
|
|
175
184
|
|
|
176
185
|
|
|
@@ -30,15 +30,17 @@ def helper_imshow_output_expected(
|
|
|
30
30
|
tuple of matplotlib Figure, Axes
|
|
31
31
|
|
|
32
32
|
"""
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
n_img = len(img_list)
|
|
34
|
+
n_titles = len(titles_list)
|
|
35
|
+
if n_titles != n_img:
|
|
36
|
+
raise ValueError(f"wrong number of titles ({n_titles}) vs number of img ({n_img})")
|
|
35
37
|
fig, ax = plt.subplot_mosaic([
|
|
36
38
|
titles_list
|
|
37
|
-
], figsize=(
|
|
39
|
+
], figsize=(n_img * plot_size, plot_size))
|
|
38
40
|
|
|
39
41
|
for title, img in zip(titles_list, img_list):
|
|
40
42
|
ax[title].imshow(img, cmap=cmap)
|
|
41
|
-
ax[title].legend()
|
|
43
|
+
ax[title].legend(title)
|
|
42
44
|
if show:
|
|
43
45
|
if debug:
|
|
44
46
|
plt.pause(0.01)
|
|
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
|