Skip to content

Commit

Permalink
Change how foldcomp datasets are downloaded to specific location (#339)
Browse files Browse the repository at this point in the history
* change how foldcomp datasets are downloaded to specific location

* fix typo

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update changelog

* Bump version strings

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
a-r-j and pre-commit-ci[bot] committed Aug 30, 2023
1 parent d9f9656 commit 193e24e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### 1.7.3 - 30/08/2023

* Fixes edge case in FoldComp database download if target directory has same name as database ([#339](https://github.com/a-r-j/graphein/pull/339))

### 1.7.2 - 28/08/2023

* Pins BioPandas version to latest

### 1.7.1 - 26/07/2023

#### New Features
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
copyright = f"{datetime.datetime.now().year}, {author}"

# The full version, including alpha/beta/rc tags
release = "1.7.2"
release = "1.7.3"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion graphein/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .testing import *

__author__ = "Arian Jamasb <arian@jamasb.io>"
__version__ = "1.7.2"
__version__ = "1.7.3"


logger.configure(
Expand Down
9 changes: 6 additions & 3 deletions graphein/ml/datasets/foldcomp_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,19 @@ def download(self):
os.path.exists(self.root / f) for f in self._database_files
):
log.info(f"Downloading FoldComp dataset {self.database}...")
curr_dir = os.getcwd()
os.chdir(self.root)
try:
foldcomp.setup(self.database)
except RuntimeError:
_ = self.async_setup()
asyncio.run(_)
os.chdir(curr_dir)
log.info("Download complete.")
log.info("Moving files to raw directory...")
# log.info("Moving files to raw directory...")

for f in self._database_files:
shutil.move(f, self.root)
# for f in self._database_files:
# shutil.move(f, self.root)
else:
log.info(f"FoldComp database already downloaded: {self.root}.")

Expand Down

0 comments on commit 193e24e

Please sign in to comment.