<commit_before>import numpy as np
from PySide import QtGui, QtCore
import sharppy.sharptab as tab
from sharppy.sharptab.constants import *

__all__ = ['backgroundAdvection', 'plotAdvection']
class backgroundAdvection(QtGui.QFrame):
    '''
    Draw the background frame and lines for the Theta-E plot frame
    '''
    def __init__(self):
        super(backgroundAdvection, self).__init__()
        self.initUI()

    def initUI(self):
        ## window configuration settings,
        ## such as padding, width, height, and
        ## min/max plot axes
        self.lpad = 0; self.rpad = 0
        self.tpad = 0; self.bpad = 20
        self.wid = self.size().width() - self.rpad
        self.hgt = self.size().height() - self.bpad
        self.tlx = self.rpad; self.tly = self.tpad
        self.brx = self.wid; self.bry = self.hgt
        ## set the max and min pressure expected, and convert it to log space
        self.pmax = 1050.; self.pmin = 100.
        self.log_pmax = np.log(self.pmax); self.log_pmin = np.log(self.pmin)
        self.adv_max = 13.; self.adv_min = -13.
        self.adv_min = 0
        self.label_font = QtGui.QFont('Helvetica', 8)
        self.plotBitMap = QtGui.QPixmap(self.width(), self.height())
        self.plotBitMap.fill(QtCore.Qt.black)
        self.plotBackground()

    def resizeEvent(self, e):
        '''
        Handles the event the window is resized
        '''
        self.initUI()

    def plotBackground(self):
        '''<commit_msg>Cleaned up inferred temperature advection widget on Windows.<commit_after>import numpy as np
from PySide import QtGui, QtCore
import sharppy.sharptab as tab
from sharppy.sharptab.constants import *
import platform

__all__ = ['backgroundAdvection', 'plotAdvection']
class backgroundAdvection(QtGui.QFrame):
    '''
    Draw the background frame and lines for the Theta-E plot frame
    '''
    def __init__(self):
        super(backgroundAdvection, self).__init__()
        self.initUI()

    def initUI(self):
        ## window configuration settings,
        ## such as padding, width, height, and
        ## min/max plot axes
        self.lpad = 0; self.rpad = 0
        self.tpad = 0; self.bpad = 20
        self.wid = self.size().width() - self.rpad
        self.hgt = self.size().height() - self.bpad
        self.tlx = self.rpad; self.tly = self.tpad
        self.brx = self.wid; self.bry = self.hgt
        ## set the max and min pressure expected, and convert it to log space
        self.pmax = 1050.; self.pmin = 100.
        self.log_pmax = np.log(self.pmax); self.log_pmin = np.log(self.pmin)
        self.adv_max = 13.; self.adv_min = -13.
        self.adv_min = 0

        fsize = 8
        self.label_font = QtGui.QFont('Helvetica', fsize)
        self.label_metrics = QtGui.QFontMetrics(self.label_font)
        self.os_mod = 0
        if platform.system() == "Windows":
            self.os_mod = self.label_metrics.descent()
            self.label_font = QtGui.QFont('Helvetica', fsize - self.os_mod)
            self.label_metrics = QtGui.QFontMetrics(self.label_font)

        self.plotBitMap = QtGui.QPixmap(self.width(), self.height())
        self.plotBitMap.fill(QtCore.Qt.black)
        self.plotBackground()

    def resizeEvent(self, e):
        '''
        Handles the event the window is resized
        '''
        self.initUI()

    def plotBackground(self):
        '''
{'fraction_non_alphanumeric': 0.11705586757315992, 'fraction_numerical': 0.01093703813183565, 'mean_word_length': 2.3671641791044777, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, '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': '205785', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1084, 'n_words': 268}