Skip to content

add error handling to core.build_snakes #3

@fboxwala

Description

@fboxwala

Our build_snakes function reads two .csv files and expects to see the following columns:

File1: common name, scientific name
File2: scientific name, weight, length

If any of these columns are missing we get messy python errors:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "caduceus/core.py", line 30, in build_snakes
    snake.weight = int(row["weight"])
TypeError: int() argument must be a string or a number, not 'NoneType'

We should add error handling to build_snakes so that if a column is missing we exit with a nice error message such as:

"Caduceus expects specific columns in csv files to work. See help(build_snakes) for the specifications"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions