Fitunktionen schreiben, Syntax-Check #148

Closed
opened 2023-11-20 15:04:18 +00:00 by saeckech · 1 comment
Member

Wenn ich eine Fitfunktion über das Fenster Fit->create fit function erstelle und z.B. vergesse einen String zu beenden startet das Programm nicht mehr. Ich konnte dann nur noch unter .auswerten/usermodels den Fehler beheben. Kann man bei selbstgeschriebenen Funktionen einen Test drüber laufen lassen, sodass das Programm noch startet wenn man sich vertippt?

Danach kam ein weiterer Fehler den ich nicht verstanden habe. Ich habe die Funktion gelöscht, genauso nochmal erstellt und dann gings.

Error Log zum ersten Fehler:
SyntaxError: EOL while scanning string literal
20/11/2023 15:51:15 - INFO - root : Use C functions
20/11/2023 15:51:17 - ERROR - root : Uncaught exception:
Traceback (most recent call last):
File "/tmp/.mount_NMRevaGTdPW2/usr/bin/evaluate.py", line 24, in
mplQt = NMRMainWindow()
File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/main/mainwindow.py", line 75, in init
self._init_gui()
File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/main/mainwindow.py", line 95, in _init_gui
self.setupUi(self)
File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/py/basewindow.py", line 47, in setupUi
self.fit_dialog = QFitDialog()
File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/fit/fitwindow.py", line 36, in init
self.setupUi(self)
File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/py/fitdialog.py", line 69, in setupUi
self.functionwidget = QFunctionWidget(self.scrollAreaWidgetContents_2)
File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/fit/fitfunction.py", line 34, in init
self.read_and_load_functions()
File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/fit/fitfunction.py", line 52, in read_and_load_functions
user_defined = find_models(config_paths() / 'usermodels.py')
File "/tmp/.mount_NMRevaGTdPW2/usr/src/nmreval/lib/importer.py", line 55, in find_models
modules = import
(modules)
File "/tmp/.mount_NMRevaGTdPW2/usr/src/nmreval/lib/importer.py", line 33, in import

loader.exec_module(mod)
File "", line 786, in exec_module
File "", line 923, in get_code
File "", line 853, in source_to_code
File "", line 228, in _call_with_frames_removed
File "/autohome/saeckech/.auswerten/usermodels.py", line 307
equation = r'T = -16.7467*(\Delta\delta)^{2} - 52.5130*\Delta\delta + 419.1381

Error Log zum zweiten Fehler:
SyntaxError: EOL while scanning string literal
20/11/2023 15:52:26 - INFO - root : Use C functions
20/11/2023 15:52:28 - ERROR - root : Uncaught exception:
Traceback (most recent call last):
File "/tmp/.mount_NMRevagxvulu/usr/bin/evaluate.py", line 24, in
mplQt = NMRMainWindow()
File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/main/mainwindow.py", line 75, in init
self._init_gui()
File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/main/mainwindow.py", line 95, in _init_gui
self.setupUi(self)
File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/py/basewindow.py", line 47, in setupUi
self.fit_dialog = QFitDialog()
File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/fit/fitwindow.py", line 36, in init
self.setupUi(self)
File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/py/fitdialog.py", line 69, in setupUi
self.functionwidget = QFunctionWidget(self.scrollAreaWidgetContents_2)
File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/fit/fitfunction.py", line 34, in init
self.read_and_load_functions()
File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/fit/fitfunction.py", line 52, in read_and_load_functions
user_defined = find_models(config_paths() / 'usermodels.py')
File "/tmp/.mount_NMRevagxvulu/usr/src/nmreval/lib/importer.py", line 55, in find_models
modules = import
(modules)
File "/tmp/.mount_NMRevagxvulu/usr/src/nmreval/lib/importer.py", line 33, in import

loader.exec_module(mod)
File "", line 786, in exec_module
File "", line 923, in get_code
File "", line 853, in source_to_code
File "", line 228, in _call_with_frames_removed
File "/autohome/saeckech/.auswerten/usermodels.py", line 313
T = -16.7467*(\Delta\delta)*2 - 52.5130\Delta\delta + 419.1381
SyntaxError: unexpected character after line continuation character

Wenn ich eine Fitfunktion über das Fenster Fit->create fit function erstelle und z.B. vergesse einen String zu beenden startet das Programm nicht mehr. Ich konnte dann nur noch unter .auswerten/usermodels den Fehler beheben. Kann man bei selbstgeschriebenen Funktionen einen Test drüber laufen lassen, sodass das Programm noch startet wenn man sich vertippt? Danach kam ein weiterer Fehler den ich nicht verstanden habe. Ich habe die Funktion gelöscht, genauso nochmal erstellt und dann gings. Error Log zum ersten Fehler: SyntaxError: EOL while scanning string literal 20/11/2023 15:51:15 - INFO - root : Use C functions 20/11/2023 15:51:17 - ERROR - root : Uncaught exception: Traceback (most recent call last): File "/tmp/.mount_NMRevaGTdPW2/usr/bin/evaluate.py", line 24, in <module> mplQt = NMRMainWindow() File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/main/mainwindow.py", line 75, in __init__ self._init_gui() File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/main/mainwindow.py", line 95, in _init_gui self.setupUi(self) File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/_py/basewindow.py", line 47, in setupUi self.fit_dialog = QFitDialog() File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/fit/fitwindow.py", line 36, in __init__ self.setupUi(self) File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/_py/fitdialog.py", line 69, in setupUi self.functionwidget = QFunctionWidget(self.scrollAreaWidgetContents_2) File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/fit/fitfunction.py", line 34, in __init__ self.read_and_load_functions() File "/tmp/.mount_NMRevaGTdPW2/usr/src/gui_qt/fit/fitfunction.py", line 52, in read_and_load_functions user_defined = find_models(config_paths() / 'usermodels.py') File "/tmp/.mount_NMRevaGTdPW2/usr/src/nmreval/lib/importer.py", line 55, in find_models modules = import_(modules) File "/tmp/.mount_NMRevaGTdPW2/usr/src/nmreval/lib/importer.py", line 33, in import_ loader.exec_module(mod) File "<frozen importlib._bootstrap_external>", line 786, in exec_module File "<frozen importlib._bootstrap_external>", line 923, in get_code File "<frozen importlib._bootstrap_external>", line 853, in source_to_code File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/autohome/saeckech/.auswerten/usermodels.py", line 307 equation = r'T = -16.7467*(\Delta\delta)^{2} - 52.5130*\Delta\delta + 419.1381 Error Log zum zweiten Fehler: SyntaxError: EOL while scanning string literal 20/11/2023 15:52:26 - INFO - root : Use C functions 20/11/2023 15:52:28 - ERROR - root : Uncaught exception: Traceback (most recent call last): File "/tmp/.mount_NMRevagxvulu/usr/bin/evaluate.py", line 24, in <module> mplQt = NMRMainWindow() File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/main/mainwindow.py", line 75, in __init__ self._init_gui() File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/main/mainwindow.py", line 95, in _init_gui self.setupUi(self) File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/_py/basewindow.py", line 47, in setupUi self.fit_dialog = QFitDialog() File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/fit/fitwindow.py", line 36, in __init__ self.setupUi(self) File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/_py/fitdialog.py", line 69, in setupUi self.functionwidget = QFunctionWidget(self.scrollAreaWidgetContents_2) File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/fit/fitfunction.py", line 34, in __init__ self.read_and_load_functions() File "/tmp/.mount_NMRevagxvulu/usr/src/gui_qt/fit/fitfunction.py", line 52, in read_and_load_functions user_defined = find_models(config_paths() / 'usermodels.py') File "/tmp/.mount_NMRevagxvulu/usr/src/nmreval/lib/importer.py", line 55, in find_models modules = import_(modules) File "/tmp/.mount_NMRevagxvulu/usr/src/nmreval/lib/importer.py", line 33, in import_ loader.exec_module(mod) File "<frozen importlib._bootstrap_external>", line 786, in exec_module File "<frozen importlib._bootstrap_external>", line 923, in get_code File "<frozen importlib._bootstrap_external>", line 853, in source_to_code File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/autohome/saeckech/.auswerten/usermodels.py", line 313 T = -16.7467*(\Delta\delta)**2 - 52.5130*\Delta\delta + 419.1381 SyntaxError: unexpected character after line continuation character
dominik added the
Kind/Enhancement
label 2023-11-20 15:21:25 +00:00
dominik self-assigned this 2023-11-20 15:29:08 +00:00
Member

Ich schau', was sich machen lässt, ist prinzipiell aber möglich.

Ich schau', was sich machen lässt, ist prinzipiell aber möglich.
dominik referenced this issue from a commit 2023-12-28 14:30:35 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: IPKM/nmreval#148
No description provided.