File: pyenv.py

package info (click to toggle)
graph-tool 2.98%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,324 kB
  • sloc: cpp: 87,937; python: 31,476; makefile: 952; xml: 101; sh: 42
file content (68 lines) | stat: -rw-r--r-- 1,618 bytes parent folder | download
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
import sys
import os
from matplotlib import rc
from matplotlib import rcParams

DOC_DIR = "___DOCDIR___"

font_size=14
rcParams["backend"] = "PDF"
rcParams["figure.figsize"] = (4, 3)
rcParams["font.family"] = "Serif"
#rcParams["font.serif"] = ["Times"]
rcParams["font.size"] = font_size
rcParams["axes.labelsize"] = font_size
rcParams["xtick.labelsize"] = font_size - 2
rcParams["ytick.labelsize"] = font_size - 2
rcParams["legend.numpoints"] = 1
rcParams["legend.fontsize"] = "small"
rcParams["lines.markersize"] = 4
rcParams["figure.subplot.right"] = 0.95
rcParams["figure.subplot.top"] = 0.95
rcParams["figure.subplot.right"] = 0.95
rcParams["figure.subplot.top"] = 0.95
rcParams["figure.subplot.left"] = 0.2
rcParams["figure.subplot.bottom"] = 0.2

rcParams["image.cmap"] = "magma"

rcParams["text.usetex"] = True

rcParams["ps.usedistiller"] = "xpdf"
rcParams["pdf.compression"] = 9
rcParams["ps.useafm"] = True
rcParams["path.simplify"] = True
rcParams["text.latex.preamble"] = r"\usepackage{amssymb}\usepackage{amsmath}"

import scipy
import scipy.stats
import numpy as np
from pylab import *
from numpy import *
import graph_tool.all as gt
import graph_tool.draw
import random as prandom
import subprocess

figure()

try:
    gt.openmp_set_num_threads(1)
except RuntimeError:
    pass

def conv_png(f):
    subprocess.check_output(['pdftocairo', "-png", "-singlefile", "-transp",
                             "-r", "300", f])

prandom.seed(42)
np.random.seed(42)
gt.seed_rng(42)

is_done = False

def mkchdir(dname):
    os.makedirs(dname, exist_ok=True)
    os.chdir(dname)

mkchdir(DOC_DIR + "/autosummary")