1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
--- ../../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")
-
|