Commits

Georg Brandl  committed f312890

modelbuilder: evaluate model in namespace with math. functions

  • Participants
  • Parent commits eb8a51d

Comments (0)

Files changed (1)

File ufit/gui/modelbuilder.py

 
 """Model builder panel."""
 
-from PyQt4.QtCore import pyqtSignature as qtsig, SIGNAL, Qt
-from PyQt4.QtGui import QWidget, QApplication, QSplitter, QMainWindow, \
-     QListWidgetItem, QDialogButtonBox, QMessageBox, QInputDialog, QTextCursor
+from PyQt4.QtCore import pyqtSignature as qtsig, SIGNAL
+from PyQt4.QtGui import QWidget, QListWidgetItem, QDialogButtonBox, \
+     QMessageBox, QInputDialog, QTextCursor
 
 from ufit import models, param
 from ufit.models import Background, Gauss, concrete_models
-from ufit.gui.common import loadUi, MPLCanvas, MPLToolbar
+from ufit.gui.common import loadUi
 
 
 class ModelBuilder(QWidget):
             QMessageBox.information(self, 'Error', 'No model defined.')
             return
         d = models.__dict__.copy()
+        d.update(param.expr_namespace)
         d.update(param.__dict__)
         try:
             model = eval(modeldef, d)