Skip to content

Commit

Permalink
catching ConnectionError as well for binding-db, fixing genomealliance
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDietzMorris committed Jan 28, 2025
1 parent a867b84 commit 9b65b10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions parsers/BINDING/src/loadBINDINGDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def get_latest_source_version(self) -> str:
error_message = f'BINDING-DB timed out attempting to retrieve version...'
except ValueError:
error_message = f'BINDING-DB get_latest_source_version got a response but could not determine the version..'
except requests.exceptions.ConnectionError as e:
error_message = f'BINDING-DB get_latest_source_version failed: {e}..'
self.logger.error(error_message + ' Returning last known valid version: 202501')
self.bindingdb_version = '202501'
return self.bindingdb_version
Expand Down
8 changes: 1 addition & 7 deletions parsers/GenomeAlliance/src/loadGenomeAlliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ def __init__(self, test_mode: bool = False, source_data_dir: str = None):

self.latest_version = None
self.latest_version = self.get_latest_source_version()
#self.genome_alliance_url = f'https://download.alliancegenome.org/{self.get_latest_source_version()}/ORTHOLOGY-ALLIANCE/COMBINED/'
#self.genome_alliance_ortholog_file = 'ORTHOLOGY-ALLIANCE_COMBINED_25.tsv.gz'

self.genome_alliance_url = 'https://fms.alliancegenome.org/download/'
self.self.genome_alliance_ortholog_file = 'ORTHOLOGY-ALLIANCE_COMBINED.tsv.gz'
self.genome_alliance_ortholog_file = 'ORTHOLOGY-ALLIANCE_COMBINED.tsv.gz'
self.data_files = [self.genome_alliance_ortholog_file]

def get_latest_source_version(self) -> str:
Expand All @@ -51,11 +49,7 @@ def get_latest_source_version(self) -> str:
:return:
"""
#if not self.latest_version:
# self.latest_version = '5.3.0'

self.latest_version = requests.get("https://www.alliancegenome.org/api/releaseInfo").json()['releaseVersion']

return self.latest_version

def get_data(self) -> int:
Expand Down

0 comments on commit 9b65b10

Please sign in to comment.