Ejemplo n.º 1
0
 def set_lang(self, lang):
     settings.apply_settings(lang=lang)
     for i in self.walk():
         try:
             i.text = language_pack().text(i.text)
         except:
             pass
Ejemplo n.º 2
0
 def load_conf(
     self,
     name,
     dbname,
 ):
     settings.refresh()
     global db
     if dbname == "Almanca" or "German":
         dbname = "German"
     if name == "":
         return False
     settings.apply_settings(nm=name, )
     db = database(dbname.capitalize() + "-" + settings.language)
     return True
Ejemplo n.º 3
0
 def set_learnlimit(self, param):
     if param == "az":
         settings.apply_settings(lm=5)
     if param == "orta":
         settings.apply_settings(lm=10)
     if param == "c*k":
         settings.apply_settings(lm=20)
Ejemplo n.º 4
0
from docopt import docopt
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np

from pylab import *

import settings
from utils import common_settings

if __name__ == "__main__":
    args = docopt(__doc__, version='Plot 0.1')
    sys.argv = [sys.argv[0]] + args['DATAFILE']
    if args['--plotstyle']:
        settings.apply_settings(mpl, args['--plotstyle'])
    finput = fileinput.FileInput(openhook=fileinput.hook_compressed)
    #x, y = zip(*(map(float, row) for row in csv.reader(finput)))
    data = loadtxt(finput, delimiter=",")

    common_settings(args, plt)
    data = data+1
    left, right = min(data[:,0]), max(data[:,0])
    top, bottom = min(data[:,1]), max(data[:,1])
    if not args['--nbins']:
        args['--nbins'] = 1+ np.log2(len(data))
    if args['--logbin']:
        binsx = np.logspace(np.log(left), np.log(right), int(args['--nbins']))
        binsy = np.logspace(np.log(top), np.log(bottom), int(args['--nbins']))
    else:
        bins = np.linspace(left, right, int(args['--nbins']))
Ejemplo n.º 5
0
 def set_lang(self, langg):
     settings.apply_settings(lang=langg)
     settings.refresh()
Ejemplo n.º 6
0
 def set_dict(self, lang):
     settings.apply_settings(dict="German")
Ejemplo n.º 7
0
from __future__ import print_function

import csv
import sys

import docopt
import numpy as np
import matplotlib as mpl
mpl.use('Pdf')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from pylab import *
import itertools

import settings
settings.apply_settings(mpl)

import fileinput

def readcsvcols(col, fileName,  *args, **kwargs):
    out = []
    reader = csv.reader(*args, **kwargs)
    for row in reader:
            try: 
                value = float(row[col])
                #trs = float(row[2])
                out.append(value)
            except:
                #print ("Warning, data format could not be parsed for row: ", row)
                continue
    return out