Skip to content

Commit

Permalink
adds helpful messages to solve #24
Browse files Browse the repository at this point in the history
  • Loading branch information
erickmartins committed Oct 10, 2023
1 parent c5223a6 commit 620fd54
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jax_omeroutils/intake.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,19 @@ def load_md_from_file(md_filepath, sheet_name=0):
if 'project' in md.columns:
md = md.dropna(subset=['filename', 'project', 'dataset'])\
.dropna(axis='columns', how='all')
if md.empty:
logger.error('Your spreadsheet rows need to contain ' +
'filename, project and dataset names. Cannot ' +
'proceed with import.')
raise ValueError('Spreadsheet needs filename, project and dataset')
elif 'screen' in md.columns:
md = md.dropna(subset=['filename', 'screen'])\
.dropna(axis='columns', how='all')
if md.empty:
logger.error('Your spreadsheet rows need to contain ' +
'filename and screen names. Cannot ' +
'proceed with import.')
raise ValueError('Spreadsheet needs filename and screen')

# protect against extra spaces on 'omero user' and 'omero group'
md_header.index = md_header.index.str.strip()
Expand Down

0 comments on commit 620fd54

Please sign in to comment.