Opened 7 years ago
#1077 new defect
model name must be a valid C identifier
Reported by: | pkienzle | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | sasmodels 1.0 |
Component: | sasmodels | Keywords: | |
Cc: | Work Package: | SasView Bug Fixing |
Description
Clean up model name/id/filename handling, and warn user cleanly if anything is amiss.
The sasmodels compiler raises an error when loading a plugin model with spaces in its name, but it reports as a missing semicolon in the kernel_iq.c file which the user did not touch. The real error is in the python file defining the model, so the message is confusing to the user.
The distinction between model name and model id has become muddy. Originally the id was to be the internal name that was a proper identifier and the name was the display name that was shown in the user interface. At some point the system evolved so that name is used for both and id is (mostly?) ignored. However, old code for generating a nice display name if one was not provided in the file is still active, which puts spaces between words and capitalization of the first word. The result is that if the name is not present, the model may give the missing semicolon error.
An additional wrinkle: the internal name must match the filename so we can find the model definition without having to load all models.