<commit_before># -*- coding: utf-8 -*-
"""
Copyright (c) 2016 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of 
this software and associated documentation files (the "Software"), to deal in 
the Software without restriction, including without limitation the rights to 
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of the Software, and to permit persons to whom the Software is furnished to do 
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.






ToDo:
save advanced settings?

ideas:
    click and drag for selection of area
    or click and drag moves center for new input style, and area selection for old

"""

import logging
import numpy as np
import os
import sys
sys.path.append(os.path.join(sys.path[0],".."))
from collections import OrderedDict

#Qt stuff
import sip
sip.setapi('QVariant', 2) #use python types instead of qt types (e.g. string insted of Qstring)
from PyQt4 import QtCore, QtGui

from matplotlib import use
use("Qt4Agg")

from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg \
  import FigureCanvasQTAgg as FigureCanvas, NavigationToolbar2QT
from matplotlib.pyplot import colormaps
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.patches import Ellipse, Rectangle
from matplotlib.lines import Line2D
import matplotlib.ticker as ticker
from scipy.optimize import curve_fit


# simple edit of additional settings
from GUI_tools import easy_edit_settings, simple_plot_window

#2D gauss fitting
import fit_tools

#load qt design UI
from UI.DoseWidgetUI import Ui_DoseWidget

from dose_calc_core import dose_array

def gray_tick(x, pos):
    """prints ticks with a Gy as unit appended"""
    return "{:.2f} Gy".format(x)

def gauss(x, A, x0, sigma, offset):
    return A*np.exp(-np.square(x-x0)/(2*sigma**2))+offset

def cross(x,y,width,height):
    "returns a matplotlib artist the shape of a cross"
    return "blubb"

#define possibilities for color maps and check their availability on 
#the current installation
colorMapChoices = ["inferno","viridis","hot","gnuplot","spectral","gray","seismic"]

for cmap in colorMapChoices:
    if cmap not in colormaps():
        colorMapChoices.remove(cmap)

_advSettings = easy_edit_settings([("area stat linecolor","red"),<commit_msg>some more "rainbow"-like colormap choices<commit_after># -*- coding: utf-8 -*-
"""
Copyright (c) 2016 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of 
this software and associated documentation files (the "Software"), to deal in 
the Software without restriction, including without limitation the rights to 
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of the Software, and to permit persons to whom the Software is furnished to do 
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.






ToDo:
save advanced settings?

ideas:
    click and drag for selection of area
    or click and drag moves center for new input style, and area selection for old

"""

import logging
import numpy as np
import os
import sys
sys.path.append(os.path.join(sys.path[0],".."))
from collections import OrderedDict

#Qt stuff
import sip
sip.setapi('QVariant', 2) #use python types instead of qt types (e.g. string insted of Qstring)
from PyQt4 import QtCore, QtGui

from matplotlib import use
use("Qt4Agg")

from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg \
  import FigureCanvasQTAgg as FigureCanvas, NavigationToolbar2QT
from matplotlib.pyplot import colormaps
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.patches import Ellipse, Rectangle
from matplotlib.lines import Line2D
import matplotlib.ticker as ticker
from scipy.optimize import curve_fit


# simple edit of additional settings
from GUI_tools import easy_edit_settings, simple_plot_window

#2D gauss fitting
import fit_tools

#load qt design UI
from UI.DoseWidgetUI import Ui_DoseWidget

from dose_calc_core import dose_array

def gray_tick(x, pos):
    """prints ticks with a Gy as unit appended"""
    return "{:.2f} Gy".format(x)

def gauss(x, A, x0, sigma, offset):
    return A*np.exp(-np.square(x-x0)/(2*sigma**2))+offset

def cross(x,y,width,height):
    "returns a matplotlib artist the shape of a cross"
    return "blubb"

#define possibilities for color maps and check their availability on 
#the current installation
colorMapChoices = ["inferno","viridis","hot","gnuplot","spectral","jet",
                   "rainbow","gray","seismic"]

for cmap in colorMapChoices:
    if cmap not in colormaps():
        colorMapChoices.remove(cmap)

_advSettings = easy_edit_settings([("area stat linecolor","red"),
{'fraction_non_alphanumeric': 0.07087015635622027, 'fraction_numerical': 0.00645819170632223, 'mean_word_length': 4.826732673267327, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4475799', 'n_tokens_mistral': 1769, 'n_tokens_neox': 1682, 'n_words': 736}