WaLSAlib 1.1.0__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.
WaLSAlib/SoFT.py ADDED
@@ -0,0 +1,24 @@
1
+ """Solar Feature Tracking; algorithms maintained by mib-unitn/SoFT.
2
+
3
+ Example: SoFT.detection(image, l_thr=20, sign="pos").
4
+ The full upstream core is available as SoFT.core; optional helpers as SoFT.extras.
5
+ """
6
+ from importlib import import_module
7
+
8
+ __all__ = ["track_all", "detection", "identification", "associate", "core", "extras"]
9
+
10
+
11
+ def __getattr__(name):
12
+ if name.startswith("_"):
13
+ raise AttributeError(name)
14
+ if name == "extras":
15
+ try:
16
+ return import_module("._vendor.soft.extras", __package__)
17
+ except ModuleNotFoundError as exc:
18
+ raise ModuleNotFoundError(
19
+ "SoFT extras require: pip install 'WaLSAlib[soft-extras]'"
20
+ ) from exc
21
+ core = import_module("._vendor.soft.soft", __package__)
22
+ if name == "core":
23
+ return core
24
+ return getattr(core, name)
WaLSAlib/SoFTg.py ADDED
@@ -0,0 +1,24 @@
1
+ """Granule segmentation and optional UNet++ workflows from mib-unitn/SoFTg.
2
+
3
+ Classical segmentation works with the base installation. Model, prediction,
4
+ and training workflows require pip install 'WaLSAlib[softg]'. Training and inference use user-supplied data and checkpoints.
5
+ """
6
+ from importlib import import_module
7
+
8
+ __all__ = ["segment_solar_granules", "granule_detection_lib", "model", "predict", "train", "dataset", "losses", "utils"]
9
+ _MODULES = set(__all__) - {"segment_solar_granules"}
10
+ _MODULES.add("label_tool")
11
+
12
+
13
+ def __getattr__(name):
14
+ if name == "segment_solar_granules":
15
+ return import_module("._vendor.softg.granule_detection_lib", __package__).segment_solar_granules
16
+ if name in _MODULES:
17
+ try:
18
+ return import_module("._vendor.softg." + name, __package__)
19
+ except ModuleNotFoundError as exc:
20
+ extra = "softg-gui" if name == "label_tool" else "softg"
21
+ raise ModuleNotFoundError(
22
+ f"SoFTg {name} requires: pip install 'WaLSAlib[{extra}]'"
23
+ ) from exc
24
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
WaLSAlib/__init__.py ADDED
@@ -0,0 +1,30 @@
1
+ """Auxiliary routines for spectroscopy and solar feature tracking.
2
+
3
+ LineFit and linefit are aliases for the spectral fitting function.
4
+ Tracking namespaces and optional dependencies load on demand.
5
+ """
6
+ from importlib import import_module
7
+ from importlib.metadata import PackageNotFoundError, version
8
+
9
+ try:
10
+ __version__ = version("WaLSAlib")
11
+ except PackageNotFoundError:
12
+ __version__ = "0+unknown"
13
+
14
+ __all__ = ["LineFit", "linefit", "SoFT", "SoFTg"]
15
+
16
+
17
+ def __getattr__(name):
18
+ if name in {"LineFit", "linefit"}:
19
+ function = import_module(".linefit", __name__).linefit
20
+ globals().update(LineFit=function, linefit=function)
21
+ return function
22
+ if name in {"SoFT", "SoFTg"}:
23
+ module = import_module("." + name, __name__)
24
+ globals()[name] = module
25
+ return module
26
+ if name == "WaLSAtools":
27
+ module = import_module("WaLSAtools")
28
+ globals()[name] = module
29
+ return module
30
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -0,0 +1 @@
1
+ """Private, reproducibly adapted upstream sources; see vendor/upstream-lock.json."""
@@ -0,0 +1 @@
1
+ """Private upstream package; generated by tools/sync_upstreams.py."""