Skip to content

Commit

Permalink
Update zenodo link to undamaged database file. Fix issues 251 and 252
Browse files Browse the repository at this point in the history
  • Loading branch information
DarioMarzella committed Nov 2, 2023
1 parent 01e2137 commit bcdf09e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions PANDORA/Database/Database.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def construct_database(self, save=PANDORA.PANDORA_data + '/PANDORA_database.pkl'
Returns: Database object
'''
#Generate the necessary folders
create_db_folders()

# Download the data
self.download_data(download = download, data_dir = data_dir)

Expand Down Expand Up @@ -356,14 +359,14 @@ def create_db_folders(db_path=None):
else:
print(f'WARNING: folder {D} already exists!')

def fetch_database(db_out_path, db_url='https://zenodo.org/records/7318263/files/default.tar.gz?download=1'):
def fetch_database(db_out_path, db_url='https://zenodo.org/records/10067121/files/default.tar.gz?download=1'):
"""Downloads the pre-generated database from zotero.
Args:
db_out_path (str): Path to the database to be downloaded,
should be pointing at a "PANDORA_databases" folder.
db_url (str, optional): URL for the zenodo database.
Defaults to 'https://zenodo.org/records/7318263/files/default.tar.gz?download=1'.
Defaults to 'https://zenodo.org/records/10067121/files/default.tar.gz?download=1'.
Raises:
Exception: If the PANDORA_database.pkl file is not found in the destination folder,
Expand All @@ -383,7 +386,7 @@ def fetch_database(db_out_path, db_url='https://zenodo.org/records/7318263/files
print('Database correctly retrieved')
else:
print('ERROR: Something is missing from the retrieved database.')
print('Please check the path you provided')
print('Please check the path you provided. Use Database.create_db_folders to generate the necessary folders.')
raise Exception('Missing PANDORA_database.pkl')

except Exception as e:
Expand Down

0 comments on commit bcdf09e

Please sign in to comment.