You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
As pointed out in #2263 models throw error after running python shell editor
To Reproduce
Steps to reproduce the behavior:
Select model and compute
Open python shell editor
Select another model
See error
5:34:41 - ERROR: Traceback (most recent call last):
File "sas/sascalc/data_util/calcthread.py", line 272, in _run
File "sas/qtgui/Perspectives/Fitting/ModelThread.py", line 179, in compute
File "sasmodels/sasview_model.py", line 713, in calculate_Iq
return self._calculate_Iq(qx, qy)
File "sasmodels/sasview_model.py", line 721, in _calculate_Iq
self.__class__._model = core.build_model(self._model_info)
File "sasmodels/core.py", line 335, in build_model
source = generate.make_source(model_info)
File "sasmodels/generate.py", line 1025, in make_source
lineno = getframeinfo(currentframe()).lineno + 2
File "inspect.py", line 1473, in getframeinfo
File "PyInstaller/hooks/rthooks/pyi_rth_inspect.py", line 25, in _pyi_getsourcefile
AttributeError: module '__main__' has no attribute '__file__'
15:34:41 - ERROR: Traceback (most recent call last):
File "sas/sascalc/data_util/calcthread.py", line 272, in _run
File "sas/qtgui/Perspectives/Fitting/ModelThread.py", line 179, in compute
File "sasmodels/sasview_model.py", line 713, in calculate_Iq
return self._calculate_Iq(qx, qy)
File "sasmodels/sasview_model.py", line 721, in _calculate_Iq
self.__class__._model = core.build_model(self._model_info)
File "sasmodels/core.py", line 335, in build_model
source = generate.make_source(model_info)
File "sasmodels/generate.py", line 1025, in make_source
lineno = getframeinfo(currentframe()).lineno + 2
File "inspect.py", line 1473, in getframeinfo
File "PyInstaller/hooks/rthooks/pyi_rth_inspect.py", line 25, in _pyi_getsourcefile
AttributeError: module '__main__' has no attribute '__file__'
SasView version (please complete the following information):
5.0.5 after 2263 being merged
Operating system (please complete the following information):
All
Additional context
As mentioned by @pkienzle:
`I suspect the error is a result of the python app builder putting modules in a zip file. IIRC the import hook which loads the module from the zip does not define file. That doesn't explain why the problem is showing up now.
The code which is failing is not critical. It is telling the model compiler that the code is coming from the current line in generate.py so that it'll be easier to interpret compiler errors. As a short term fix we can wrap this in an exception handler and use a hard-coded line number as the default. It doesn't matter if the offset drifts a little as the code is modified; just knowing that the code is coming from generate.py should be enough to debug any problems.`
The text was updated successfully, but these errors were encountered:
Describe the bug
As pointed out in #2263 models throw error after running python shell editor
To Reproduce
Steps to reproduce the behavior:
SasView version (please complete the following information):
Operating system (please complete the following information):
Additional context
As mentioned by @pkienzle:
`I suspect the error is a result of the python app builder putting modules in a zip file. IIRC the import hook which loads the module from the zip does not define file. That doesn't explain why the problem is showing up now.
The code which is failing is not critical. It is telling the model compiler that the code is coming from the current line in generate.py so that it'll be easier to interpret compiler errors. As a short term fix we can wrap this in an exception handler and use a hard-coded line number as the default. It doesn't matter if the offset drifts a little as the code is modified; just knowing that the code is coming from generate.py should be enough to debug any problems.`
The text was updated successfully, but these errors were encountered: