<commit_before>#
# Zoom.py -- Zoom plugin for fits viewer
#
# <NAME> (<EMAIL>)
#
# Copyright (c) <NAME>.  All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import time

from ginga.gw import Widgets, Viewers
from ginga.misc import Bunch
from ginga import GingaPlugin


class Zoom(GingaPlugin.GlobalPlugin):

    def __init__(self, fv):
        # superclass defines some variables for us, like logger
        super(Zoom, self).__init__(fv)

        self.zoomimage = None
        self.default_radius = 30
        self.default_zoom = 3
        self.zoom_x = 0
        self.zoom_y = 0
        self.t_abszoom = True
        self.zoomtask = fv.get_timer()
        self.zoomtask.set_callback('expired', self.showzoom_timer_cb)
        self.fitsimage_focus = None
        self.update_time = time.time()

        # read preferences for this plugin
        prefs = self.fv.get_preferences()
        self.settings = prefs.createCategory('plugin_Zoom')
        self.settings.addDefaults(zoom_radius=self.default_radius,
                                  zoom_amount=self.default_zoom,
                                  refresh_interval=0.02)
        self.settings.load(onError='silent')

        self.zoom_radius = self.settings.get('zoom_radius', self.default_radius)
        self.zoom_amount = self.settings.get('zoom_amount', self.default_zoom)
        self.refresh_interval = self.settings.get('refresh_interval', 0.02)

        self._wd = 200
        self._ht = 200

        fv.add_callback('add-channel', self.add_channel)
        fv.add_callback('channel-change', self.focus_cb)

    def build_gui(self, container):

        vbox, sw, orientation = Widgets.get_oriented_box(container,<commit_msg>Improved layout for Zoom plugin<commit_after>#
# Zoom.py -- Zoom plugin for fits viewer
#
# <NAME> (<EMAIL>)
#
# Copyright (c) <NAME>.  All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import time

from ginga.gw import Widgets, Viewers
from ginga.misc import Bunch
from ginga import GingaPlugin


class Zoom(GingaPlugin.GlobalPlugin):

    def __init__(self, fv):
        # superclass defines some variables for us, like logger
        super(Zoom, self).__init__(fv)

        self.zoomimage = None
        self.default_radius = 30
        self.default_zoom = 3
        self.zoom_x = 0
        self.zoom_y = 0
        self.t_abszoom = True
        self.zoomtask = fv.get_timer()
        self.zoomtask.set_callback('expired', self.showzoom_timer_cb)
        self.fitsimage_focus = None
        self.update_time = time.time()

        # read preferences for this plugin
        prefs = self.fv.get_preferences()
        self.settings = prefs.createCategory('plugin_Zoom')
        self.settings.addDefaults(zoom_radius=self.default_radius,
                                  zoom_amount=self.default_zoom,
                                  refresh_interval=0.02)
        self.settings.load(onError='silent')

        self.zoom_radius = self.settings.get('zoom_radius', self.default_radius)
        self.zoom_amount = self.settings.get('zoom_amount', self.default_zoom)
        self.refresh_interval = self.settings.get('refresh_interval', 0.02)

        self._wd = 200
        self._ht = 200

        fv.add_callback('add-channel', self.add_channel)
        fv.add_callback('channel-change', self.focus_cb)

    def build_gui(self, container):

        vbox, sw, orientation = Widgets.get_oriented_box(container,
                                                         fill=True,
{'fraction_non_alphanumeric': 0.09647188533627343, 'fraction_numerical': 0.009371554575523704, 'mean_word_length': 2.4660936007640877, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2981219', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1059, 'n_words': 240}