From ad776689262132564f960f065187a068d29a86ab Mon Sep 17 00:00:00 2001 From: willis Date: Mon, 16 Sep 2024 16:17:01 -0700 Subject: [PATCH] updated build system for readthedocs compatability (#23) added pip options to top of requirements files --- .github/workflows/python-package.yml | 4 ++-- .readthedocs.yaml | 5 ++++- deps/requirements.txt | 2 +- deps/torch_extra_requirements.txt | 1 + deps/torch_requirements.txt | 1 + ramannoodle/io/io_utils.py | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d0b1f62..e40f079 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -29,8 +29,8 @@ jobs: pip install uv uv pip install ${{ matrix.uv-arg }} --system -r deps/requirements.txt uv pip install ${{ matrix.uv-arg }} --system -r deps/torch_geometric_requirements.txt - uv pip install ${{ matrix.uv-arg }} --system -r deps/torch_requirements.txt --index-url https://download.pytorch.org/whl/cpu - uv pip install ${{ matrix.uv-arg }} --system --no-index -r deps/torch_extra_requirements.txt -f https://data.pyg.org/whl/torch-2.4.0+cpu.html + uv pip install ${{ matrix.uv-arg }} --system -r deps/torch_requirements.txt + uv pip install ${{ matrix.uv-arg }} --system --no-index -r deps/torch_extra_requirements.txt - name: Analyzing the code with pylint if: ${{ matrix.os != 'windows-latest' }} # Windows throws strange linting errors run: | diff --git a/.readthedocs.yaml b/.readthedocs.yaml index a96f2ec..ad58537 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -8,7 +8,10 @@ build: python: install: - requirements: docs/requirements.txt - - requirements: requirements.txt + - requirements: deps/requirements.txt + - requirements: deps/torch_requirements.txt + - requirements: deps/torch_geometric_requirements.txt + - requirements: deps/torch_extra_requirements.txt sphinx: configuration: docs/source/conf.py diff --git a/deps/requirements.txt b/deps/requirements.txt index eb23a06..0349fcf 100644 --- a/deps/requirements.txt +++ b/deps/requirements.txt @@ -20,4 +20,4 @@ spglib >= 1.16.4;python_version=='3.12' # minimum working tabulate >= 0.8.8;python_version=='3.10' # minimum working tabulate >= 0.8.8;python_version=='3.11' # minimum working tabulate >= 0.8.8;python_version=='3.12' # minimum working -tqdm +tqdm >= 2.0 diff --git a/deps/torch_extra_requirements.txt b/deps/torch_extra_requirements.txt index 96d312b..6ceec11 100644 --- a/deps/torch_extra_requirements.txt +++ b/deps/torch_extra_requirements.txt @@ -1,2 +1,3 @@ +-f https://data.pyg.org/whl/torch-2.4.0+cpu.html torch-scatter torch-sparse diff --git a/deps/torch_requirements.txt b/deps/torch_requirements.txt index b647dc5..04e31d5 100644 --- a/deps/torch_requirements.txt +++ b/deps/torch_requirements.txt @@ -1,3 +1,4 @@ +--index-url https://download.pytorch.org/whl/cpu torch==2.4.1;sys_platform=="darwin" torch==2.4.1+cpu;sys_platform=="linux" torch==2.4.1+cpu;sys_platform=="win32" diff --git a/ramannoodle/io/io_utils.py b/ramannoodle/io/io_utils.py index 0605205..e99d58f 100644 --- a/ramannoodle/io/io_utils.py +++ b/ramannoodle/io/io_utils.py @@ -121,7 +121,7 @@ def _read_polarizability_dataset( atomic_numbers_list: list[list[int]] = [] positions_list: list[NDArray[np.float64]] = [] polarizabilities: list[NDArray[np.float64]] = [] - for file_index, filepath in tqdm(list(enumerate(filepaths)), unit="files"): + for file_index, filepath in tqdm(list(enumerate(filepaths)), unit=" files"): lattice, atomic_numbers, positions, polarizability = ( read_structure_and_polarizability_fn(filepath) )