summaryrefslogtreecommitdiffstats
path: root/academic/scidavis/fix_issue_with_scipy_vesions.patch
blob: 653ce97f9e61b23ac573a71f4a3ecad6c6659c55 (plain)
--- ../../scidavis-1.23/scidavis/scidavisrc.py	2018-06-04 03:22:50.000000000 -0300
+++ /home/fellype/github/scidavis/scidavis/scidavisrc.py	2018-06-05 15:12:17.000000000 -0300
@@ -50,6 +50,84 @@
 # Import standard math functions and constants into global namespace.
 import_to_global("math", None, True)
 
+# make Qt API available (it gets imported in any case by the scidavis module)
+global QtGui
+from PyQt4 import QtGui
+
+global QtCore
+from PyQt4 import QtCore
+
+global Qt
+from PyQt4.QtCore import Qt
+
+# import SciDAVis' classes to the global namespace (particularly useful for fits)
+for name in dir(__main__.scidavis):
+	setattr(__main__, name, getattr(__main__.scidavis, name))
+
+# import selected methods of ApplicationWindow into the global namespace
+appImports = (
+	"table", "newTable",
+	"matrix", "newMatrix",
+	"graph", "newGraph",
+	"note", "newNote",
+	"plot", "plotContour", "plotColorMap", "plotGrayScale",
+	"activeFolder", "rootFolder", "saveFolder",
+	"renameWindow", "clone",
+	"importImage"
+	)
+for name in appImports:
+	setattr(__main__,name,getattr(__main__.scidavis.app,name))
+
+# make Y columns indexable (using lookup in corresponding X column)
+def __column_getitem(self, index):
+  if self.plotDesignation() != "Y":
+    return None
+  x = self.x()
+  for row in range(self.rowCount()):
+      if x.columnMode() == "Numeric":
+          xval = x.valueAt(row)
+      elif x.columnMode() == "Text":
+          xval = x.textAt(row)
+      else:
+          xval = x.dateTimeAt(row)
+      if xval == index:
+          if self.columnMode() == "Numeric":
+              return self.valueAt(row)
+          elif self.columnMode() == "Text":
+              return self.textAt(row)
+          else:
+              return self.dateTimeAt(row)
+__main__.scidavis.Column.__getitem__ = __column_getitem
+
+def __column_setitem(self, index, value):
+  if self.plotDesignation() != "Y":
+    return None
+  x = self.x()
+  for row in range(x.rowCount()):
+      if x.columnMode() == "Numeric":
+          xval = x.valueAt(row)
+      elif x.columnMode() == "Text":
+          xval = x.textAt(row)
+      else:
+          xval = x.dateTimeAt(row)
+      if xval == index:
+          if self.columnMode() == "Numeric":
+              return self.setValueAt(row, value)
+          elif self.columnMode() == "Text":
+              return self.setTextAt(row, value)
+          else:
+              return self.setDateTimeAt(row, value)
+__main__.scidavis.Column.__setitem__ = __column_setitem
+
+# import utility module
+import sys
+sys.path.append(".")
+try:
+	import_to_global("scidavisUtil")
+	print("scidavisUtil successfully imported")
+except(ImportError): 
+	print("failed to import scidavisUtil")
+
 # Import selected parts of scipy.special (if available) into global namespace.
 # See www.scipy.org for information on SciPy and how to get it.
 have_scipy = False
@@ -76,7 +154,11 @@
 		# Derivatives of Bessel Functions
 		"jvp", "yvp", "kvp", "ivp", "h1vp", "h2vp",
 		# Spherical Bessel Functions
-		"sph_jn", "sph_yn", "sph_jnyn", "sph_in", "sph_kn", "sph_inkn",
+		## if scipy version is < 1.0.0
+		#"sph_jn", "sph_yn", "sph_jnyn", "sph_in", "sph_kn", "sph_inkn",
+		## else
+		#"spherical_jn", "spherical_yn", "spherical_in", "spherical_kn",
+		### removing SBFs for a while, until someone finds a way for these two options to coexist
 		# Ricatti-Bessel Functions
 		"riccati_jn", "riccati_yn",
 		# Struve Functions
@@ -246,83 +328,3 @@
 		import_to_global("pygsl.sf", special_functions_doublets, True)
 		print("Loaded %d special functions from pygsl.sf." % (len(special_functions) + len(special_functions_doublets)))
 except(ImportError): pass
-
-
-# make Qt API available (it gets imported in any case by the scidavis module)
-global QtGui
-from PyQt4 import QtGui
-
-global QtCore
-from PyQt4 import QtCore
-
-global Qt
-from PyQt4.QtCore import Qt
-
-# import SciDAVis' classes to the global namespace (particularly useful for fits)
-for name in dir(__main__.scidavis):
-	setattr(__main__, name, getattr(__main__.scidavis, name))
-
-# import selected methods of ApplicationWindow into the global namespace
-appImports = (
-	"table", "newTable",
-	"matrix", "newMatrix",
-	"graph", "newGraph",
-	"note", "newNote",
-	"plot", "plotContour", "plotColorMap", "plotGrayScale",
-	"activeFolder", "rootFolder", "saveFolder",
-	"renameWindow", "clone",
-	"importImage"
-	)
-for name in appImports:
-	setattr(__main__,name,getattr(__main__.scidavis.app,name))
-
-# make Y columns indexable (using lookup in corresponding X column)
-def __column_getitem(self, index):
-  if self.plotDesignation() != "Y":
-    return None
-  x = self.x()
-  for row in range(self.rowCount()):
-      if x.columnMode() == "Numeric":
-          xval = x.valueAt(row)
-      elif x.columnMode() == "Text":
-          xval = x.textAt(row)
-      else:
-          xval = x.dateTimeAt(row)
-      if xval == index:
-          if self.columnMode() == "Numeric":
-              return self.valueAt(row)
-          elif self.columnMode() == "Text":
-              return self.textAt(row)
-          else:
-              return self.dateTimeAt(row)
-__main__.scidavis.Column.__getitem__ = __column_getitem
-
-def __column_setitem(self, index, value):
-  if self.plotDesignation() != "Y":
-    return None
-  x = self.x()
-  for row in range(x.rowCount()):
-      if x.columnMode() == "Numeric":
-          xval = x.valueAt(row)
-      elif x.columnMode() == "Text":
-          xval = x.textAt(row)
-      else:
-          xval = x.dateTimeAt(row)
-      if xval == index:
-          if self.columnMode() == "Numeric":
-              return self.setValueAt(row, value)
-          elif self.columnMode() == "Text":
-              return self.setTextAt(row, value)
-          else:
-              return self.setDateTimeAt(row, value)
-__main__.scidavis.Column.__setitem__ = __column_setitem
-
-# import utility module
-import sys
-sys.path.append(".")
-try:
-	import_to_global("scidavisUtil")
-	print("scidavisUtil successfully imported")
-except(ImportError): 
-	print("failed to import scidavisUtil")
-