Skip to content

Consolidate functions #3

Description

@klieret

This is not too important, but currently we are defining a lot of single functions with cryptic names that cover some cases, e.g.

def Gammap0(w: Wilson, q2, El):
    return 2 * Gammat0p(w, q2, El)


def Gammam0(w: Wilson, q2, El):
    return 2 * Gamma0m(w, q2, El)


def Gammam2(w: Wilson, q2, El):
    return -2 * Gamma0m(w, q2, El)


def Gammap2(w: Wilson, q2, El):
    return 2 * Gamma00p(w, q2, El)


def Gammam1(w: Wilson, q2, El):
    return 0.


def Gammap1(w: Wilson, q2, El):
    return 2 * GammaI0p(w, q2, El)

for me it would perhaps be clearer if we implement that in one function:

def Gamma(sign, number, w, q2, El):
    if sign == "+" and  number == 1:
         return blah
   else if:
         return bluh
    ....
    else:
           raise ValueError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions