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

def set_constants(problem):
    if problem == "Conway":
        Knotind = ["0_1", "conway", "kt"]
    if problem == "Full":
        Knotind = ["0_1", "10_112", "10_128", "10_143", "10_159", "10_25", "10_40", "10_56", "10_71", "10_87", "5_2", "8_15", "9_11", "9_27", "9_42",
  "10_113",    "10_129",  "10_144",  "10_16", "10_26", "10_41", "10_57", "10_72", "10_88", "6_1", "8_16", "9_12", "9_28", "9_43",            
  "10_1",    "10_114",  "10_13",  "10_145", "10_160", "10_27", "10_42", "10_58", "10_73", "10_89", "6_2", "8_17", "9_13", "9_29",  "9_44",            
  "10_10",    "10_115",  "10_130",  "10_146", "10_161", "10_28", "10_43", "10_59", "10_74", "10_9", "6_3", "8_18", "9_14", "9_3",  "9_45",            
  "10_100",    "10_116",  "10_131",  "10_147", "10_162", "10_29", "10_44", "10_6", "10_75", "10_90", "7_1", "8_19", "9_15", "9_30",  "9_46",            
  "10_101",    "10_117",  "10_132",  "10_148", "10_163", "10_3", "10_45", "10_60", "10_76", "10_91", "7_2", "8_2", "9_16", "9_31",  "9_47",            
  "10_102",    "10_118",  "10_133",  "10_149", "10_164", "10_30", "10_46", "10_61", "10_77", "10_92", "7_3", "8_20", "9_17", "9_32",  "9_48",            
  "10_103",    "10_119",  "10_134",  "10_15", "10_165", "10_31", "10_47", "10_62", "10_78", "10_93", "7_4", "8_21", "9_18", "9_33",  "9_49",
  "10_104",    "10_12",  "10_135",  "10_150", "10_17", "10_32", "10_48", "10_63", "10_79", "10_94", "7_5", "8_3", "9_19", "9_34",  "9_5",
  "10_105",    "10_120",  "10_136",  "10_151", "10_18", "10_33", "10_49", "10_64", "10_8", "10_95", "7_6", "8_4", "9_2", "9_35",  "9_6",
  "10_106",    "10_121",  "10_137",  "10_152", "10_19", "10_34", "10_5", "10_65", "10_80", "10_96", "7_7", "8_5", "9_20", "9_36",  "9_7",
  "10_107",    "10_122",  "10_138",  "10_153", "10_2", "10_35", "10_50", "10_66", "10_81", "10_97", "8_1", "8_6", "9_21", "9_37",  "9_8",
  "10_108",    "10_123",  "10_139",  "10_154", "10_20", "10_36", "10_51", "10_67", "10_82", "10_98", "8_10", "8_7", "9_22", "9_38",  "9_9",
  "10_109",    "10_124",  "10_14",  "10_155", "10_21", "10_37", "10_52", "10_68", "10_83", "10_99", "8_11", "8_8", "9_23", "9_39",  
  "10_11",    "10_125",  "10_140",  "10_156", "10_22", "10_38", "10_53", "10_69", "10_84", "3_1", "8_12", "8_9", "9_24", "9_4",
  "10_110",    "10_126",  "10_141",  "10_157", "10_23", "10_39", "10_54", "10_7", "10_85", "4_1", "8_13", "9_1", "9_25", "9_40",  
  "10_111",    "10_127",  "10_142",  "10_158", "10_24", "10_4", "10_55", "10_70", "10_86", "5_1", "8_14", "9_10", "9_26", "9_41",]
fconforto's avatar
fconforto committed
    return Knotind


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

    Returns:
        args: Values defining the knot parameters, of specified type.
    """
    par = ArgumentParser()

    par.add_argument(
        "-p",
        "--problem",
        type=str,
        default="SQRGRN8",
        help="Options: 0_5 or SQRGRN8 or SQRGRN or GRN8 or SQR8",
    )  # NOTE CHANGE TO SQRGRN8
    par.add_argument(
        "-d",
        "--datatype",
        type=str,
        default="Writhe",
        help="Options: 1DWrithe or Writhe or LD or LC or LCW or XYZ",
    )
    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",
    )
fconforto's avatar
fconforto committed
    par.add_argument(
        "-nb",
        "--nbeads",
        type=str,
        default="200",
        help="Number of beads of the input files",
    )
fconforto's avatar
fconforto committed
    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"
    )

    par.add_argument(
        "-m",
        "--mode",
        type=str,
        default="train",
        help="mode: train or test",
    )

fconforto's avatar
fconforto committed
    args = par.parse_args()

    return args