Skip to content

custom model name and id must be the same (Trac #674) #805

@pkienzle

Description

@pkienzle

The id for the model comes from the filename, and can be used to find and load the model on the path. The name for the model is the name displayed in the dialog box, which need not match the name of the python file.

If the name and id differs for a custom model then custom model directory processing halts with an error such as the following:

2016-09-29 07:51:39,932 ERROR Traceback (most recent call last):
  File "/Users/pkienzle/Source/sasview-new/src/sas/sasgui/perspectives/fitting/basepage.py", line 1882, in _show_combox_helper
    m_list.append(self.model_dict[str_m])
KeyError: 'myonion'

and the remaining custom models will not appear in the !SasView gui.

For the file model_name.py, id is model_name and name defaults to "Model Name". We may want to change this default behaviour (defined in sasmodels/modelinfo.py:make_model_info).

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

{
    "status": "closed",
    "changetime": "2016-10-08T14:22:32",
    "_ts": "2016-10-08 14:22:32.148957+00:00",
    "description": "The id for the model comes from the filename, and can be used to find and load the model on the path. The name for the model is the name displayed in the dialog box, which need not match the name of the python file.\n\nIf the name and id differs for a custom model then custom model directory processing halts with an error such as the following:\n{{{\n2016-09-29 07:51:39,932 ERROR Traceback (most recent call last):\n  File \"/Users/pkienzle/Source/sasview-new/src/sas/sasgui/perspectives/fitting/basepage.py\", line 1882, in _show_combox_helper\n    m_list.append(self.model_dict[str_m])\nKeyError: 'myonion'\n}}}\nand the remaining custom models will not appear in the !SasView gui.\n\nFor the file model_name.py, id is model_name and name defaults to \"Model Name\".  We may want to change this default behaviour (defined in sasmodels/modelinfo.py:make_model_info).",
    "reporter": "pkienzle",
    "cc": "",
    "resolution": "fixed",
    "workpackage": "SasView Bug Fixing",
    "time": "2016-09-29T12:26:12",
    "component": "SasView",
    "summary": "custom model name and id must be the same",
    "priority": "major",
    "keywords": "",
    "milestone": "SasView 4.1.0",
    "owner": "mathieu",
    "type": "defect"
}

Metadata

Metadata

Assignees

Labels

DefectBug or undesirable behaviourMajorBig change in the code or important change in behaviour

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions