Repository navigation
Create Python package - #19
Open
Jean-Guillaume Durand (jeangud) wants to merge 4 commits into
Open
Jean-Guillaume Durand (jeangud) wants to merge 4 commits into
Jean-Guillaume Durand (jeangud) wants to merge 4 commits into
Conversation
| @@ -0,0 +1,39 @@ | |||
| [build-system] | |||
Contributor
Author
There was a problem hiding this comment.
This file is the main change in this PR
Collaborator
|
Thank you so much for this Jean-Guillaume Durand (@jeangud)! Just a quick note: I am taking some time off currently but will get to this as soon as I am back to working. Thanks for your contributions to this project. |
Bring packaging branch up to date with latest main (README dataset/model updates and notebook URL fixes).
Build on the packaging work with the follow-ups needed to make the package usable end-to-end: - docs/notebooks: migrate README quickstart and notebooks (A01/A02/B01/B02) off 'git clone + sys.path' to 'pip install' + 'from satclip... import ...'; add an Installation section and run training via 'python -m satclip.main' - pyproject: list direct deps explicitly (torch, numpy, sympy, timm, einops, matplotlib, torchvision, huggingface_hub), relax 'lightning' pin to >=2.2,<3, SPDX license, add 'examples'/'dev' extras and a 'satclip-train' entry point, ship configs/*.yaml as package data - main.py: resolve the default config relative to the package and guard the CUDA device check so 'python -m satclip.main' works from any directory / on CPU - __init__.py: expose a clean public API (SatCLIP, LocationEncoder, SatCLIPLoss, get_satclip) instead of wildcard re-exports - add a CI workflow and import/forward-pass smoke tests - ignore dist/ and .pytest_cache/ Verified: wheel builds, bundles configs/default.yaml, registers the satclip-train entry point, and emits License-Expression: MIT.
Member
|
Konstantin Klemmer (@konstantinklemmer) what do you think about this? Still something you want? |
Collaborator
|
Yea I do; just haven't gotten around to it yet 🫠 |
…talled package - Add tensorboard and jsonargparse[signatures] as dependencies; the default training config (TensorBoardLogger) and LightningCLI need them. - Save the resolved training config into the run's log dir instead of next to the packaged default config (previously written into site-packages). - Apply the A100 TF32 setting in cli_main so the satclip-train entry point gets it; never force TF32 off. - get_satclip: keep only hyperparameters SatCLIPLightningModule accepts, so newly trained checkpoints load (legacy keys and Lightning's _instantiator). - Add an end-to-end training + reload test on synthetic S2 tiles. - CI: build sdist/wheel, test the installed wheel from outside the source tree on Python 3.9 and 3.13. - README: document satclip-train; notebooks: drop redundant pip installs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
|
Yo Caleb Robinson (@calebrob6), could you have a look? I also fixed:
|
Konstantin Klemmer (konstantinklemmer)
requested a review
from Caleb Robinson (calebrob6)
October 8, 2026 11:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
SatCLIP currently has to be used from a clone with
satclip/onPYTHONPATH, and it doesn't declare its dependencies (#8). This PR turns it into a regular pip-installable package:Closes #8. Covers the core of #25; follow-ups from there (e.g. a
src/layout, PyPI release) can come as separate PRs.Changes
pyproject.toml(setuptools, PEP 621): declares the runtime dependencies, Python ≥ 3.9,examples/devextras, and shipsconfigs/default.yamlas package data.from .model import SatCLIP), andsatclip/__init__.pyexposesSatCLIP,LocationEncoder,SatCLIPLossandget_satclip.satclip-trainconsole script (equivalent topython -m satclip.main) uses the packaged default config, so it works from any directory:satclip-train --data.data_dir /path/to/s2-100k. The resolved config is saved to the run's log dir (satclip_logs/.../default-latest.yaml).get_satclip: keeps only the hyperparametersSatCLIPLightningModuleaccepts. This lets it load both the released checkpoints and newly trained ones; before, the latter failed withKeyError/TypeError.get_satclipround trip on synthetic S2 tiles.sys.path.Testing
Each check below used a fresh venv and the built wheel (CPU torch), run from outside the repo:
pytest(5 tests, incl. e2e training)get_satclipwithSatCLIP-ViT16-L40from HF)load_lightweightwithSatCLIP-ResNet18-L10satclip-train --helpAlso checked:
pip install git+<repo>@packaging(build from source) followed by the README pretrained example.python -m satclip.main --config custom.yamlon synthetic data.Not tested: a full training run on the real S2-100K dataset, and GPU.
Thanks to Jean-Guillaume Durand (@jeangud) for the original PR and Monodrom (@ibaris) for the packaging work in #25.
🤖 Generated with Claude Code