Skip to content

Commit

Permalink
(#623) Refactor geardb.py to check for h5ad file existence before pro…
Browse files Browse the repository at this point in the history
…ceeding
  • Loading branch information
adkinsrs committed Aug 9, 2024
1 parent 1551df6 commit 62052c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/geardb.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ def get_analysis(analysis, dataset_id, session_id):
ana.type = analysis['type']
else:
ana.discover_type()

# Check that the h5ad file exists
if not os.path.exists(ana.dataset_path()):
raise FileNotFoundError("No h5 file found for the passed in analysis")

else:
ds = Dataset(id=dataset_id, has_h5ad=1)
h5_path = ds.get_file_path()
Expand Down

0 comments on commit 62052c2

Please sign in to comment.