From 524ce4ce48cfba05894b1544fe7618e0c2a94215 Mon Sep 17 00:00:00 2001 From: Jeet Date: Thu, 16 Apr 2026 17:08:51 +0530 Subject: [PATCH 1/6] updating docs opensportslib setup --- .github/workflows/ci-tests.yml | 2 +- CONTRIBUTING.md | 16 ++++--- README.md | 42 +++++++++++++------ docs/getting-started/installation.md | 39 ++++++++++++++--- opensportslib/core/utils/data.py | 6 +-- .../datasets/classification_dataset.py | 16 +++---- opensportslib/models/backbones/builder.py | 8 ++-- 7 files changed, 87 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 6fc034b..378aefa 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -20,7 +20,7 @@ jobs: - name: Install package and test dependencies run: | python -m pip install --upgrade pip - pip install -e ".[test,localization,py-geometric]" -f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html + opesnportslib setup --pyg --dali - name: Run smoke tests run: bash scripts/run_smoke_tests.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d147e69..141b7dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,12 +20,18 @@ Install the base package or include optional dependencies for specific tasks lik ```bash # Install core package in editable mode pip install -e . +``` + +#### Step 4: Setup Environment (PyTorch, CUDA aware & Optional Dependencies) +```bash +# Install PyTorch (CPU/GPU auto-detected) +opensportslib setup + +# Optional: install PyTorch Geometric support +opensportslib setup --pyg -# OR for localization support -pip install -e ".[localization]" - -# OR want to use "torch-geometric","torch-scatter", "torch-sparse", "torch-cluster", "torch-spline-conv" -pip install -e ".[py-geometric]" -f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html +# Optional: install for DALI support +opensportslib setup --dali ``` ## 2. Branching and Merging - Daily workflow for developers diff --git a/README.md b/README.md index 4507c7c..8b25645 100644 --- a/README.md +++ b/README.md @@ -41,14 +41,27 @@ pip install opensportslib pip install --pre opensportslib ``` -### Optional extras - +### Setup Environment (PyTorch, CUDA aware & Optional Dependencies) ```bash -pip install "opensportslib[localization]" -pip install "opensportslib[py-geometric]" -f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html +# Install PyTorch (CPU/GPU auto-detected) +opensportslib setup + +# Optional: install PyTorch Geometric support +opensportslib setup --pyg + +# Optional: install for DALI support +opensportslib setup --dali ``` -> Requires **Python 3.12+**. +> Requires **Python 3.12+** +> Supports CUDA 12.6 / 12.8 / 13.0 (with CPU fallback). +> PyTorch Geometric is supported up to PyTorch 2.10.*. + +--- + +**Note:** +Run `opensportslib setup` to automatically configure dependencies. +If issues occur, manually install compatible versions of `torch`, `torchvision`, and related libraries according to your CUDA version or system compatibility. --- @@ -173,13 +186,6 @@ cd opensportslib pip install -e . ``` -### With extras - -```bash -pip install -e ".[localization]" -pip install -e ".[py-geometric]" -f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html -``` - ### Conda option If you prefer conda: @@ -190,6 +196,18 @@ conda activate osl pip install -e . ``` +### Setup Environment (PyTorch, CUDA aware & Optional Dependencies) +```bash +# Install PyTorch (CPU/GPU auto-detected) +opensportslib setup + +# Optional: install PyTorch Geometric support +opensportslib setup --pyg + +# Optional: install for DALI support +opensportslib setup --dali +``` + ### Git workflow 1. Make sure you are branching from `dev` diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 301f63d..3350455 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -26,6 +26,29 @@ pip install --pre opensportslib !!! note The `--pre` flag installs the latest pre-release version from PyPI. +#### Setup Environment (PyTorch, CUDA aware & Optional Dependencies) +```bash +# Install PyTorch (CPU/GPU auto-detected) +opensportslib setup + +# Optional: install PyTorch Geometric support +opensportslib setup --pyg + +# Optional: install for DALI support +opensportslib setup --dali +``` + +> Requires **Python 3.12+** +> Supports CUDA 12.6 / 12.8 / 13.0 (with CPU fallback). +> PyTorch Geometric is supported up to PyTorch 2.10.*. + +--- + +!!! note + Run `opensportslib setup` to automatically configure dependencies. + If issues occur, manually install compatible versions of `torch`, `torchvision`, and related libraries according to your CUDA version or system compatibility. + + ## Verify installation ```python @@ -56,10 +79,16 @@ Install the base package or include optional dependencies for specific tasks lik ```bash # Install core package in editable mode pip install -e . +``` + +#### Step 4: Setup Environment (PyTorch, CUDA aware & Optional Dependencies) +```bash +# Install PyTorch (CPU/GPU auto-detected) +opensportslib setup + +# Optional: install PyTorch Geometric support +opensportslib setup --pyg -# OR for localization support -pip install -e ".[localization]" - -# OR want to use "torch-geometric","torch-scatter", "torch-sparse", "torch-cluster", "torch-spline-conv" -pip install -e ".[py-geometric]" -f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html +# Optional: install for DALI support +opensportslib setup --dali ``` \ No newline at end of file diff --git a/opensportslib/core/utils/data.py b/opensportslib/core/utils/data.py index c83e72a..9d1c39c 100644 --- a/opensportslib/core/utils/data.py +++ b/opensportslib/core/utils/data.py @@ -57,10 +57,8 @@ def tracking_collate_fn(batch): except ImportError as exc: raise ImportError( "torch-geometric is required for tracking_collate_fn. " - "Install with: pip install \"opensportslib[py-geometric]\" " - "-f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html " - "or (editable): pip install -e \".[py-geometric]\" " - "-f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html" + "Run: `opensportslib setup --pyg` to install the correct version " + "based on your system (PyTorch & CUDA compatible)." ) from exc batch_size = len(batch) diff --git a/opensportslib/datasets/classification_dataset.py b/opensportslib/datasets/classification_dataset.py index b0d828e..be3e12f 100644 --- a/opensportslib/datasets/classification_dataset.py +++ b/opensportslib/datasets/classification_dataset.py @@ -500,11 +500,9 @@ def _getitem_preloaded(self, idx): from torch_geometric.data import Data except ImportError as exc: raise ImportError( - "torch-geometric is required for tracking_parquet datasets. " - "Install with: pip install \"opensportslib[py-geometric]\" " - "-f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html " - "or (editable): pip install -e \".[py-geometric]\" " - "-f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html" + "torch-geometric is required for tracking_collate_fn. " + "Run: `opensportslib setup --pyg` to install the correct version " + "based on your system (PyTorch & CUDA compatible)." ) from exc from opensportslib.datasets.utils.tracking import normalize_features @@ -546,11 +544,9 @@ def _getitem_on_the_fly(self, idx): from torch_geometric.data import Data except ImportError as exc: raise ImportError( - "torch-geometric is required for tracking_parquet datasets. " - "Install with: pip install \"opensportslib[py-geometric]\" " - "-f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html " - "or (editable): pip install -e \".[py-geometric]\" " - "-f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html" + "torch-geometric is required for tracking_collate_fn. " + "Run: `opensportslib setup --pyg` to install the correct version " + "based on your system (PyTorch & CUDA compatible)." ) from exc from opensportslib.datasets.utils.tracking import ( diff --git a/opensportslib/models/backbones/builder.py b/opensportslib/models/backbones/builder.py index d572914..403628b 100644 --- a/opensportslib/models/backbones/builder.py +++ b/opensportslib/models/backbones/builder.py @@ -39,11 +39,9 @@ _PYG_IMPORT_ERROR_MSG = ( - "torch-geometric is required for graph/tracking models. " - "Install with: pip install \"opensportslib[py-geometric]\" " - "-f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html " - "or (editable): pip install -e \".[py-geometric]\" " - "-f https://pytorch-geometric.com/whl/torch-2.10.0+cu128.html" + "torch-geometric is required for tracking_collate_fn. " + "Run: `opensportslib setup --pyg` to install the correct version " + "based on your system (PyTorch & CUDA compatible)." ) From 4a9b377f58af78fd4911883b869c66f1e789a1e8 Mon Sep 17 00:00:00 2001 From: Jeet Date: Thu, 16 Apr 2026 17:10:35 +0530 Subject: [PATCH 2/6] ci-test --- .github/workflows/ci-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 378aefa..c4bacce 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -20,7 +20,7 @@ jobs: - name: Install package and test dependencies run: | python -m pip install --upgrade pip - opesnportslib setup --pyg --dali + opensportslib setup --pyg --dali - name: Run smoke tests run: bash scripts/run_smoke_tests.sh From 52a0207e012a02a0921e21c79f95587a4d8e0470 Mon Sep 17 00:00:00 2001 From: Jeet Date: Thu, 16 Apr 2026 17:18:48 +0530 Subject: [PATCH 3/6] cit-test fix --- .github/workflows/ci-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index c4bacce..199b74c 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -20,6 +20,7 @@ jobs: - name: Install package and test dependencies run: | python -m pip install --upgrade pip + pip install -e ".[test]" opensportslib setup --pyg --dali - name: Run smoke tests From ad7fed02b8b12a96aa2478514cd737e2a40c1c04 Mon Sep 17 00:00:00 2001 From: Jeet Date: Thu, 16 Apr 2026 17:21:28 +0530 Subject: [PATCH 4/6] few changes in docs --- README.md | 9 +++------ docs/getting-started/installation.md | 9 +++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 94ec820..bec5948 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ OpenSportsLib is designed for **researchers, ML engineers, and sports analytics ## Installation > Requires **Python 3.12+**. +> Supports CUDA 12.6 / 12.8 / 13.0 (with CPU fallback). +> PyTorch Geometric is supported up to PyTorch 2.10.*. ### Stable release @@ -53,12 +55,7 @@ opensportslib setup --pyg # Optional: install for DALI support opensportslib setup --dali -``` - -> Requires **Python 3.12+** -> Supports CUDA 12.6 / 12.8 / 13.0 (with CPU fallback). -> PyTorch Geometric is supported up to PyTorch 2.10.*. - +``` --- **Note:** diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 3350455..87db43b 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -13,6 +13,11 @@ conda create -n osl python=3.12 pip conda activate osl ``` +> Requires **Python 3.12+** +> Supports CUDA 12.6 / 12.8 / 13.0 (with CPU fallback). +> PyTorch Geometric is supported up to PyTorch 2.10.*. + + #### PyPI install Stable version ```bash @@ -38,10 +43,6 @@ opensportslib setup --pyg opensportslib setup --dali ``` -> Requires **Python 3.12+** -> Supports CUDA 12.6 / 12.8 / 13.0 (with CPU fallback). -> PyTorch Geometric is supported up to PyTorch 2.10.*. - --- !!! note From 2da47a8e029b68f943d85a77dbbc424e6bd008c9 Mon Sep 17 00:00:00 2001 From: Jeet Date: Thu, 16 Apr 2026 17:22:56 +0530 Subject: [PATCH 5/6] readme update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bec5948..e193225 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ OpenSportsLib is designed for **researchers, ML engineers, and sports analytics ## Installation -> Requires **Python 3.12+**. +> Requires **Python 3.12+** > Supports CUDA 12.6 / 12.8 / 13.0 (with CPU fallback). > PyTorch Geometric is supported up to PyTorch 2.10.*. From cbf1632bfb2b43e23dabd2e8fd46acfbd9e3e0a1 Mon Sep 17 00:00:00 2001 From: Jeet Date: Thu, 16 Apr 2026 17:23:41 +0530 Subject: [PATCH 6/6] readme update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e193225..1af9994 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ OpenSportsLib is designed for **researchers, ML engineers, and sports analytics ## Installation -> Requires **Python 3.12+** +> Requires **Python 3.12+**. > Supports CUDA 12.6 / 12.8 / 13.0 (with CPU fallback). > PyTorch Geometric is supported up to PyTorch 2.10.*.