Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 3a4d48ec authored by ulrich_y's avatar ulrich_y
Browse files

Restructured python files

parent 19231fb3
No related branches found
No related tags found
No related merge requests found
# vim: foldmethod=marker
from pymule import *
gamma0 = Mmu**5/192/pi**3
## Crazy observable{{{
## Load data{{{
setup(folder='with-cut/out.tar.bz2', flavour='mu-e')
loC = scaleset(mergefks(sigma('m2enn0')), 1/gamma0)
fig, ans = mergefkswithplot([[sigma('m2ennR')], [sigma('m2ennF')]])
nloC = scaleset(ans, alpha/gamma0)
......
......@@ -9,9 +9,11 @@ gamma0 = Mmu**5/192/pi**3
## Load data{{{
setup(folder='out.tar.bz2')
openLeptons = mergefks(sigma('m2ennee0', merge={'xh': 2, 'xs': 2}))
openLeptons = addplots(openLeptons['xh'], openLeptons['xs'], sa=0.5, sb=0.5)
nnlo = mergefks(
sigma('m2ennRF', merge={'xe': 5}),
sigma('m2ennRR', merge={'xe': 2}),
......@@ -151,6 +153,7 @@ const[:, 1] = (
## Make plot{{{
xe = np.linspace(0, 1, 200)[2:-1]
ax = gca()
errorband(xev, ax=ax, col='C3')
ax.plot(xe, f2loop(xe), 'C2', linestyle='dashed')
......
......@@ -6,6 +6,7 @@ import pymule.mpl_axes_aligner
## Load Setup 2{{{
setup(folder='em2em/out.tar.bz2')
lo = scaleset(mergefks(sigma('em2em0')), conv*alpha**2)
### Load NLO{{{
nloEE = scaleset(mergefks(
......@@ -19,6 +20,7 @@ nloEM = scaleset(mergefks(
sigma('em2emREM'), sigma('em2emFEM')
), conv*alpha**3)
nlo = {
k: combineNplots(addplots, [
mergebins(nloEE[k], 2), nloMM[k], nloEM[k]
......@@ -101,6 +103,7 @@ def parsestr(s):
loPV = parsestr('245.038910(1)')
entries = [
lo['value'], loPV,
......@@ -147,6 +150,7 @@ entries.insert(25, kfac[7])
entries.insert(28, kfac[8])
entries.insert(29, kfac[9])
tex = "\n".join([
r"%%!TEX root=thesis",
r"\begin{tabular}{l|r|r||r|r||r|r}",
......
......@@ -3,12 +3,19 @@ import argparse
import os
def debug(s):
pass
def py2nb(py):
current = ["", ""]
indent = 0
nb = nbformat.v4.new_notebook()
def push_cell():
debug("[PUSH] current state is %s. Adding %d lines." % (
current[0], len(current[1].splitlines())
))
if current[0] == "":
return
elif current[0] == "comment":
......@@ -24,29 +31,47 @@ def py2nb(py):
current[1] = ""
def add_cell(c, t):
debug("[ADD ] Adding %d characters as %s" % (len(c), t))
if current[0] != t:
push_cell()
current[0] = t
current[1] += c + "\n"
for line in py.splitlines():
lines = py.splitlines()
i = -1
while i < len(lines) - 1:
i += 1
line = lines[i]
if line == "# vim: foldmethod=marker":
debug("[%4d] Skip vi header" % (i+1))
continue
if line.endswith("#########}}}"):
debug("[%4d] Skip section end. Indent was %d" % (i, indent))
indent -= 1
push_cell()
continue
if len(line) == 0:
push_cell()
debug("[%4d] empty line..." % (i+1))
# Empty line, is next empty as well?
if len(lines[i+1]) == 0:
debug("[ ] next line empty, too. Push")
i += 1
push_cell()
else:
debug("[ ] next line not empty. Add")
add_cell(line, 'code')
continue
if line[0] == "#":
debug("[%4d] Comment line" % (i+1))
c = line.strip('#').strip()
if line.endswith("{{{"):
debug("[ ] Section begin. Indent was %d" % indent)
indent += 1
c = "#"*indent + " " + c[:-3]
add_cell(c + '\n', 'comment')
if line[0] != "#":
debug("[%4d] Code line" % (i+1))
add_cell(line, 'code')
push_cell()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment