From feb3671ded89c3e55260280cd7dc22026589a57f Mon Sep 17 00:00:00 2001 From: Nikhil Shenoy Date: Mon, 22 Jan 2024 16:39:39 +0530 Subject: [PATCH] removed torch-dependency --- README.md | 13 ++++++------- env.yml | 19 ------------------- src/openqdc/datasets/base.py | 3 +-- src/openqdc/utils/__init__.py | 2 -- src/openqdc/utils/io.py | 16 ---------------- 5 files changed, 7 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index b3f769a..c143e95 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,15 @@ Open Quantum Data Commons -## Setup Datasets - -Use the scripts in `setup/` to download the datasets. For more information, see the [README](setup/README.md) in the `setup/` directory. - -# Install the library in dev mode +### Installing openQDC +```bash +git clone git@github.com:OpenDrugDiscovery/openQDC.git +cd openQDC +# use mamba/conda +mamba env create -n openqdc -f env.yml pip install -e . ``` -## Development lifecycle - ### Tests You can run tests locally with: diff --git a/env.yml b/env.yml index eefbd3a..a88b919 100644 --- a/env.yml +++ b/env.yml @@ -8,39 +8,22 @@ dependencies: - tqdm - loguru - fsspec - - s3fs - gcsfs - - joblib - - prettytable - - pyrootutils # Scientific - pandas - numpy - - scipy - - sympy # Chem - - ipdb - datamol #==0.9.0 - rdkit #-pypi #==2022.9.3 - ase - - # ML - #- einops =0.6.0 - - pytorch - dscribe # other stuffs - h5py >=3.8.0 - gdown #==4.6.4 - # Viz - - matplotlib - - seaborn - - ipywidgets - - nglview - # Dev - pytest >=6.0 - pytest-cov @@ -49,8 +32,6 @@ dependencies: - jupyterlab - pre-commit - ruff - - ipykernel - - isort # Doc - mkdocs diff --git a/src/openqdc/datasets/base.py b/src/openqdc/datasets/base.py index d7c8234..29b4646 100644 --- a/src/openqdc/datasets/base.py +++ b/src/openqdc/datasets/base.py @@ -6,7 +6,6 @@ import numpy as np import pandas as pd -import torch from ase.io.extxyz import write_extxyz from loguru import logger from sklearn.utils import Bunch @@ -82,7 +81,7 @@ def read_qc_archive_h5( return samples -class BaseDataset(torch.utils.data.Dataset): +class BaseDataset: __energy_methods__ = [] __force_methods__ = [] energy_target_names = [] diff --git a/src/openqdc/utils/__init__.py b/src/openqdc/utils/__init__.py index aeb5321..bc05f90 100644 --- a/src/openqdc/utils/__init__.py +++ b/src/openqdc/utils/__init__.py @@ -6,7 +6,6 @@ load_hdf5_file, load_json, load_pkl, - load_torch, makedirs, save_pkl, set_cache_dir, @@ -19,7 +18,6 @@ "makedirs", "load_hdf5_file", "load_json", - "load_torch", "create_hdf5_file", "check_file", "set_cache_dir", diff --git a/src/openqdc/utils/io.py b/src/openqdc/utils/io.py index 6105d93..9c98059 100644 --- a/src/openqdc/utils/io.py +++ b/src/openqdc/utils/io.py @@ -5,7 +5,6 @@ import fsspec import h5py -import torch from ase.atoms import Atoms from fsspec.implementations.local import LocalFileSystem from gcsfs import GCSFileSystem @@ -70,21 +69,6 @@ def copy_exists(local_path): return os.path.exists(local_path) or gcp_filesys.exists(remote_path) -def load_torch_gcs(path): - """Loads torch file""" - # get file system - fs: GCSFileSystem = fsspec.filesystem("gs") - - # load from GCS - with fs.open(path, "rb") as fp: - return torch.load(fp) - - -def load_torch(path): - """Loads torch file""" - return torch.load(path) - - def makedirs_gcs(path, exist_ok=True): """Creates directory""" fs: GCSFileSystem = fsspec.filesystem("gs")