def test_non_existent_style(self, plt_mock): use("non-existent") assert not plt_mock.style.use.called
def test_km3pipe(self, plt_mock): use("km3pipe") self._assert_plt_imported(plt_mock, "km3pipe.mplstyle")
from datetime import datetime import io import os from collections import defaultdict import threading import time import numpy as np import matplotlib matplotlib.use('Agg') import km3pipe as kp from km3pipe.io.daq import TMCHData import matplotlib.pyplot as plt import km3pipe.style as kpst kpst.use("km3pipe") __author__ = "Tamas Gal" __email__ = "*****@*****.**" VERSION = "1.0" log = kp.logger.logging.getLogger("PMTrates") class PMTRates(kp.Module): def configure(self): self.detector = self.require("detector") self.du = self.require("du") self.interval = self.get("interval", default=10) self.plot_path = self.get("plot_path", default="plots") self.filename = self.get("filename", default="pmt_rates.png")
def test_serifs_style(self, plt_mock): use('serifs') self._assert_plt_imported(plt_mock, 'serifs.mplstyle')
def test_alba_style(self, plt_mock): use("alba") self._assert_plt_imported(plt_mock, "alba.mplstyle")
def test_jvs_style(self, plt_mock): use("jvs") self._assert_plt_imported(plt_mock, "jvs.mplstyle")
def test_talk_style(self, plt_mock): use('talk') self._assert_plt_imported(plt_mock, 'km3pipe-talk.mplstyle')
def test_notebook_style(self, plt_mock): use("notebook") self._assert_plt_imported(plt_mock, "km3pipe-notebook.mplstyle")
def test_poster_style(self, plt_mock): use('poster') self._assert_plt_imported(plt_mock, 'km3pipe-poster.mplstyle')
def test_notebook_style(self, plt_mock): use('notebook') self._assert_plt_imported(plt_mock, 'km3pipe-notebook.mplstyle')
def test_noargs_load_km3pipe_style(self, plt_mock): use() self._assert_plt_imported(plt_mock, 'km3pipe.mplstyle')
def test_km3pipe(self, plt_mock): use('km3pipe') self._assert_plt_imported(plt_mock, 'km3pipe.mplstyle')
def test_non_existent_style(self, plt_mock): use('non-existent') assert not plt_mock.style.use.called
def test_noargs_load_km3pipe_style(self, plt_mock): use() self._assert_plt_imported(plt_mock, "km3pipe.mplstyle")
def test_alba_style(self, plt_mock): use('alba') self._assert_plt_imported(plt_mock, 'alba.mplstyle')
def test_poster_style(self, plt_mock): use("poster") self._assert_plt_imported(plt_mock, "km3pipe-poster.mplstyle")
def test_jonas_style(self, plt_mock): use('jonas-phd') self._assert_plt_imported(plt_mock, 'jonas-phd.mplstyle')
def test_talk_style(self, plt_mock): use("talk") self._assert_plt_imported(plt_mock, "km3pipe-talk.mplstyle")
def test_jvs_style(self, plt_mock): use('jvs') self._assert_plt_imported(plt_mock, 'jvs.mplstyle')
def test_jonas_style(self, plt_mock): use("jonas-phd") self._assert_plt_imported(plt_mock, "jonas-phd.mplstyle")
def test_moritz_style(self, plt_mock): use('moritz') self._assert_plt_imported(plt_mock, 'moritz.mplstyle')
def test_moritz_style(self, plt_mock): use("moritz") self._assert_plt_imported(plt_mock, "moritz.mplstyle")
def test_serifs_style(self, plt_mock): use("serifs") self._assert_plt_imported(plt_mock, "serifs.mplstyle")
# License: MIT from datetime import datetime import io from collections import defaultdict import threading import time import km3pipe as kp from km3pipe.io.daq import TMCHData import numpy as np import matplotlib matplotlib.use("Agg") # noqa import matplotlib.pyplot as plt import km3pipe.style as kpst kpst.use("km3pipe") __author__ = "Tamas Gal" __email__ = "*****@*****.**" VERSION = "1.0" log = kp.logger.get_logger("PMTrates") class PMTRates(kp.Module): def configure(self): self.detector = self.require("detector") self.du = self.require("du") self.interval = self.get("interval") or 10 self.plot_path = self.get("plot_path") or "km3web/plots/pmtrates.png" self.max_x = 800
#!/usr/bin/env python import qcrndm import qcbox import numpy as np import time #import km3pipe as kp import km3pipe.style as kp_style import sys, argparse from tqdm import trange kp_style.use('km3pipe') if __name__ == "__main__": # Apply arguments theta = 1. density = 1.3 is_eta = False mc_steps = 2e7 width = 50 height = 50 qfactor = 0.17 periodic_boundary = False parser = argparse.ArgumentParser() parser.add_argument('-i', '--input') parser.add_argument('-o', '--output') parser.add_argument('-a', '--anglefile', action='store_true') parser.add_argument('-e', '--eta', action='store_true') parser.add_argument('-d', '--density') parser.add_argument('-t', '--theta') parser.add_argument('-n', '--nsteps') parser.add_argument('-w', '--width') parser.add_argument('-l', '--height')