/etc/scidavisrc.py is in scidavis 0.2.4-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | import __main__
def import_to_global(modname, attrs=None, math=False):
"""
import_to_global(modname, (a,b,c,...), math): like "from modname import a,b,c,...",
but imports to global namespace (__main__).
If math==True, also registers functions with SciDAVis' math function list.
"""
mod = __import__(modname)
for submod in modname.split(".")[1:]:
mod = getattr(mod, submod)
if attrs==None: attrs=dir(mod)
for name in attrs:
f = getattr(mod, name)
setattr(__main__, name, f)
# make functions available in SciDAVis' math function list
if math and callable(f): __main__.scidavis.mathFunctions[name] = f
# Import standard math functions and constants into global namespace.
import_to_global("math", None, True)
# 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
try:
special_functions = [
# Airy Functions
"airy", "airye", "ai_zeros", "bi_zeros",
# Elliptic Functions and Integrals
"ellipj", "ellipk", "ellipkinc", "ellipe", "ellipeinc",
# Bessel Functions
"jn", "jv", "jve",
"yn", "yv", "yve",
"kn", "kv", "kve",
"iv", "ive",
"hankel1", "hankel1e", "hankel2", "hankel2e",
"lmbda",
"jnjnp_zeros", "jnyn_zeros",
"jn_zeros", "jnp_zeros",
"yn_zeros", "ynp_zeros",
"y0_zeros", "y1_zeros", "y1p_zeros",
"j0", "j1", "y0", "y1", "i0", "i0e", "i1", "i1e", "k0", "k0e", "k1", "k1e",
# Integrals of Bessel Functions
"itj0y0", "it2j0y0", "iti0k0", "it2i0k0", "besselpoly",
# 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",
# Ricatti-Bessel Functions
"riccati_jn", "riccati_yn",
# Struve Functions
"struve", "modstruve", "itstruve0", "it2struve0", "itmodstruve0",
# Gamma and Related Functions
"gamma", "gammaln", "gammainc", "gammaincinv", "gammaincc", "gammainccinv",
"beta", "betaln", "betainc", "betaincinv",
"psi", "rgamma", "polygamma",
# Error Function and Fresnel Integrals
"erf", "erfc", "erfinv", "erfcinv", "erf_zeros",
"fresnel", "fresnel_zeros", "fresnelc_zeros", "fresnels_zeros", "modfresnelp", "modfresnelm",
# Legendre Functions
"lpn", "lqn", "lpmn", "lqmn", "lpmv", "sph_harm",
# Orthogonal polynomials
"legendre", "sh_legendre",
"chebyt", "chebyu", "chebyc", "chebys", "sh_chebyt", "sh_chebyu",
"jacobi", "sh_jacobi",
"laguerre", "genlaguerre",
"hermite", "hermitenorm",
"gegenbauer",
# HyperGeometric Functions
"hyp2f1",
"hyp1f1", "hyperu", "hyp0f1",
"hyp2f0", "hyp1f2", "hyp3f0",
# Parabolic Cylinder Functions
"pbdv", "pbvv", "pbwa", "pbdv_seq", "pbvv_seq", "pbdn_seq",
# Mathieu and related Functions (and derivatives)
"mathieu_a", "mathieu_b", "mathieu_even_coef", "mathieu_odd_coef",
"mathieu_cem", "mathieu_sem", "mathieu_modcem1", "mathieu_modcem2", "mathieu_modsem1", "mathieu_modsem2",
# Spheroidal Wave Functions
"pro_ang1", "pro_rad1", "pro_rad2",
"obl_ang1", "obl_rad1", "obl_rad2",
"pro_cv", "obl_cv", "pro_cv_seq", "obl_cv_seq",
"pro_ang1_cv", "pro_rad1_cv", "pro_rad2_cv",
"obl_ang1_cv", "obl_rad1_cv", "obl_rad2_cv",
# Kelvin Functions
"kelvin", "kelvin_zeros",
"ber", "bei", "berp", "beip", "ker", "kei", "kerp", "keip",
"ber_zeros", "bei_zeros", "berp_zeros", "beip_zeros", "ker_zeros", "kei_zeros", "kerp_zeros", "keip_zeros",
# Other Special Functions
"expn", "exp1", "expi",
"wofz", "dawsn",
"shichi", "sici", "spence",
"zeta", "zetac",
# Convenience Functions
"cbrt", "exp10", "exp2",
"radian", "cosdg", "sindg", "tandg", "cotdg",
"log1p", "expm1", "cosm1",
"round",
]
import_to_global("scipy.special", special_functions, True)
have_scipy = True
print("Loaded %d special functions from scipy.special." % len(special_functions))
except(ImportError): pass
# Import selected parts of pygsl.sf (if available) into global namespace.
# See pygsl.sourceforge.net for information on pygsl and how to get it.
try:
# special functions not defined in SciPy
special_functions = [
# Restriction functions
"angle_restrict_pos_err", "angle_restrict_symm_err",
# Gamma and Related Functions
"choose", "fact", "doublefact",
"gammastar", "gammainv",
"lnfact", "lndoublefact",
"poch", "pochrel", "lnpoch", "lnpoch_sgn",
"psi_1_int", "psi_1piy", "psi_int", "psi_n",
# Fermi-Dirac integrals
"fermi_dirac_0", "fermi_dirac_half", "fermi_dirac_1",
"fermi_dirac_3half", "fermi_dirac_2",
"fermi_dirac_inc_0", "fermi_dirac_int", "fermi_dirac_m1",
"fermi_dirac_mhalf",
# Elliptic Functions and Integrals
"ellint_D", "ellint_F",
"ellint_RC", "ellint_RD", "ellint_RF", "ellint_RJ",
"elljac",
# Error Function and Fresnel Integrals
"log_erfc",
# Other Integrals
"atanint",
"expint_3", "expint_E1", "expint_E2", "expint_Ei",
# Legendre Functions and Spherical Harmonics
"conicalP_0", "conicalP_1", "conicalP_half", "conicalP_mhalf",
"conicalP_sph_reg", "conicalP_cyl_reg",
"legendre_H3d", "legendre_H3d_0", "legendre_H3d_1",
"legendre_Q0", "legendre_Q1", "legendre_Ql",
"legendre_sphPlm",
# Coulomb Functions
"hydrogenicR", "hydrogenicR_1",
"coulomb_CL", "coulomb_wave_FG",
# Lambert's W function
"lambert_W0", "lambert_Wm1",
# Synchrotron functions
"synchrotron_1", "synchrotron_2",
# Transport functions
"transport_2", "transport_3", "transport_4", "transport_5",
# Clausen function
"clausen",
# Coupling coefficients
"coupling_3j", "coupling_6j", "coupling_9j",
# Debye functions
"debye_1", "debye_2", "debye_3", "debye_4",
# Dilogarithm
"dilog",
# Zeta Functions
"eta", "eta_int",
"hzeta", "zeta_int",
# HyperGeometric Functions
"hyperg_1F1_int",
"hyperg_2F1_conj", "hyperg_2F1_conj_renorm", "hyperg_2F1_renorm",
"hyperg_U_e10", "hyperg_U_int", "hyperg_U_int_e10",
# Trigonometric Functions
"hypot", "sinc",
"lnsinh", "lncosh",
# Other Special Functions
"log_abs", "taylorcoeff",
]
# special functions also defined in SciPy
special_functions_doublets = [
# Airy functions
"airy_Ai", "airy_Ai_deriv", "airy_Ai_scaled", "airy_Ai_deriv_scaled",
"airy_Bi", "airy_Bi_deriv", "airy_Bi_scaled", "airy_Bi_deriv_scaled",
"airy_zero_Ai", "airy_zero_Ai_deriv", "airy_zero_Bi", "airy_zero_Bi_deriv",
# Bessel functions
"bessel_I0", "bessel_I1", "bessel_In", "bessel_Inu",
"bessel_I0_scaled", "bessel_I1_scaled", "bessel_In_scaled", "bessel_Inu_scaled",
"bessel_J0", "bessel_J1", "bessel_Jn", "bessel_Jnu",
"bessel_K0", "bessel_K1", "bessel_Kn", "bessel_Knu",
"bessel_K0_scaled", "bessel_K1_scaled", "bessel_Kn_scaled", "bessel_Knu_scaled",
"bessel_Y0", "bessel_Y1", "bessel_Yn", "bessel_Ynu",
"bessel_i0_scaled", "bessel_i1_scaled", "bessel_i2_scaled", "bessel_il_scaled",
"bessel_j0", "bessel_j1", "bessel_j2", "bessel_jl",
"bessel_k0_scaled", "bessel_k1_scaled", "bessel_k2_scaled", "bessel_kl_scaled",
"bessel_y0", "bessel_y1", "bessel_y2", "bessel_yl",
"bessel_lnKnu",
"bessel_zero_J0", "bessel_zero_J1", "bessel_zero_Jnu",
# Gamma and Related Functions
"beta", "beta_inc",
"gamma", "gamma_inc_P", "gamma_inc_Q",
"lnbeta", "lngamma",
"psi",
# Elliptic Functions and Integrals
"ellint_E", "ellint_Ecomp", "ellint_Kcomp", "ellint_P",
# Error Function and Fresnel Integrals
"erf", "erfc", "erf_Q", "erf_Z",
# Gegenbauer polynomials
"gegenpoly_1", "gegenpoly_2", "gegenpoly_3", "gegenpoly_n",
# HyperGeometric Functions
"hyperg_0F1", "hyperg_1F1", "hyperg_2F0", "hyperg_2F1",
"hyperg_U",
# Orthogonal Polynomials
"laguerre_1", "laguerre_2", "laguerre_3", "laguerre_n",
"legendre_P1", "legendre_P2", "legendre_P3",
"legendre_Pl", "legendre_Plm",
# Zeta Functions
"zeta",
# Other special functions
"Shi", "Chi", "Si", "Ci",
"dawson",
"log_1plusx", "log_1plusx_mx",
]
import_to_global("pygsl.sf", special_functions, True)
if have_scipy:
print("Loaded %d special functions from pygsl.sf." % len(special_functions))
else:
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"
|