Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
wbenoit26 committed Feb 26, 2025
1 parent b657335 commit 9f7c9e5
Show file tree
Hide file tree
Showing 8 changed files with 2,546 additions and 3,972 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
virtualenvs-in-project: false
installer-parallel: true
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install and Build Docs
run: |
poetry install
uv sync
cd docs
make clean
make html
Expand Down
8 changes: 3 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ build:

jobs:
post_create_environment:
# Install poetry
- pip install poetry
# Tell poetry to not use a virtual environment
- poetry config virtualenvs.create false
# Install uv
- pip install uv
post_install:
# Install dependencies
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --all-extras
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv sync --all-extras

# Build documentation in the "docs/" directory with Sphinx
sphinx:
Expand Down
23 changes: 0 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,6 @@ To build with a specific version of PyTorch/CUDA, please see the PyTorch install
pip install ml4gw torch==2.5.1--extra-index-url=https://download.pytorch.org/whl/cu118
```

### Poetry installation
`ml4gw` is also fully compatible with use in Poetry, with your `pyproject.toml` set up like

```toml
[tool.poetry.dependencies]
python = "^3.9" # python versions 3.9-3.12 are supported
ml4gw = "^0.6"
```

To build against a specific PyTorch/CUDA combination, consult the PyTorch installation documentation above and specify the `extra-index-url` via the `tool.poetry.source` table in your `pyproject.toml`. For example, to build against CUDA 11.6, you would do something like:

```toml
[tool.poetry.dependencies]
python = "^3.9"
ml4gw = "^0.6"
torch = {version = "^2.0", source = "torch"}

[[tool.poetry.source]]
name = "torch"
url = "https://download.pytorch.org/whl/cu118"
priority = "explicit"
```

## Contributing
If you come across errors in the code, have difficulties using this software, or simply find that the current version doesn't cover your use case, please file an issue on our GitHub page, and we'll be happy to offer support.
We encourage users who encounter these difficulties to file issues on GitHub, and we'll be happy to offer support to extend our coverage to new or improved functionality.
Expand Down
19 changes: 0 additions & 19 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,3 @@ to see how to specify the desired torch version and :code:`--extra-index-url` fl
.. code-block:: console
$ pip install ml4gw torch==1.12.0 --extra-index-url=https://download.pytorch.org/whl/cu116
Poetry
======
:code:`ml4gw` is also fully compatible with `Poetry <https://python-poetry.org/>`_, with a :code:`pyproject.toml` set up like

.. code-block:: toml
[tool.poetry.dependencies]
python = "^3.8" # python versions 3.8-3.10 are supported
ml4gw = "^0.1.0"
torch = {version = "^1.12", source = "torch"}
[[tool.poetry.source]]
name = "torch"
url = "https://download.pytorch.org/whl/cu116"
secondary = true
default = false
which will install ml4gw with PyTorch 1.12 built with CUDA 11.6.
7 changes: 4 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

This repo hosts the Jupyter notebook and the environment files for the `ml4gw` tutorial.

If you use `poetry`, the environment can be installed and a Jupyter kernel created with
If you use `uv`, the environment can be installed and a Jupyter kernel created with
```bash
poetry install
poetry run python -m ipykernel install --user --name ml4gw_tutorial
uv sync --no-install-project
source .venv/bin/activate
python -m ipykernel install --user --name ml4gw_tutorial
```

If you use a different environment manager, all of the packages listed in the `pyproject.toml` file can be `pip install`ed into whatever environment you desire.
Expand Down
3,899 changes: 0 additions & 3,899 deletions examples/poetry.lock

This file was deleted.

31 changes: 15 additions & 16 deletions examples/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
[tool.poetry]
[project]
name = "ml4gw-tutorial"
version = "0.1.0"
description = "Notebook introducing aspects of the ml4gw library"
authors = ["William Benoit"]
license = "MIT"
authors = [{ name = "William Benoit" }]
requires-python = ">=3.10,<3.13"
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
ml4gw = "0.6.1"
matplotlib = "3.10.0"
h5py = "^3.12"
torchmetrics = "1.6.0"
lightning = "2.4.0"
rich = ">=10.2.2"
jupyter = "^1.1.1"

license = "MIT"
dependencies = [
"ml4gw==0.6.1",
"matplotlib==3.10.0",
"h5py~=3.12",
"torchmetrics==1.6.0",
"lightning==2.4.0",
"rich>=10.2.2",
"jupyter>=1.1.1,<2",
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"
Loading

0 comments on commit 9f7c9e5

Please sign in to comment.