Skip to content

Commit

Permalink
Merge pull request #148 from SNEWS2/JostMigenda/JOSSReview
Browse files Browse the repository at this point in the history
Model download improvements
  • Loading branch information
JostMigenda authored Nov 17, 2021
2 parents 4ed158a + f7cb0e6 commit 4630b45
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/snewpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def retrieve(url, local_file):

for url in model_urls[model]:
local_file = model_dir + url.split(model, maxsplit=1)[1]
if os.path.exists(local_file) and local_file.find('README') == -1:
if os.path.exists(local_file) and local_file.find('README') == -1 and local_file.find('.ipynb') == -1:
print(f"File '{local_file}' already exists. Skipping download.")
else:
if not os.path.isdir(os.path.dirname(local_file)):
Expand All @@ -95,6 +95,7 @@ def retrieve(url, local_file):
exceptions.append(result.exception())
if exceptions:
print(f"ERROR: {len(exceptions)} exceptions occured. ({exceptions})")
print("Please check your internet connection and try again later. If this persists, please report it at https://github.com/SNEWS2/snewpy/issues")
exit(1)
pool.shutdown(wait=False)

Expand Down

0 comments on commit 4630b45

Please sign in to comment.