Skip to content

more-perspicuous error-messages for reading matrixmarket files? #308

Description

@chetmurthy

Recently I was writing tests to read matrix market files written by Scipy, and I made the mistake of writing a diagonal matrix with scipy as "skew-symmetric" and then reading it with sprs. Of course, scipy dutifully wrote it out and marked it as skew-symmetric, and then sprs blew up with BadMatrixMarketFile. All well and correct.

But it's a little opaque, as error-messages go, and I had to puzzle for a while, reading the sprs read_XXXX source code, before I realized what was going wrong (and hence, my mistake). Looking at the source code of read_matrix_market_from_bufread, there are twelve places where the error is raised, and they all have different meanings. I thought: "gee, maybe this error should carry a string with it, so we can write a description of the erroneous input (including maybe line-number?)

Just a thought. It's obviously a low-priority change, but I wonder if maybe it might be useful for users.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions