starbash 0.1.9__py3-none-any.whl → 0.1.15__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.
- repo/__init__.py +1 -1
- repo/manager.py +14 -23
- repo/repo.py +52 -10
- starbash/__init__.py +10 -3
- starbash/aliases.py +145 -0
- starbash/analytics.py +3 -2
- starbash/app.py +512 -473
- starbash/check_version.py +18 -0
- starbash/commands/__init__.py +2 -1
- starbash/commands/info.py +88 -14
- starbash/commands/process.py +76 -24
- starbash/commands/repo.py +41 -68
- starbash/commands/select.py +141 -142
- starbash/commands/user.py +88 -23
- starbash/database.py +219 -112
- starbash/defaults/starbash.toml +24 -3
- starbash/exception.py +21 -0
- starbash/main.py +29 -7
- starbash/paths.py +35 -5
- starbash/processing.py +724 -0
- starbash/recipes/README.md +3 -0
- starbash/recipes/master_bias/starbash.toml +16 -19
- starbash/recipes/master_dark/starbash.toml +33 -0
- starbash/recipes/master_flat/starbash.toml +26 -18
- starbash/recipes/osc.py +190 -0
- starbash/recipes/osc_dual_duo/starbash.toml +54 -44
- starbash/recipes/osc_simple/starbash.toml +82 -0
- starbash/recipes/osc_single_duo/starbash.toml +51 -32
- starbash/recipes/seestar/starbash.toml +82 -0
- starbash/recipes/starbash.toml +30 -9
- starbash/selection.py +32 -36
- starbash/templates/repo/master.toml +7 -3
- starbash/templates/repo/processed.toml +15 -0
- starbash/templates/userconfig.toml +9 -0
- starbash/toml.py +13 -13
- starbash/tool.py +230 -96
- starbash-0.1.15.dist-info/METADATA +216 -0
- starbash-0.1.15.dist-info/RECORD +45 -0
- starbash/recipes/osc_dual_duo/starbash.py +0 -151
- starbash-0.1.9.dist-info/METADATA +0 -145
- starbash-0.1.9.dist-info/RECORD +0 -37
- {starbash-0.1.9.dist-info → starbash-0.1.15.dist-info}/WHEEL +0 -0
- {starbash-0.1.9.dist-info → starbash-0.1.15.dist-info}/entry_points.txt +0 -0
- {starbash-0.1.9.dist-info → starbash-0.1.15.dist-info}/licenses/LICENSE +0 -0
starbash/main.py
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
import warnings
|
|
3
|
+
from typing import Annotated
|
|
4
|
+
|
|
2
5
|
import typer
|
|
3
|
-
from typing_extensions import Annotated
|
|
4
6
|
|
|
5
|
-
import starbash.url as url
|
|
6
7
|
import starbash
|
|
8
|
+
import starbash.url as url
|
|
7
9
|
|
|
8
|
-
from .app import Starbash, get_user_config_path, setup_logging
|
|
9
|
-
from .commands import info, process, repo, select, user
|
|
10
10
|
from . import console
|
|
11
|
+
from .analytics import is_development_environment
|
|
12
|
+
from .app import Starbash
|
|
13
|
+
from .commands import info, process, repo, select, user
|
|
14
|
+
from .paths import get_user_config_path
|
|
15
|
+
|
|
16
|
+
# Suppress deprecation warnings in production mode to provide a cleaner user experience.
|
|
17
|
+
# In development mode (VS Code, devcontainer, or SENTRY_ENVIRONMENT=development),
|
|
18
|
+
# all warnings are shown to help developers identify potential issues.
|
|
19
|
+
# See: is_development_environment() in analytics.py for detection logic.
|
|
20
|
+
if not is_development_environment():
|
|
21
|
+
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
|
11
22
|
|
|
12
23
|
app = typer.Typer(
|
|
13
24
|
rich_markup_mode="rich",
|
|
@@ -17,9 +28,7 @@ app.add_typer(user.app, name="user", help="Manage user settings.")
|
|
|
17
28
|
app.add_typer(repo.app, name="repo", help="Manage Starbash repositories.")
|
|
18
29
|
app.add_typer(select.app, name="select", help="Manage session and target selection.")
|
|
19
30
|
app.add_typer(info.app, name="info", help="Display system and data information.")
|
|
20
|
-
app.add_typer(
|
|
21
|
-
process.app, name="process", help="Process images using automated workflows."
|
|
22
|
-
)
|
|
31
|
+
app.add_typer(process.app, name="process", help="Process images using automated workflows.")
|
|
23
32
|
|
|
24
33
|
|
|
25
34
|
@app.callback(invoke_without_command=True)
|
|
@@ -32,11 +41,24 @@ def main_callback(
|
|
|
32
41
|
help="Enable debug logging output.",
|
|
33
42
|
),
|
|
34
43
|
] = False,
|
|
44
|
+
force: bool = typer.Option(
|
|
45
|
+
default=False,
|
|
46
|
+
help="Force reindexing/output file regeneration - even if unchanged.",
|
|
47
|
+
),
|
|
48
|
+
verbose: bool = typer.Option(
|
|
49
|
+
False,
|
|
50
|
+
"--verbose",
|
|
51
|
+
help="When providing responses, include all entries. Normally long responses are truncated.",
|
|
52
|
+
),
|
|
35
53
|
):
|
|
36
54
|
"""Main callback for the Starbash application."""
|
|
37
55
|
# Set the log level based on --debug flag
|
|
38
56
|
if debug:
|
|
39
57
|
starbash.log_filter_level = logging.DEBUG
|
|
58
|
+
if force:
|
|
59
|
+
starbash.force_regen = True
|
|
60
|
+
if verbose:
|
|
61
|
+
starbash.verbose_output = True
|
|
40
62
|
|
|
41
63
|
if ctx.invoked_subcommand is None:
|
|
42
64
|
if not get_user_config_path().exists():
|
starbash/paths.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from pathlib import Path
|
|
3
|
+
|
|
3
4
|
from platformdirs import PlatformDirs
|
|
4
5
|
|
|
5
6
|
app_name = "starbash"
|
|
@@ -7,32 +8,61 @@ app_author = "geeksville"
|
|
|
7
8
|
dirs = PlatformDirs(app_name, app_author)
|
|
8
9
|
config_dir = Path(dirs.user_config_dir)
|
|
9
10
|
data_dir = Path(dirs.user_data_dir)
|
|
11
|
+
cache_dir = Path(dirs.user_cache_dir)
|
|
12
|
+
documents_dir = Path(dirs.user_documents_dir) / "starbash"
|
|
10
13
|
|
|
11
14
|
# These can be overridden for testing
|
|
12
15
|
_override_config_dir: Path | None = None
|
|
13
16
|
_override_data_dir: Path | None = None
|
|
17
|
+
_override_cache_dir: Path | None = None
|
|
18
|
+
_override_documents_dir: Path | None = None
|
|
14
19
|
|
|
15
20
|
|
|
16
21
|
def set_test_directories(
|
|
17
|
-
config_dir_override: Path | None = None,
|
|
22
|
+
config_dir_override: Path | None = None,
|
|
23
|
+
data_dir_override: Path | None = None,
|
|
24
|
+
cache_dir_override: Path | None = None,
|
|
25
|
+
documents_dir_override: Path | None = None,
|
|
18
26
|
) -> None:
|
|
19
27
|
"""Set override directories for testing. Used by test fixtures to isolate test data."""
|
|
20
|
-
global _override_config_dir, _override_data_dir
|
|
28
|
+
global _override_config_dir, _override_data_dir, _override_cache_dir, _override_documents_dir
|
|
21
29
|
_override_config_dir = config_dir_override
|
|
22
30
|
_override_data_dir = data_dir_override
|
|
31
|
+
_override_cache_dir = cache_dir_override
|
|
32
|
+
_override_documents_dir = documents_dir_override
|
|
23
33
|
|
|
24
34
|
|
|
25
35
|
def get_user_config_dir() -> Path:
|
|
26
36
|
"""Get the user config directory. Returns test override if set, otherwise the real user directory."""
|
|
27
|
-
dir_to_use =
|
|
28
|
-
_override_config_dir if _override_config_dir is not None else config_dir
|
|
29
|
-
)
|
|
37
|
+
dir_to_use = _override_config_dir if _override_config_dir is not None else config_dir
|
|
30
38
|
os.makedirs(dir_to_use, exist_ok=True)
|
|
31
39
|
return dir_to_use
|
|
32
40
|
|
|
33
41
|
|
|
42
|
+
def get_user_config_path() -> Path:
|
|
43
|
+
"""Returns the path to the user config file (starbash.toml)."""
|
|
44
|
+
from repo import repo_suffix # Lazy import to avoid circular dependency
|
|
45
|
+
|
|
46
|
+
config_dir = get_user_config_dir()
|
|
47
|
+
return config_dir / repo_suffix
|
|
48
|
+
|
|
49
|
+
|
|
34
50
|
def get_user_data_dir() -> Path:
|
|
35
51
|
"""Get the user data directory. Returns test override if set, otherwise the real user directory."""
|
|
36
52
|
dir_to_use = _override_data_dir if _override_data_dir is not None else data_dir
|
|
37
53
|
os.makedirs(dir_to_use, exist_ok=True)
|
|
38
54
|
return dir_to_use
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def get_user_cache_dir() -> Path:
|
|
58
|
+
"""Get the user cache directory. Returns test override if set, otherwise the real user directory."""
|
|
59
|
+
dir_to_use = _override_cache_dir if _override_cache_dir is not None else cache_dir
|
|
60
|
+
os.makedirs(dir_to_use, exist_ok=True)
|
|
61
|
+
return dir_to_use
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def get_user_documents_dir() -> Path:
|
|
65
|
+
"""Get the user documents directory. Returns test override if set, otherwise the real user directory."""
|
|
66
|
+
dir_to_use = _override_documents_dir if _override_documents_dir is not None else documents_dir
|
|
67
|
+
os.makedirs(dir_to_use, exist_ok=True)
|
|
68
|
+
return dir_to_use
|