Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/remove-torch-dependency' into tm…
Browse files Browse the repository at this point in the history
…qm_add
  • Loading branch information
FNTwin committed Jan 24, 2024
2 parents 2b88e10 + feb3671 commit 7d0f6c1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 46 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 0 additions & 19 deletions env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,8 +32,6 @@ dependencies:
- jupyterlab
- pre-commit
- ruff
- ipykernel
- isort

# Doc
- mkdocs
Expand Down
3 changes: 1 addition & 2 deletions src/openqdc/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = []
Expand Down
2 changes: 0 additions & 2 deletions src/openqdc/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
load_hdf5_file,
load_json,
load_pkl,
load_torch,
makedirs,
save_pkl,
set_cache_dir,
Expand All @@ -19,7 +18,6 @@
"makedirs",
"load_hdf5_file",
"load_json",
"load_torch",
"create_hdf5_file",
"check_file",
"set_cache_dir",
Expand Down
16 changes: 0 additions & 16 deletions src/openqdc/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 7d0f6c1

Please sign in to comment.