From 1a36aebef25699a7ffddcc845040ee6d3f48a5fa Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Mon, 11 Oct 2021 11:02:43 +0100 Subject: [PATCH 1/3] make torch optional --- .github/workflows/python-app.yml | 2 +- requirements.txt | 2 -- setup.py | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 60a4ed1c..999df39a 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -21,7 +21,7 @@ jobs: pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi pip install git+https://github.com/SheffieldSolar/PV_Live-API - pip install -e . + pip install -e .[torch] - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/requirements.txt b/requirements.txt index 4ed46abd..8fd4e4aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,8 +8,6 @@ xarray ipykernel h5netcdf gcsfs -torch -pytorch-lightning dask pvlib pyproj diff --git a/setup.py b/setup.py index 50613c42..2fe44d4d 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ author_email="info@openclimatefix.org", company="Open Climate Fix Ltd", install_requires=install_requires, + extras_require={"torch": ["torch"]}, long_description=long_description, long_description_content_type="text/markdown", packages=find_packages(), From 907e523088defb2ce891bc7d275479fcda7c7d71 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Mon, 11 Oct 2021 11:07:36 +0100 Subject: [PATCH 2/3] update docs --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 33a3ab4b..b64a7127 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,12 @@ conda activate nowcasting_dataset pip install -e . ``` +Note you can install the [pytorch](https://github.com/pytorch/pytorch) using +```shell +pip install -e .[torch] +``` +but it is only used to create a dataloader for machine learning models. + ## Pip A (probably older) version is also available through `pip install nowcasting-dataset` From 35403068277acb1e23bc7aca3a56ecd23078c816 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Mon, 11 Oct 2021 11:40:53 +0100 Subject: [PATCH 3/3] fix --- README.md | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b64a7127..4c526cea 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,8 @@ conda activate nowcasting_dataset pip install -e . ``` -Note you can install the [pytorch](https://github.com/pytorch/pytorch) using +Note you can install the [pytorch](https://github.com/pytorch/pytorch) +and [pytorch_lightning](https://github.com/PyTorchLightning/pytorch-lightning) using ```shell pip install -e .[torch] ``` diff --git a/setup.py b/setup.py index 2fe44d4d..b38cf1ce 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ author_email="info@openclimatefix.org", company="Open Climate Fix Ltd", install_requires=install_requires, - extras_require={"torch": ["torch"]}, + extras_require={"torch": ["torch", "pytorch_lightning"]}, long_description=long_description, long_description_content_type="text/markdown", packages=find_packages(),