Skip to content
Snippets Groups Projects
helpers.py 1.7 KiB
Newer Older
fconforto's avatar
fconforto committed
from argparse import ArgumentParser


def set_constants(problem):
    if problem == "Conway":
        Knotind = ["0_1", "conway", "kt"]
    
    elif problem == "5Class":
        Knotind = ['0_1', '3_1', '4_1', '5_1', '5_2']

    elif problem == "SQRGRN8":
        Knotind = ['3_1_3_1', '3_1-3_1', '8_20'] # square knot, granny knot, 8_20

    elif problem == "10Crossings":
        Knotind = [""]
fconforto's avatar
fconforto committed

    return Knotind


def getParams():
    """Receive user-input of training parameters via the command Line interface (CLI) and Python library argparse.
fconforto's avatar
fconforto committed
    Default values are provided if no input is specified.

    Returns:
        args: Values defining the knot parameters.
fconforto's avatar
fconforto committed
    """
    par = ArgumentParser()

    par.add_argument(
        "-p",
        "--problem",
        type=str,
        default="Conway",
        help="Options: Conway, 5Class, SQRGRN8, 10Crossings",
    )
fconforto's avatar
fconforto committed
    par.add_argument(
        "-d",
        "--datatype",
        type=str,
        default="Writhe",
        help="Options: 1DWrithe, Writhe, Sig_Writhe, LD, LC, LCW, XYZ",
fconforto's avatar
fconforto committed
    )
    par.add_argument(
        "-a",
        "--adjacent",
        type=bool,
        default=False,
        help="Flag to use adjacent datatype from XYZ",
    )
    par.add_argument(
        "-n",
        "--normalised",
        type=bool,
        default=False,
        help="Flag to use normalised version of datatype",
    )
    par.add_argument(
        "-t",
        "--network",
        type=str,
        default="FFNN",
        help="Type of neural network: FFNN or RNN",
    )
    par.add_argument(
        "-e",
        "--epochs",
        type=int,
        default=1000,
        help="Set the number of training epochs"
fconforto's avatar
fconforto committed
    )

    args = par.parse_args()

    return args