Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide better error message when CanSAS file has invalid units (Trac #276) #423

Closed
smk78 opened this issue Mar 30, 2019 · 4 comments
Closed
Labels
Enhancement Feature requests and/or general improvements Major Big change in the code or important change in behaviour
Milestone

Comments

@smk78
Copy link
Contributor

smk78 commented Mar 30, 2019

Currently, if a CanSAS file with unsupported units is loaded into
SasView - for example, where "count" is not defined
in the standard - the following error message is returned when one
attempts to plot/fit the data:

'Plotting Error: Plottable.View: Given y and x are not of the same
length'

This is confusing (as it insinuates either Q or I data is missing)
but also draws attention away from the underlying problem.

Some form of syntactic checking is required and failure should respond
with a sensible error message.

Migrated from http://trac.sasview.org/ticket/276

{
    "status": "closed",
    "changetime": "2015-02-14T16:56:23",
    "_ts": "2015-02-14 16:56:23.910317+00:00",
    "description": "Currently, if a CanSAS file with unsupported units is loaded into \nSasView - for example, <I unit=\"count\"> where \"count\" is not defined \nin the standard - the following error message is returned when one \nattempts to plot/fit the data:\n\n'Plotting Error: Plottable.View: Given y and x are not of the same \nlength'\n\nThis is confusing (as it insinuates either Q or I data is missing) \nbut also draws attention away from the underlying problem.\n\nSome form of syntactic checking is required and failure should respond \nwith a sensible error message.\n",
    "reporter": "smk78",
    "cc": "",
    "resolution": "fixed",
    "workpackage": "SasView Bug Fixing",
    "time": "2014-12-19T11:47:14",
    "component": "SasView",
    "summary": "Provide better error message when CanSAS file has invalid units",
    "priority": "major",
    "keywords": "",
    "milestone": "SasView 3.1.0",
    "owner": "",
    "type": "enhancement"
}
@smk78 smk78 added this to the SasView 3.1.0 milestone Mar 30, 2019
@smk78 smk78 added Enhancement Feature requests and/or general improvements Incomplete Migration Major Big change in the code or important change in behaviour and removed Incomplete Migration labels Mar 30, 2019
@smk78
Copy link
Contributor Author

smk78 commented Mar 30, 2019

Trac update at 2014/12/23 09:41:28: smk78 commented:

ARR (who reported the above bug) adds:

My real point is there seems to be no strong reason for SasView to reject canSAS data files that do not conform if it could read them. A warning might help people but rejection if a more useful path is feasible seems to be likely to put off users.

SMK78 holds the view that:

If the SasView loader is rejecting (leaving aside how gracefully it is doing so) canSAS format data that isn't actually compliant with the agreed standard then it is doing its job! Otherwise, why have a standard?! If people see a need to wrap non-compliant data in the canSAS format then the proper course of action should surely be to discuss possible extensions of the format with canSAS, rather than request arbitrary adaptions of SasView?

@butlerpd
Copy link
Member

Trac update at 2015/02/01 23:16:11: butler changed milestone from "SasView Next Release +1" to "SasView 3.1"

@sasview-bot
Copy link

Trac update at 2015/02/14 10:16:27:

  • krzywon changed attachment from "" to "xg022435_001.xml"
  • krzywon commented:

Adrian's data file this ticket is based off of.

@sasview-bot
Copy link

Trac update at 2015/02/14 16:56:23:

  • krzywon commented:

To accommodate better error reporting, I modified the data_loader 'plugin' to give better errors. The data_loader now reads the Data(1/2)D.errors list and reports the errors within the console log. These errors are independent of incorrect format errors that preclude the data from loading. By doing this, data can be loaded but with certain caveats. TO tell the user, a warning box pops up whether or not the data set was loaded.

To make the CanSAS reader more robust, I added the ability to load data with ANY units regardless of the specification. The above actions occur when invalid units are given but the data are available to be plotted and fit.

Example console log error:
"""
Errors occurred while loading xg022435_001.xml
The data file loaded but with errors.
Error: CanSAS reader: unexpected "I" unit [count]; expecting [1/cm]
"""

  • krzywon changed resolution from "" to "fixed"
  • krzywon changed status from "new" to "closed"

@smk78 smk78 closed this as completed Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Feature requests and/or general improvements Major Big change in the code or important change in behaviour
Projects
None yet
Development

No branches or pull requests

3 participants