samgis_core 3.2.2__tar.gz → 3.3.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.2.2 → samgis_core-3.3.1}/PKG-INFO +5 -5
- samgis_core-3.3.1/pyproject.toml +41 -0
- samgis_core-3.2.2/pyproject.toml +0 -41
- samgis_core-3.2.2/samgis_core/utilities/update_requirements_txt.py +0 -103
- {samgis_core-3.2.2 → samgis_core-3.3.1}/LICENSE +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/README.md +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/__init__.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/__version__.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/prediction_api/__init__.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/prediction_api/sam_onnx2.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/prediction_api/sam_onnx_inference.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/utilities/__init__.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/utilities/constants.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/utilities/create_folders_if_not_exists.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/utilities/frontend_builder.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/utilities/plot_images.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/utilities/serialize.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/utilities/session_logger.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/utilities/type_hints.py +0 -0
- {samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/utilities/utilities.py +0 -0
@@ -1,21 +1,21 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: samgis_core
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.3.1
|
4
4
|
Summary: SamGIS CORE
|
5
5
|
License: MIT
|
6
6
|
Author: alessandro trinca tornidor
|
7
7
|
Author-email: alessandro@trinca.tornidor.com
|
8
|
-
Requires-Python: >=3.10
|
8
|
+
Requires-Python: >=3.10, <3.13
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
14
14
|
Requires-Dist: bson (>=0.5.10,<0.6.0)
|
15
|
-
Requires-Dist: numpy (>=2.
|
16
|
-
Requires-Dist: pillow (>=11.
|
15
|
+
Requires-Dist: numpy (>=2.2.4,<3.0.0)
|
16
|
+
Requires-Dist: pillow (>=11.1.0,<12.0.0)
|
17
17
|
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
18
|
-
Requires-Dist: structlog (>=
|
18
|
+
Requires-Dist: structlog (>=25.2.0,<26.0.0)
|
19
19
|
Project-URL: Source, https://gitlab.com/aletrn/samgis_core
|
20
20
|
Description-Content-Type: text/markdown
|
21
21
|
|
@@ -0,0 +1,41 @@
|
|
1
|
+
[project]
|
2
|
+
name = "samgis_core"
|
3
|
+
version = "3.3.1"
|
4
|
+
description = "SamGIS CORE"
|
5
|
+
authors = [
|
6
|
+
{name = "alessandro trinca tornidor", email = "alessandro@trinca.tornidor.com"}
|
7
|
+
]
|
8
|
+
license = {text = "MIT license"}
|
9
|
+
readme = "README.md"
|
10
|
+
requires-python = ">=3.10, <3.13"
|
11
|
+
dependencies = [
|
12
|
+
"bson (>=0.5.10,<0.6.0)",
|
13
|
+
"numpy (>=2.2.4,<3.0.0)",
|
14
|
+
"pillow (>=11.1.0,<12.0.0)",
|
15
|
+
"python-dotenv (>=1.0.1,<2.0.0)",
|
16
|
+
"structlog (>=25.2.0,<26.0.0)"
|
17
|
+
]
|
18
|
+
|
19
|
+
[project.urls]
|
20
|
+
Source = "https://gitlab.com/aletrn/samgis_core"
|
21
|
+
|
22
|
+
[tool.poetry]
|
23
|
+
|
24
|
+
[tool.poetry.group.onnxruntime]
|
25
|
+
optional = true
|
26
|
+
|
27
|
+
[tool.poetry.group.onnxruntime.dependencies]
|
28
|
+
onnxruntime = "^1.21.0"
|
29
|
+
|
30
|
+
[tool.poetry.group.test]
|
31
|
+
optional = true
|
32
|
+
|
33
|
+
[tool.poetry.group.test.dependencies]
|
34
|
+
mpld3 = "^0.5.10"
|
35
|
+
pytest = "^8.3.5"
|
36
|
+
pytest-cov = "^6.0.0"
|
37
|
+
rasterio = "^1.4.3"
|
38
|
+
|
39
|
+
[build-system]
|
40
|
+
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
41
|
+
build-backend = "poetry.core.masonry.api"
|
samgis_core-3.2.2/pyproject.toml
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
[tool.poetry]
|
2
|
-
name = "samgis_core"
|
3
|
-
version = "3.2.2"
|
4
|
-
description = "SamGIS CORE"
|
5
|
-
authors = ["alessandro trinca tornidor <alessandro@trinca.tornidor.com>"]
|
6
|
-
license = "MIT license"
|
7
|
-
readme = "README.md"
|
8
|
-
|
9
|
-
[metadata]
|
10
|
-
name = "samgis_core"
|
11
|
-
version = "3.2.2"
|
12
|
-
|
13
|
-
[tool.poetry.urls]
|
14
|
-
Source = "https://gitlab.com/aletrn/samgis_core"
|
15
|
-
|
16
|
-
[tool.poetry.dependencies]
|
17
|
-
bson = "^0.5.10"
|
18
|
-
numpy = "^2.1.2"
|
19
|
-
pillow = "^11.0.0"
|
20
|
-
python = ">=3.10, <3.13"
|
21
|
-
python-dotenv = "^1.0.1"
|
22
|
-
structlog = "^24.4.0"
|
23
|
-
|
24
|
-
[tool.poetry.group.onnxruntime]
|
25
|
-
optional = true
|
26
|
-
|
27
|
-
[tool.poetry.group.onnxruntime.dependencies]
|
28
|
-
onnxruntime = "^1.20.1"
|
29
|
-
|
30
|
-
[tool.poetry.group.test]
|
31
|
-
optional = true
|
32
|
-
|
33
|
-
[tool.poetry.group.test.dependencies]
|
34
|
-
mpld3 = "^0.5.10"
|
35
|
-
pytest = "^8.3.4"
|
36
|
-
pytest-cov = "^6.0.0"
|
37
|
-
rasterio = "^1.4.3"
|
38
|
-
|
39
|
-
[build-system]
|
40
|
-
requires = ["poetry-core"]
|
41
|
-
build-backend = "poetry.core.masonry.api"
|
@@ -1,103 +0,0 @@
|
|
1
|
-
import argparse
|
2
|
-
import sys
|
3
|
-
from pathlib import Path
|
4
|
-
import structlog
|
5
|
-
|
6
|
-
from samgis_core.utilities import session_logger
|
7
|
-
|
8
|
-
session_logger.setup_logging(json_logs=False, log_level="INFO")
|
9
|
-
logger = structlog.stdlib.get_logger(__name__)
|
10
|
-
|
11
|
-
|
12
|
-
def get_dependencies_freeze() -> dict:
|
13
|
-
"""get a 'freeze.txt'-like dict of 'name':'version' metadata about installed packages."""
|
14
|
-
from importlib import metadata
|
15
|
-
return {dist.metadata["name"]: dist.version for dist in metadata.distributions()}
|
16
|
-
|
17
|
-
|
18
|
-
def sanitize_path(filename: str | Path, strict_on_filename: bool = True) -> Path:
|
19
|
-
filename = Path(filename)
|
20
|
-
base_path = Path.cwd().resolve(strict=True)
|
21
|
-
logger.info(f"base_path (current working folder):{base_path} ...")
|
22
|
-
try:
|
23
|
-
safe_path = filename.resolve(strict=strict_on_filename)
|
24
|
-
except FileNotFoundError as fnfe:
|
25
|
-
logger.error(f"filename not found:{filename.absolute()}.")
|
26
|
-
logger.error(f"fnfe:{fnfe}.")
|
27
|
-
raise fnfe
|
28
|
-
try:
|
29
|
-
assert base_path / filename.name == safe_path
|
30
|
-
except AssertionError:
|
31
|
-
msg = f"""
|
32
|
-
Basename of resolved path {safe_path} doesn't matches original file {filename},
|
33
|
-
or filename {filename} isn't within the current directory {base_path} ...
|
34
|
-
"""
|
35
|
-
raise OSError(msg)
|
36
|
-
return Path(safe_path)
|
37
|
-
|
38
|
-
|
39
|
-
def get_requirements_txt(requirements_no_versions_filename: str | Path, requirements_output_filename: str | Path):
|
40
|
-
"""
|
41
|
-
Write on disk a requirements.txt file with an updated list of dependencies from installed python packages.
|
42
|
-
Both input and output requirements files must be within the folder from which the current command is executed.
|
43
|
-
|
44
|
-
Args:
|
45
|
-
requirements_no_versions_filename: input requirements filename with no specified versions
|
46
|
-
requirements_output_filename: output requirements.txt filename
|
47
|
-
|
48
|
-
Returns:
|
49
|
-
|
50
|
-
"""
|
51
|
-
logger.info("start requirements.txt update...")
|
52
|
-
freeze_dict = get_dependencies_freeze()
|
53
|
-
logger.debug(f"freeze_dict:{freeze_dict}.")
|
54
|
-
logger.debug(f"requirements_no_versions_filename:{requirements_no_versions_filename}.")
|
55
|
-
requirements_no_versions_filename_sanitized = sanitize_path(requirements_no_versions_filename)
|
56
|
-
logger.info(f"requirements_no_versions_filename_sanitized:{requirements_no_versions_filename_sanitized}.")
|
57
|
-
with open(requirements_no_versions_filename_sanitized) as req_src:
|
58
|
-
packages_no_requirements = req_src.read().split("\n")
|
59
|
-
requirements_output = {
|
60
|
-
name: version for name, version in sorted(freeze_dict.items()) if name in packages_no_requirements
|
61
|
-
}
|
62
|
-
logger.debug(f"requirements to write:{requirements_output}.")
|
63
|
-
requirements_output_filename_sanitized = sanitize_path(requirements_output_filename, strict_on_filename=False)
|
64
|
-
logger.debug(f"requirements_output_filename_sanitized:{requirements_output_filename_sanitized}.")
|
65
|
-
with open(requirements_output_filename_sanitized, "w") as dst:
|
66
|
-
out = ""
|
67
|
-
for name, version in requirements_output.items():
|
68
|
-
out += f"{name}=={version}\n"
|
69
|
-
logger.info(f"output requirements content:\n{out}!")
|
70
|
-
dst.write(out)
|
71
|
-
logger.info(f"written requirements to file:{requirements_output_filename}!")
|
72
|
-
|
73
|
-
|
74
|
-
def get_args(current_args: list) -> argparse.Namespace:
|
75
|
-
warning = "This file must be within the current folder."
|
76
|
-
logger.info(f"current_args:{current_args}.")
|
77
|
-
parser = argparse.ArgumentParser(description="Update requirements.txt from current installed packages.")
|
78
|
-
parser.add_argument(
|
79
|
-
"--req_no_version_path", required=True,
|
80
|
-
help=f"file path for requirements list packages without versions. {warning}."
|
81
|
-
)
|
82
|
-
parser.add_argument(
|
83
|
-
"--req_output_path", required=True,
|
84
|
-
help=f"file path for output requirements. {warning}."
|
85
|
-
)
|
86
|
-
parser.add_argument(
|
87
|
-
"--loglevel", required=False,
|
88
|
-
default="INFO",
|
89
|
-
choices=["DEBUG", "INFO"],
|
90
|
-
help=f"log level (default INFO)."
|
91
|
-
)
|
92
|
-
args = parser.parse_args(current_args)
|
93
|
-
logger.debug(f"args:{args}.")
|
94
|
-
return args
|
95
|
-
|
96
|
-
|
97
|
-
if __name__ == '__main__':
|
98
|
-
args = get_args(sys.argv[1:])
|
99
|
-
session_logger.setup_logging(json_logs=False, log_level=args.loglevel)
|
100
|
-
get_requirements_txt(
|
101
|
-
requirements_no_versions_filename=args.req_no_version_path,
|
102
|
-
requirements_output_filename=args.req_output_path
|
103
|
-
)
|
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
|
{samgis_core-3.2.2 → samgis_core-3.3.1}/samgis_core/utilities/create_folders_if_not_exists.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|