-
Notifications
You must be signed in to change notification settings - Fork 2
initial claude setup #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||
| --- | ||||||||||
| description: Enforce uv as the package manager for all Python operations | ||||||||||
| globs: | ||||||||||
| - "**/*.py" | ||||||||||
| - "**/pyproject.toml" | ||||||||||
| --- | ||||||||||
|
|
||||||||||
| - Always use `uv run` to execute commands — never bare `python`, `pytest`, `ruff`, or other tools. | ||||||||||
| - Never use `pip install` — use `uv sync` (with `--extra` or `--all-groups` flags) to manage dependencies. | ||||||||||
| - The `uv.lock` file is the source of truth for resolved dependency versions. | ||||||||||
| - When adding dependencies, add them to `pyproject.toml` and run `uv sync`. | ||||||||||
|
Comment on lines
+10
to
+11
|
||||||||||
| - The `uv.lock` file is the source of truth for resolved dependency versions. | |
| - When adding dependencies, add them to `pyproject.toml` and run `uv sync`. | |
| - `pyproject.toml` is the source of truth for dependencies; `uv.lock` is a local resolution artifact and is not committed. | |
| - When adding dependencies, add them to `pyproject.toml` and run `uv sync` to update your local `uv.lock`. |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,138 @@ | ||||||||||
| # LANfactory — Project Context for Claude | ||||||||||
|
|
||||||||||
| ## What is LANfactory? | ||||||||||
|
|
||||||||||
| Lightweight Python package for training Likelihood Approximation Networks (LANs), Choice Probability Networks (CPNs), and Option Probability Networks (OPNs) using PyTorch or JAX/Flax backends. Trained networks are exported to ONNX format and uploaded to HuggingFace for consumption by HSSM. This package sits in the middle of the HSSM ecosystem: it depends on ssm-simulators for training data and produces the neural network artifacts that HSSM uses at inference time. For ecosystem-wide context, see the HSSMSpine repo. | ||||||||||
|
|
||||||||||
| ## Project Structure | ||||||||||
|
|
||||||||||
| ``` | ||||||||||
| src/lanfactory/ # Main package | ||||||||||
| cli/ # Typer CLIs: jaxtrain, torchtrain, transform-onnx, upload-hf, download-hf | ||||||||||
| config/ # Default network and training configs (LAN, CPN, OPN) | ||||||||||
| trainers/ # Training implementations (torch_mlp.py, jax_mlp.py) | ||||||||||
| onnx/ # PyTorch → ONNX export | ||||||||||
| hf/ # HuggingFace Hub integration (upload, download, model cards) | ||||||||||
| utils/ # Config save/load, MLflow utilities | ||||||||||
| tests/ # pytest suite (trainers, CLI, ONNX, HuggingFace, E2E) | ||||||||||
| docs/ # MkDocs documentation + tutorial notebooks | ||||||||||
| notebooks/ # Test notebooks | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ## Build & Tooling | ||||||||||
|
|
||||||||||
| - **Build system:** setuptools (pure Python, no compiled extensions) | ||||||||||
| - **Package manager:** uv (with `uv.lock`) | ||||||||||
|
||||||||||
| - **Package manager:** uv (with `uv.lock`) | |
| - **Package manager:** uv (no `uv.lock` committed; dependencies resolved from `pyproject.toml`) |
Copilot
AI
Mar 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uv sync --all-groups installs dependency groups (e.g. dev) but does not install optional extras, so the comment “dev + optional” is inaccurate. Consider either changing the text to “dev” only, or updating the command to include extras (e.g., add --all-extras or explicit --extra ...).
| # Install all dependencies (dev + optional) | |
| # Install all dependency groups (e.g. dev) |
Copilot
AI
Mar 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MLflow CLI flag names in this section don’t match the actual CLI options in lanfactory.cli.{torch_train,jax_train} (they use --mlflow-run-name, --mlflow-experiment-name, --mlflow-tracking-uri, --mlflow-artifact-location, --mlflow-run-id). Updating these flags here will prevent users from copying commands that fail.
| Optional experiment tracking via MLflow. CLI flags: `--run-name`, `--experiment-name`, | |
| `--tracking-uri`, `--artifact-location`. Supports resuming runs via `--run-id`. | |
| Optional experiment tracking via MLflow. CLI flags: `--mlflow-run-name`, `--mlflow-experiment-name`, | |
| `--mlflow-tracking-uri`, `--mlflow-artifact-location`. Supports resuming runs via `--mlflow-run-id`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Never use
pip install” is too broad given the repo’s README still documentspip install lanfactoryfor end users. Consider scoping this rule explicitly to repository development/CI (e.g., “When working in this repo, don’t use pip; use uv…”) so it doesn’t conflict with published installation guidance.