Skip to content

Commit

Permalink
final refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Oct 31, 2023
1 parent 8e565b7 commit ad17a9e
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 37 deletions.
4 changes: 2 additions & 2 deletions src/wags_tails/base_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import requests

from wags_tails.storage_utils import get_data_dir, get_latest_local_file
from wags_tails.version_utils import DATE_VERSION_PATTERN, parse_file_version
from .core_utils.storage import get_data_dir, get_latest_local_file
from .core_utils.versioning import DATE_VERSION_PATTERN, parse_file_version

_logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions src/wags_tails/chembl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import requests

from wags_tails.base_source import DataSource, RemoteDataError
from wags_tails.download_utils import download_http
from .base_source import DataSource, RemoteDataError
from .core_utils.downloads import download_http


class ChemblData(DataSource):
Expand Down
6 changes: 3 additions & 3 deletions src/wags_tails/chemidplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import requests

from wags_tails.base_source import DataSource, RemoteDataError
from wags_tails.download_utils import download_http
from wags_tails.version_utils import DATE_VERSION_PATTERN
from .base_source import DataSource, RemoteDataError
from .core_utils.downloads import download_http
from .core_utils.versioning import DATE_VERSION_PATTERN


class ChemIDplusData(DataSource):
Expand Down
4 changes: 4 additions & 0 deletions src/wags_tails/core_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Provide generic helper functions for frequent data-related tasks.
Intended to be largely for internal use.
"""
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/wags_tails/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pathlib import Path
from typing import Callable, Optional

from wags_tails.base_source import DataSource
from .base_source import DataSource


class CustomData(DataSource):
Expand Down
6 changes: 3 additions & 3 deletions src/wags_tails/do.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import requests

from wags_tails.base_source import GitHubDataSource
from wags_tails.download_utils import download_http
from wags_tails.version_utils import DATE_VERSION_PATTERN
from .base_source import GitHubDataSource
from .core_utils.downloads import download_http
from .core_utils.versioning import DATE_VERSION_PATTERN


class DoData(GitHubDataSource):
Expand Down
6 changes: 3 additions & 3 deletions src/wags_tails/drugbank.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import requests

from wags_tails.base_source import DataSource, RemoteDataError
from wags_tails.download_utils import download_http, handle_zip
from wags_tails.version_utils import parse_file_version
from .base_source import DataSource, RemoteDataError
from .core_utils.downloads import download_http, handle_zip
from .core_utils.versioning import parse_file_version

_logger = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions src/wags_tails/drugsatfda.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import requests

from wags_tails.base_source import DataSource, RemoteDataError
from wags_tails.download_utils import download_http, handle_zip
from wags_tails.version_utils import DATE_VERSION_PATTERN
from .base_source import DataSource, RemoteDataError
from .core_utils.downloads import download_http, handle_zip
from .core_utils.versioning import DATE_VERSION_PATTERN


class DrugsAtFdaData(DataSource):
Expand Down
8 changes: 4 additions & 4 deletions src/wags_tails/guide_to_pharmacology.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import requests

from wags_tails.base_source import DataSource, RemoteDataError
from wags_tails.download_utils import download_http
from wags_tails.storage_utils import get_latest_local_file
from wags_tails.version_utils import parse_file_version
from .base_source import DataSource, RemoteDataError
from .core_utils.downloads import download_http
from .core_utils.storage import get_latest_local_file
from .core_utils.versioning import parse_file_version

_logger = logging.getLogger(__name__)

Expand Down
8 changes: 4 additions & 4 deletions src/wags_tails/hemonc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import requests

from wags_tails.base_source import DataSource, RemoteDataError
from wags_tails.download_utils import download_http
from wags_tails.storage_utils import get_latest_local_file
from wags_tails.version_utils import parse_file_version
from .base_source import DataSource, RemoteDataError
from .core_utils.downloads import download_http
from .core_utils.storage import get_latest_local_file
from .core_utils.versioning import parse_file_version

_logger = logging.getLogger(__name__)

Expand Down
8 changes: 4 additions & 4 deletions src/wags_tails/mondo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import requests

from wags_tails.base_source import GitHubDataSource, RemoteDataError
from wags_tails.download_utils import download_http
from wags_tails.storage_utils import get_latest_local_file
from wags_tails.version_utils import DATE_VERSION_PATTERN, parse_file_version
from .base_source import GitHubDataSource, RemoteDataError
from .core_utils.downloads import download_http
from .core_utils.storage import get_latest_local_file
from .core_utils.versioning import DATE_VERSION_PATTERN, parse_file_version

_logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions src/wags_tails/ncit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import requests

from wags_tails.base_source import DataSource, RemoteDataError
from wags_tails.download_utils import download_http, handle_zip
from .base_source import DataSource, RemoteDataError
from .core_utils.downloads import download_http, handle_zip


class NcitData(DataSource):
Expand Down
6 changes: 3 additions & 3 deletions src/wags_tails/oncotree.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import requests

from wags_tails.base_source import DataSource, RemoteDataError
from wags_tails.download_utils import download_http
from wags_tails.version_utils import DATE_VERSION_PATTERN
from .base_source import DataSource, RemoteDataError
from .core_utils.downloads import download_http
from .core_utils.versioning import DATE_VERSION_PATTERN

_logger = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions src/wags_tails/rxnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import requests

from wags_tails.base_source import DataSource, RemoteDataError
from wags_tails.download_utils import download_http
from wags_tails.version_utils import DATE_VERSION_PATTERN
from .base_source import DataSource, RemoteDataError
from .core_utils.downloads import download_http
from .core_utils.versioning import DATE_VERSION_PATTERN

_logger = logging.getLogger(__name__)

Expand Down

0 comments on commit ad17a9e

Please sign in to comment.