starbash 0.1.9__tar.gz → 0.1.11__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 starbash might be problematic. Click here for more details.

Files changed (40) hide show
  1. {starbash-0.1.9 → starbash-0.1.11}/PKG-INFO +5 -3
  2. {starbash-0.1.9 → starbash-0.1.11}/README.md +4 -2
  3. {starbash-0.1.9 → starbash-0.1.11}/pyproject.toml +1 -1
  4. starbash-0.1.11/src/starbash/aliases.py +100 -0
  5. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/app.py +509 -192
  6. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/commands/info.py +69 -0
  7. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/commands/repo.py +19 -3
  8. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/commands/select.py +8 -1
  9. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/database.py +187 -94
  10. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/defaults/starbash.toml +23 -3
  11. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/paths.py +18 -2
  12. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/recipes/master_bias/starbash.toml +12 -18
  13. starbash-0.1.11/src/starbash/recipes/master_dark/starbash.toml +34 -0
  14. starbash-0.1.11/src/starbash/recipes/master_flat/starbash.toml +54 -0
  15. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/recipes/osc_dual_duo/starbash.py +1 -5
  16. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/recipes/osc_dual_duo/starbash.toml +41 -28
  17. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/recipes/osc_single_duo/starbash.toml +4 -4
  18. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/recipes/starbash.toml +26 -4
  19. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/selection.py +6 -1
  20. starbash-0.1.11/src/starbash/templates/repo/processed.toml +10 -0
  21. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/tool.py +161 -64
  22. starbash-0.1.9/src/starbash/recipes/master_flat/starbash.toml +0 -46
  23. {starbash-0.1.9 → starbash-0.1.11}/LICENSE +0 -0
  24. {starbash-0.1.9 → starbash-0.1.11}/src/repo/__init__.py +0 -0
  25. {starbash-0.1.9 → starbash-0.1.11}/src/repo/manager.py +0 -0
  26. {starbash-0.1.9 → starbash-0.1.11}/src/repo/repo.py +0 -0
  27. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/__init__.py +0 -0
  28. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/analytics.py +0 -0
  29. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/commands/__init__.py +0 -0
  30. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/commands/process.py +0 -0
  31. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/commands/user.py +0 -0
  32. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/defaults/__init__.py +0 -0
  33. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/main.py +0 -0
  34. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/recipes/README.md +0 -0
  35. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/recipes/__init__.py +0 -0
  36. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/templates/__init__.py +0 -0
  37. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/templates/repo/master.toml +0 -0
  38. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/templates/userconfig.toml +0 -0
  39. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/toml.py +0 -0
  40. {starbash-0.1.9 → starbash-0.1.11}/src/starbash/url.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: starbash
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: A tool for automating/standardizing/sharing astrophotography workflows.
5
5
  License-File: LICENSE
6
6
  Author: Kevin Hester
@@ -33,6 +33,7 @@ A tool for automating/standardizing/sharing astrophotography workflows.
33
33
  * Automatic - with sensible defaults, that you can change as needed.
34
34
  * Easy - provides a 'seestar like' starting-point for autoprocessing all your sessions (by default).
35
35
  * Fast - even with large image repositories. Automatic master bias and flat generation and reasonable defaults
36
+ * Multi-session - by default. So your workflows can stack from multiple nights (and still use the correct flats etc...)
36
37
  * Sharable - you can share/use recipes for image preprocessing flows.
37
38
 
38
39
  (This project is currently 'alpha' and missing recipes for some workflows, but adding new recipes is easy and we're happy to help. Please file a github issue if your images are not auto-processed and we'll work out a fix.)
@@ -89,7 +90,7 @@ FIXME - add getting started instructions (possibly with a screenshare video)
89
90
 
90
91
  ### Repository Management
91
92
  - `sb repo list [--verbose]` - List installed repos (use `-v` for details)
92
- - `sb repo add [--master] <filepath|URL>` - Add a repository, optionally specifying the type
93
+ - `sb repo add [--master] [filepath|URL]` - Add a repository, optionally specifying the type
93
94
  - `sb repo remove <REPOURL>` - Remove the indicated repo from the repo list
94
95
  - `sb repo reindex [--force] <REPOURL>` - Reindex the specified repo (or all repos if none specified)
95
96
 
@@ -113,6 +114,7 @@ FIXME - add getting started instructions (possibly with a screenshare video)
113
114
  - `sb info target` - List targets (filtered based on the current selection)
114
115
  - `sb info telescope` - List instruments (filtered based on the current selection)
115
116
  - `sb info filter` - List all filters found in current selection
117
+ - `sb info master [KIND]` - List all precalculated master images (darks, biases, flats). Optional KIND argument to filter by image type (e.g., BIAS, DARK, FLAT)
116
118
 
117
119
  ## Not yet supported commands
118
120
 
@@ -142,4 +144,4 @@ Project members can access crash reports [here](https://geeksville.sentry.io/ins
142
144
  ## License
143
145
 
144
146
  Copyright 2025 Kevin Hester, kevinh@geeksville.com.
145
- Licensed under the (GPL v3)[LICENSE]
147
+ Licensed under the [GPL v3](LICENSE)
@@ -11,6 +11,7 @@ A tool for automating/standardizing/sharing astrophotography workflows.
11
11
  * Automatic - with sensible defaults, that you can change as needed.
12
12
  * Easy - provides a 'seestar like' starting-point for autoprocessing all your sessions (by default).
13
13
  * Fast - even with large image repositories. Automatic master bias and flat generation and reasonable defaults
14
+ * Multi-session - by default. So your workflows can stack from multiple nights (and still use the correct flats etc...)
14
15
  * Sharable - you can share/use recipes for image preprocessing flows.
15
16
 
16
17
  (This project is currently 'alpha' and missing recipes for some workflows, but adding new recipes is easy and we're happy to help. Please file a github issue if your images are not auto-processed and we'll work out a fix.)
@@ -67,7 +68,7 @@ FIXME - add getting started instructions (possibly with a screenshare video)
67
68
 
68
69
  ### Repository Management
69
70
  - `sb repo list [--verbose]` - List installed repos (use `-v` for details)
70
- - `sb repo add [--master] <filepath|URL>` - Add a repository, optionally specifying the type
71
+ - `sb repo add [--master] [filepath|URL]` - Add a repository, optionally specifying the type
71
72
  - `sb repo remove <REPOURL>` - Remove the indicated repo from the repo list
72
73
  - `sb repo reindex [--force] <REPOURL>` - Reindex the specified repo (or all repos if none specified)
73
74
 
@@ -91,6 +92,7 @@ FIXME - add getting started instructions (possibly with a screenshare video)
91
92
  - `sb info target` - List targets (filtered based on the current selection)
92
93
  - `sb info telescope` - List instruments (filtered based on the current selection)
93
94
  - `sb info filter` - List all filters found in current selection
95
+ - `sb info master [KIND]` - List all precalculated master images (darks, biases, flats). Optional KIND argument to filter by image type (e.g., BIAS, DARK, FLAT)
94
96
 
95
97
  ## Not yet supported commands
96
98
 
@@ -120,4 +122,4 @@ Project members can access crash reports [here](https://geeksville.sentry.io/ins
120
122
  ## License
121
123
 
122
124
  Copyright 2025 Kevin Hester, kevinh@geeksville.com.
123
- Licensed under the (GPL v3)[LICENSE]
125
+ Licensed under the [GPL v3](LICENSE)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "starbash"
3
- version = "0.1.9"
3
+ version = "0.1.11"
4
4
  description = "A tool for automating/standardizing/sharing astrophotography workflows."
5
5
  authors = ["Kevin Hester <kevinh@geeksville.com>"]
6
6
  readme = "README.md"
@@ -0,0 +1,100 @@
1
+ import string
2
+
3
+
4
+ _translator = str.maketrans("", "", string.punctuation + string.whitespace)
5
+
6
+
7
+ def normalize_target_name(name: str | None) -> str | None:
8
+ """Converts a target name to an any filesystem-safe format by removing spaces"""
9
+ if name is None:
10
+ return None
11
+ return name.replace(" ", "").lower()
12
+
13
+
14
+ def pre_normalize(name: str) -> str:
15
+ """Pre-normalize a name by removing all whitespace and punctuation, and converting to lowercase.
16
+
17
+ Args:
18
+ name: The name to pre-normalize.
19
+
20
+ Returns:
21
+ Normalized string with only alphanumeric characters in lowercase.
22
+ """
23
+ # Create translation table that removes all punctuation and whitespace
24
+ return name.lower().translate(_translator)
25
+
26
+
27
+ class UnrecognizedAliasError(ValueError):
28
+ """Exception raised when an unrecognized alias is encountered during normalization."""
29
+
30
+ pass
31
+
32
+
33
+ class Aliases:
34
+ def __init__(self, alias_dict: dict[str, list[str]]):
35
+ """Initialize the Aliases object with a dictionary mapping keys to their alias lists.
36
+
37
+ The alias_dict structure follows the TOML format:
38
+ - Keys are reference names used in code (e.g., "dark", "flat", "bias", "fits", "SiiOiii", "HaOiii")
39
+ - Values are lists of aliases where the FIRST item is the canonical/preferred name
40
+ - The dictionary key may or may not match the canonical name
41
+
42
+ Example from TOML:
43
+ [aliases]
44
+ dark = ["dark", "darks"] # key "dark" -> canonical "dark"
45
+ flat = ["flat", "flats"] # key "flat" -> canonical "flat"
46
+ SiiOiii = ["SiiOiii", "SII-OIII", "S2-O3"] # key "SiiOiii" -> canonical "SiiOiii"
47
+ """
48
+ self.alias_dict = alias_dict
49
+ self.reverse_dict = {}
50
+
51
+ # Build reverse lookup: any alias variant maps to canonical name
52
+ for _key, aliases in alias_dict.items():
53
+ if not aliases:
54
+ continue
55
+ # The first item in the list is ALWAYS the canonical/preferred form
56
+ canonical = aliases[0]
57
+ for alias in aliases:
58
+ # Map each alias (case-insensitive) to the canonical form (first in list)
59
+ # Also remove spaces, hypens and underscores when matching for normalization
60
+ self.reverse_dict[pre_normalize(alias)] = canonical
61
+
62
+ def get(self, name: str) -> list[str] | None:
63
+ """Get the list of aliases for a given key name.
64
+
65
+ Args:
66
+ name: The key name to look up (as used in code/TOML)
67
+
68
+ Returns:
69
+ List of all aliases for this key, or None if not found.
70
+ The first item in the returned list is the canonical form.
71
+ """
72
+ return self.alias_dict.get(name)
73
+
74
+ def normalize(self, name: str) -> str:
75
+ """Normalize a name to its canonical form using aliases.
76
+
77
+ This performs case-insensitive matching to find the canonical form.
78
+ The canonical form is the first item in the alias list from the TOML.
79
+
80
+ Args:
81
+ name: The name to normalize (e.g., "darks", "FLAT", "HA-OIII")
82
+
83
+ Returns:
84
+ The canonical/preferred form (e.g., "dark", "flat", "HaOiii"), or None if not found
85
+
86
+ Examples:
87
+ normalize("darks") -> "dark"
88
+ normalize("FLAT") -> "flat"
89
+ normalize("HA-OIII") -> "HaOiii"
90
+ """
91
+ result = self.reverse_dict.get(pre_normalize(name))
92
+ if not result:
93
+ raise UnrecognizedAliasError(f"'{name}' not found in aliases.")
94
+ return result
95
+
96
+ def equals(self, name1: str, name2: str) -> bool:
97
+ """Check if two names are equivalent based on aliases."""
98
+ norm1 = self.normalize(name1.strip())
99
+ norm2 = self.normalize(name2.strip())
100
+ return norm1 == norm2