astro-weights 0.0.1__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.
@@ -0,0 +1,8 @@
1
+ """astro-weights: agent-driven weight-space edits for open LLMs."""
2
+
3
+ from importlib.metadata import version
4
+
5
+ from astro_weights.edits import Edit, LowRankDelta
6
+
7
+ __version__ = version("astro-weights")
8
+ __all__ = ["Edit", "LowRankDelta", "__version__"]
astro_weights/cli.py ADDED
@@ -0,0 +1,70 @@
1
+ """Command-line entry point."""
2
+
3
+ import argparse
4
+ import sys
5
+ from pathlib import Path
6
+
7
+ import numpy as np
8
+ from safetensors import SafetensorError
9
+
10
+ from astro_weights import __version__
11
+ from astro_weights.export import load_peft, verify_peft
12
+ from astro_weights.export.peft import CONFIG, MANIFEST, WEIGHTS
13
+
14
+
15
+ def _inspect(directory: Path) -> int:
16
+ if not directory.is_dir():
17
+ print(f"error: not a directory: {directory}", file=sys.stderr)
18
+ return 2
19
+ missing = [n for n in (CONFIG, WEIGHTS) if not (directory / n).is_file()]
20
+ if missing:
21
+ print(f"error: not an adapter, missing {', '.join(missing)}", file=sys.stderr)
22
+ return 2
23
+ try:
24
+ problems = verify_peft(directory)
25
+ if problems:
26
+ for p in problems:
27
+ print(f"problem: {p}", file=sys.stderr)
28
+ return 1
29
+ edit = load_peft(directory)
30
+ except (ValueError, KeyError, OSError, SafetensorError) as e:
31
+ print(f"error: cannot read adapter: {e}", file=sys.stderr)
32
+ return 2
33
+
34
+ print(f"base model: {edit.base_model}")
35
+ print(f"rank: {edit.rank}")
36
+ print(f"modules: {len(edit.deltas)}")
37
+ rows = [
38
+ (
39
+ d.module,
40
+ f"{d.shape[0]}x{d.shape[1]}",
41
+ *(f"{np.linalg.norm(m):.3g}" for m in (d.B, d.A, d.dense())),
42
+ )
43
+ for d in sorted(edit.deltas, key=lambda d: d.module)
44
+ ]
45
+ header = ("module", "out x in", "|B|_F", "|A|_F", "|BA|_F")
46
+ widths = [max(len(r[i]) for r in [header, *rows]) for i in range(5)]
47
+ for r in [header, *rows]:
48
+ print(
49
+ " ".join(
50
+ c.ljust(w) if i < 2 else c.rjust(w)
51
+ for i, (c, w) in enumerate(zip(r, widths, strict=True))
52
+ ).rstrip()
53
+ )
54
+ print("manifest: ok" if (directory / MANIFEST).exists() else "manifest: none")
55
+ return 0
56
+
57
+
58
+ def main(argv: list[str] | None = None) -> int:
59
+ parser = argparse.ArgumentParser(prog="astro-weights")
60
+ parser.add_argument(
61
+ "--version", action="version", version=f"astro-weights {__version__}"
62
+ )
63
+ sub = parser.add_subparsers(dest="command")
64
+ p = sub.add_parser("inspect", help="summarize and verify a saved PEFT adapter")
65
+ p.add_argument("directory", metavar="DIR", type=Path)
66
+ args = parser.parse_args(argv)
67
+ if args.command == "inspect":
68
+ return _inspect(args.directory)
69
+ parser.print_help()
70
+ return 0
@@ -0,0 +1,20 @@
1
+ """Edit types and recipes."""
2
+
3
+ from astro_weights.edits.core import Edit, LowRankDelta
4
+ from astro_weights.edits.recipes import (
5
+ column_shift,
6
+ masked_rank1,
7
+ orthogonal_random,
8
+ rank1,
9
+ top_k_mask,
10
+ )
11
+
12
+ __all__ = [
13
+ "Edit",
14
+ "LowRankDelta",
15
+ "column_shift",
16
+ "masked_rank1",
17
+ "orthogonal_random",
18
+ "rank1",
19
+ "top_k_mask",
20
+ ]
@@ -0,0 +1,68 @@
1
+ """Edit types: a set of rank-r deltas on named linear modules."""
2
+
3
+ from dataclasses import dataclass, field
4
+
5
+ import numpy as np
6
+
7
+
8
+ @dataclass(frozen=True)
9
+ class LowRankDelta:
10
+ """dW = B @ A for one linear module; B is [out, r], A is [r, in]."""
11
+
12
+ module: str
13
+ B: np.ndarray
14
+ A: np.ndarray
15
+
16
+ def __post_init__(self) -> None:
17
+ if not self.module:
18
+ raise ValueError("module name must be non-empty")
19
+ b = np.ascontiguousarray(self.B, dtype=np.float32)
20
+ a = np.ascontiguousarray(self.A, dtype=np.float32)
21
+ if b.ndim != 2 or a.ndim != 2:
22
+ raise ValueError(
23
+ f"{self.module}: B and A must be 2-D, got {b.ndim}-D and {a.ndim}-D"
24
+ )
25
+ if b.shape[1] != a.shape[0] or a.shape[0] < 1:
26
+ raise ValueError(
27
+ f"{self.module}: rank mismatch, B {b.shape} vs A {a.shape}"
28
+ )
29
+ object.__setattr__(self, "B", b)
30
+ object.__setattr__(self, "A", a)
31
+
32
+ @property
33
+ def rank(self) -> int:
34
+ return int(self.A.shape[0])
35
+
36
+ @property
37
+ def shape(self) -> tuple[int, int]:
38
+ return (int(self.B.shape[0]), int(self.A.shape[1]))
39
+
40
+ def dense(self) -> np.ndarray:
41
+ return np.asarray(self.B @ self.A, dtype=np.float32)
42
+
43
+
44
+ @dataclass(frozen=True)
45
+ class Edit:
46
+ """A set of low-rank deltas against one base model."""
47
+
48
+ deltas: tuple[LowRankDelta, ...]
49
+ base_model: str
50
+ base_sha256: dict[str, str] = field(default_factory=dict)
51
+ meta: dict[str, object] = field(default_factory=dict)
52
+
53
+ def __post_init__(self) -> None:
54
+ if not self.deltas:
55
+ raise ValueError("an edit needs at least one delta")
56
+ names = [d.module for d in self.deltas]
57
+ if len(set(names)) != len(names):
58
+ raise ValueError("duplicate module names in edit")
59
+ ranks = {d.rank for d in self.deltas}
60
+ if len(ranks) != 1:
61
+ # llama.cpp's LoRA converter ignores per-module ranks
62
+ raise ValueError(
63
+ f"mixed ranks {sorted(ranks)}; all deltas must share one rank"
64
+ )
65
+
66
+ @property
67
+ def rank(self) -> int:
68
+ return self.deltas[0].rank
@@ -0,0 +1,56 @@
1
+ """Edit recipes that produce rank-1 LowRankDeltas (numpy only)."""
2
+
3
+ import numpy as np
4
+
5
+ from astro_weights.edits.core import LowRankDelta
6
+
7
+
8
+ def rank1(module: str, b: np.ndarray, a: np.ndarray) -> LowRankDelta:
9
+ """dW = outer(b, a)."""
10
+ return LowRankDelta(module, b[:, None], a[None, :])
11
+
12
+
13
+ def top_k_mask(scores: np.ndarray, k: int) -> np.ndarray:
14
+ """float32 0/1 vector with ones at the k largest scores."""
15
+ mask = np.zeros(len(scores), dtype=np.float32)
16
+ if k > 0:
17
+ mask[np.argsort(scores)[-k:]] = 1.0
18
+ return mask
19
+
20
+
21
+ def masked_rank1(
22
+ module: str, W0: np.ndarray, u: np.ndarray, mask: np.ndarray, alpha: float
23
+ ) -> LowRankDelta:
24
+ """Low-rank form of W = W0 - alpha * outer(u, mask * (u @ W0))."""
25
+ if W0.ndim != 2 or u.shape != (W0.shape[0],) or mask.shape != (W0.shape[1],):
26
+ raise ValueError(
27
+ f"{module}: shape mismatch, W0 {W0.shape}, u {u.shape}, mask {mask.shape}"
28
+ )
29
+ u64 = u.astype(np.float64)
30
+ a = -alpha * mask.astype(np.float64) * (u64 @ W0.astype(np.float64))
31
+ return LowRankDelta(module, u64[:, None], a[None, :])
32
+
33
+
34
+ def column_shift(
35
+ module: str, shift: np.ndarray, idx: np.ndarray, coef: np.ndarray, n_in: int
36
+ ) -> LowRankDelta:
37
+ """Bake a constant shift into input columns: W = W0 + outer(shift, c), c[idx] = coef."""
38
+ if shift.ndim != 1 or idx.ndim != 1 or coef.shape != idx.shape:
39
+ raise ValueError(
40
+ f"{module}: shift must be 1-D; idx and coef must be 1-D, same length"
41
+ )
42
+ if len(idx) and (idx.min() < 0 or idx.max() >= n_in):
43
+ raise ValueError(f"{module}: idx out of range for n_in={n_in}")
44
+ if len(np.unique(idx)) != len(idx):
45
+ raise ValueError(f"{module}: idx must be unique")
46
+ c = np.zeros(n_in, dtype=np.float64)
47
+ c[idx] = coef
48
+ return LowRankDelta(module, shift[:, None], c[None, :])
49
+
50
+
51
+ def orthogonal_random(u: np.ndarray, seed: int) -> np.ndarray:
52
+ """Seeded unit vector orthogonal to u (random-edit control)."""
53
+ u64 = u.astype(np.float64)
54
+ r = np.random.default_rng(seed).standard_normal(len(u64))
55
+ r -= (r @ u64) / (u64 @ u64) * u64
56
+ return r / np.linalg.norm(r)
@@ -0,0 +1,5 @@
1
+ """Export and import of edits."""
2
+
3
+ from astro_weights.export.peft import load_peft, save_peft, verify_peft
4
+
5
+ __all__ = ["load_peft", "save_peft", "verify_peft"]
@@ -0,0 +1,154 @@
1
+ """Save and load an Edit as a standard PEFT LoRA adapter plus a hash manifest."""
2
+
3
+ import hashlib
4
+ import json
5
+ import struct
6
+ from importlib.metadata import version
7
+ from pathlib import Path
8
+
9
+ import numpy as np
10
+ from safetensors.numpy import load_file, save_file
11
+
12
+ from astro_weights.edits import Edit, LowRankDelta
13
+
14
+ WEIGHTS = "adapter_model.safetensors"
15
+ CONFIG = "adapter_config.json"
16
+ MANIFEST = "astro_manifest.json"
17
+ PREFIX = "base_model.model."
18
+ SUFFIX_A = ".lora_A.weight"
19
+ SUFFIX_B = ".lora_B.weight"
20
+ FLOAT_DTYPES = {"F32", "F16"}
21
+
22
+
23
+ def _write_json(path: Path, obj: object) -> None:
24
+ path.write_text(json.dumps(obj, indent=1, sort_keys=True) + "\n")
25
+
26
+
27
+ def _sha256(arr: np.ndarray) -> str:
28
+ return hashlib.sha256(
29
+ np.ascontiguousarray(arr, dtype=np.float32).tobytes()
30
+ ).hexdigest()
31
+
32
+
33
+ def save_peft(edit: Edit, out_dir: Path | str) -> None:
34
+ """Write edit as a PEFT LoRA adapter (scaling 1) with an astro manifest."""
35
+ out = Path(out_dir)
36
+ out.mkdir(parents=True, exist_ok=True)
37
+ tensors: dict[str, np.ndarray] = {}
38
+ for d in edit.deltas:
39
+ tensors[f"{PREFIX}{d.module}{SUFFIX_A}"] = d.A
40
+ tensors[f"{PREFIX}{d.module}{SUFFIX_B}"] = d.B
41
+ save_file(tensors, str(out / WEIGHTS))
42
+ _write_json(
43
+ out / CONFIG,
44
+ {
45
+ "peft_type": "LORA",
46
+ "task_type": "CAUSAL_LM",
47
+ "base_model_name_or_path": edit.base_model,
48
+ "r": edit.rank,
49
+ "lora_alpha": edit.rank,
50
+ "lora_dropout": 0.0,
51
+ "bias": "none",
52
+ "fan_in_fan_out": False,
53
+ "target_modules": sorted(d.module for d in edit.deltas),
54
+ },
55
+ )
56
+ _write_json(
57
+ out / MANIFEST,
58
+ {
59
+ "format": 1,
60
+ "astro_weights_version": version("astro-weights"),
61
+ "base_model": edit.base_model,
62
+ "base_sha256": edit.base_sha256,
63
+ "meta": edit.meta,
64
+ "factors": {k: _sha256(v) for k, v in tensors.items()},
65
+ },
66
+ )
67
+
68
+
69
+ def _safetensors_dtypes(path: Path) -> dict[str, str]:
70
+ with path.open("rb") as f:
71
+ (n,) = struct.unpack("<Q", f.read(8))
72
+ header = json.loads(f.read(n))
73
+ return {k: v["dtype"] for k, v in header.items() if k != "__metadata__"}
74
+
75
+
76
+ def _check_config(cfg: dict[str, object]) -> None:
77
+ if cfg.get("peft_type") != "LORA":
78
+ raise ValueError(f"unsupported peft_type: {cfg.get('peft_type')!r}")
79
+ for field in ("use_dora", "use_rslora", "fan_in_fan_out"):
80
+ if cfg.get(field):
81
+ raise ValueError(f"unsupported adapter config: {field} is true")
82
+
83
+
84
+ def _read(directory: Path) -> tuple[Edit, list[str]]:
85
+ """Parse the adapter; ValueError on structural problems, hash problems returned."""
86
+ cfg = json.loads((directory / CONFIG).read_text())
87
+ _check_config(cfg)
88
+ r, alpha = cfg["r"], cfg["lora_alpha"]
89
+ scaling = np.float32(alpha / r)
90
+
91
+ dtypes = _safetensors_dtypes(directory / WEIGHTS)
92
+ bad = {k: t for k, t in dtypes.items() if t not in FLOAT_DTYPES}
93
+ if bad:
94
+ hint = " (BF16 cannot be read by numpy; re-save the adapter as float32)"
95
+ raise ValueError(
96
+ f"unsupported tensor dtypes {bad}{hint if 'BF16' in bad.values() else ''}"
97
+ )
98
+ raw = {
99
+ k: v.astype(np.float32) for k, v in load_file(str(directory / WEIGHTS)).items()
100
+ }
101
+
102
+ a_of: dict[str, np.ndarray] = {}
103
+ b_of: dict[str, np.ndarray] = {}
104
+ for key, arr in raw.items():
105
+ if not key.startswith(PREFIX):
106
+ raise ValueError(f"unexpected tensor key: {key}")
107
+ name = key.removeprefix(PREFIX)
108
+ if name.endswith(SUFFIX_A):
109
+ a_of[name.removesuffix(SUFFIX_A)] = arr
110
+ elif name.endswith(SUFFIX_B):
111
+ b_of[name.removesuffix(SUFFIX_B)] = arr
112
+ else:
113
+ raise ValueError(f"unexpected tensor key: {key}")
114
+ missing = sorted(set(a_of) ^ set(b_of))
115
+ if missing:
116
+ raise ValueError(f"modules missing lora_A or lora_B: {missing}")
117
+
118
+ deltas = tuple(LowRankDelta(m, b_of[m] * scaling, a_of[m]) for m in sorted(a_of))
119
+ if any(d.rank != r for d in deltas):
120
+ raise ValueError(f"tensor rank does not match config r={r}")
121
+
122
+ manifest_path = directory / MANIFEST
123
+ if not manifest_path.exists():
124
+ return Edit(deltas, cfg.get("base_model_name_or_path") or ""), []
125
+ manifest = json.loads(manifest_path.read_text())
126
+ problems = [
127
+ f"hash mismatch or missing factor: {k}"
128
+ for k, h in sorted(manifest["factors"].items())
129
+ if k not in raw or _sha256(raw[k]) != h
130
+ ]
131
+ edit = Edit(
132
+ deltas,
133
+ manifest["base_model"],
134
+ base_sha256=manifest.get("base_sha256", {}),
135
+ meta=manifest.get("meta", {}),
136
+ )
137
+ return edit, problems
138
+
139
+
140
+ def verify_peft(directory: Path | str) -> list[str]:
141
+ """Human-readable problems with an adapter directory; empty when fine."""
142
+ try:
143
+ _, problems = _read(Path(directory))
144
+ except (ValueError, KeyError, OSError) as e:
145
+ return [str(e)]
146
+ return problems
147
+
148
+
149
+ def load_peft(directory: Path | str) -> Edit:
150
+ """Load a PEFT LoRA adapter as an Edit with scaling folded into B."""
151
+ edit, problems = _read(Path(directory))
152
+ if problems:
153
+ raise ValueError("; ".join(problems))
154
+ return edit
astro_weights/py.typed ADDED
File without changes
@@ -0,0 +1 @@
1
+ """Model runners (torch/transformers/peft live here)."""
@@ -0,0 +1,43 @@
1
+ """Apply and remove an Edit on a transformers model through PEFT."""
2
+
3
+ import torch
4
+ from peft import LoraConfig, PeftModel, get_peft_model, set_peft_model_state_dict
5
+ from torch import nn
6
+
7
+ from astro_weights.edits import Edit
8
+ from astro_weights.export.peft import PREFIX, SUFFIX_A, SUFFIX_B
9
+
10
+
11
+ def apply(model: nn.Module, edit: Edit, adapter_name: str = "astro") -> PeftModel:
12
+ """Wrap only the edit's modules in LoRA layers carrying the edit's factors."""
13
+ modules = dict(model.named_modules())
14
+ state: dict[str, torch.Tensor] = {}
15
+ for d in edit.deltas:
16
+ layer = modules.get(d.module)
17
+ if not isinstance(layer, nn.Linear):
18
+ # ValueError (not TypeError): the module may simply be absent
19
+ raise ValueError(f"{d.module}: not an nn.Linear in the model") # noqa: TRY004
20
+ if layer.weight.shape != d.shape:
21
+ raise ValueError(
22
+ f"{d.module}: edit shape {d.shape} != weight {tuple(layer.weight.shape)}"
23
+ )
24
+ dtype = layer.weight.dtype
25
+ state[f"{PREFIX}{d.module}{SUFFIX_A}"] = torch.from_numpy(d.A).to(dtype)
26
+ state[f"{PREFIX}{d.module}{SUFFIX_B}"] = torch.from_numpy(d.B).to(dtype)
27
+
28
+ cfg = LoraConfig(
29
+ r=edit.rank,
30
+ lora_alpha=edit.rank,
31
+ lora_dropout=0.0,
32
+ bias="none",
33
+ target_modules=[d.module for d in edit.deltas],
34
+ )
35
+ peft_model = get_peft_model(model, cfg, adapter_name=adapter_name)
36
+ set_peft_model_state_dict(peft_model, state, adapter_name=adapter_name)
37
+ return peft_model
38
+
39
+
40
+ def remove(peft_model: PeftModel) -> nn.Module:
41
+ """Drop the LoRA layers (no merge); base weights were never modified."""
42
+ base: nn.Module = peft_model.unload()
43
+ return base
@@ -0,0 +1,84 @@
1
+ Metadata-Version: 2.4
2
+ Name: astro-weights
3
+ Version: 0.0.1
4
+ Summary: Agent-driven weight-space edits for open LLMs, exported as standard LoRA adapters.
5
+ Keywords: llm,lora,peft,model-editing,interpretability,mcp
6
+ Author: Indranil Biswas
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 2 - Pre-Alpha
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Classifier: Typing :: Typed
17
+ Requires-Dist: numpy>=2.3
18
+ Requires-Dist: safetensors>=0.5
19
+ Requires-Dist: torch ; extra == 'hf'
20
+ Requires-Dist: transformers>=5.4 ; extra == 'hf'
21
+ Requires-Dist: peft>=0.21.3 ; extra == 'hf'
22
+ Requires-Python: >=3.12
23
+ Project-URL: Homepage, https://github.com/astro-weights/astro-weights
24
+ Project-URL: Issues, https://github.com/astro-weights/astro-weights/issues
25
+ Project-URL: Changelog, https://github.com/astro-weights/astro-weights/blob/main/CHANGELOG.md
26
+ Provides-Extra: hf
27
+ Description-Content-Type: text/markdown
28
+
29
+ # astro-weights
30
+
31
+ Agent-driven weight-space edits for open LLMs. An agent proposes small, targeted edits to a model's weights, the edits are judged against paired statistical tests on held-out data, and the ones that hold up are exported as standard PEFT LoRA adapters (and GGUF) that existing tools already load.
32
+
33
+ > **Status: pre-alpha.** Nothing is released yet and the API will change without notice until 1.0.
34
+
35
+ ## Install
36
+
37
+ ```bash
38
+ pip install astro-weights
39
+ ```
40
+
41
+ ## Quick look
42
+
43
+ ```python
44
+ import numpy as np
45
+ from astro_weights.edits import Edit, masked_rank1
46
+ from astro_weights.export import save_peft
47
+
48
+ W0 = np.random.default_rng(0).standard_normal((16, 48), dtype=np.float32)
49
+ u = np.eye(16, dtype=np.float32)[0]
50
+ mask = np.ones(48, dtype=np.float32)
51
+ delta = masked_rank1("model.layers.1.mlp.down_proj", W0, u, mask, alpha=0.5)
52
+ save_peft(Edit(deltas=(delta,), base_model="org/name"), "my-edit")
53
+ ```
54
+
55
+ ```bash
56
+ astro-weights inspect my-edit
57
+ ```
58
+
59
+ To apply a saved edit to a transformers model:
60
+
61
+ ```bash
62
+ pip install "astro-weights[hf]"
63
+ ```
64
+
65
+ ```python
66
+ from astro_weights.export import load_peft
67
+ from astro_weights.runners.hf import apply
68
+
69
+ peft_model = apply(model, load_peft("my-edit")) # model: a transformers causal LM
70
+ ```
71
+
72
+ ## Development
73
+
74
+ ```bash
75
+ git clone https://github.com/astro-weights/astro-weights
76
+ cd astro-weights
77
+ uv run pytest
78
+ ```
79
+
80
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
81
+
82
+ ## License
83
+
84
+ [Apache-2.0](LICENSE).
@@ -0,0 +1,15 @@
1
+ astro_weights/__init__.py,sha256=jzycHjwn-vuN-60PoqfaXdCP3uB1RDhr8S81dHZ2PEQ,250
2
+ astro_weights/cli.py,sha256=p9iAL2yvp_peBcGWC_TbUx8WoXC62VIiuO7EHmg2Ev8,2396
3
+ astro_weights/edits/__init__.py,sha256=L0Oh3_qRnpbENrcAVaqyUKuF9ipfr1X4b51EN5qdZi4,360
4
+ astro_weights/edits/core.py,sha256=QCMwrvMpqT2YiZqyFc8QcF_aw7ASY4JAsWfazZTWg6E,2160
5
+ astro_weights/edits/recipes.py,sha256=kHYXnKjcpA3AhRqeeEX6eRVHnQoyR5J62MU6qch4B1A,2143
6
+ astro_weights/export/__init__.py,sha256=U7hx32U9LeAobob_-eIz7BMRs_H2d52I5N5oxbK9JUg,160
7
+ astro_weights/export/peft.py,sha256=5k8Pj5x5ZI_rN1gsQFdlKgQBjMJ1t4wWOUPYGakKwa8,5248
8
+ astro_weights/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ astro_weights/runners/__init__.py,sha256=s0kPlncuYGCjBxy6IbflFhs1J4_y3k3KSve67nLWnCU,57
10
+ astro_weights/runners/hf.py,sha256=2MJLRRoLqNUDUY0puqiP6FoLKU1WvqkRapc_748If0Q,1723
11
+ astro_weights-0.0.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
12
+ astro_weights-0.0.1.dist-info/WHEEL,sha256=3OmCxFA0ffBIsX4x0o8CdfSvZAOvO3mzEG8U_z5TvV4,80
13
+ astro_weights-0.0.1.dist-info/entry_points.txt,sha256=scaw2glbHJZZF97axJRLGLADHTP3DOrXcxDCErS-vVg,58
14
+ astro_weights-0.0.1.dist-info/METADATA,sha256=lFq9kLbZFrVrD4K242JW78z9MLYmYN0tInoFvoqO1d0,2608
15
+ astro_weights-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.13.8
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ astro-weights = astro_weights.cli:main
3
+
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.