<jupyter_start><jupyter_text>Read hysteretic paths data from file.<jupyter_code>hyst_paths_fname = 'hysteretic_paths_3_nodes.csv'

hysteretic_paths = []
with open(hyst_paths_fname, 'r') as csv_file:
    csv_reader = csv.reader(csv_file)
    for row in csv_reader:
        # Transfor str to integers
        path = [int(p) for p in row]
        hysteretic_paths.append(path)
print('Number of hysteretic paths:', len(hysteretic_paths))<jupyter_output>Number of hysteretic paths: 133<jupyter_text>List of hysteretic paths<jupyter_code>hysteretic_paths<jupyter_output><empty_output><jupyter_text>Let's look at a particular hysteretic path.<jupyter_code># Pick a particular hysteretic path
hyst_path = hysteretic_paths[17]
# hyst_path = hysteretic_paths[3]<jupyter_output><empty_output><jupyter_text>Print parameter information along the path<jupyter_code>for par_index in hyst_path:
    parameter = parameter_graph.parameter(par_index)
    print('index:', par_index, ', parameter:', parameter)<jupyter_output>index: 61 , parameter: [["X0",[2,2,"40"],[1,0]],["X1",[1,2,"C"],[0,1]],["X2",[2,1,"E"],[0]]]
index: 63 , parameter: [["X0",[2,2,"50"],[1,0]],["X1",[1,2,"C"],[0,1]],["X2",[2,1,"E"],[0]]]
index: 64 , parameter: [["X0",[2,2,"54"],[1,0]],["X1",[1,2,"C"],[0,1]],["X2",[2,1,"E"],[0]]]
index: 70 , parameter: [["X0",[2,2,"D4"],[1,0]],["X1",[1,2,"C"],[0,1]],["X2",[2,1,"E"],[0]]]
index: 75 , parameter: [["X0",[2,2,"F4"],[1,0]],["X1",[1,2,"C"],[0,1]],["X2",[2,1,"E"],[0]]]
index: 76 , parameter: [["X0",[2,2,"F5"],[1,0]],["X1",[1,2,"C"],[0,1]],["X2",[2,1,"E"],[0]]]
index: 78 , parameter: [["X0",[2,2,"FD"],[1,0]],["X1",[1,2,"C"],[0,1]],["X2",[2,1,"E"],[0]]]
index: 79 , parameter: [["X0",[2,2,"FF"],[1,0]],["X1",[1,2,"C"],[0,1]],["X2",[2,1,"E"],[0]]]<jupyter_text>Print Morse graphs along the path<jupyter_code>for par_index in hyst_path:
    parameter = parameter_graph.parameter(par_index)
    domain_graph = DSGRN.DomainGraph(parameter)
    morse_decomp = DSGRN.MorseDecomposition(domain_graph.digraph())
    morse_graph = DSGRN.MorseGraph(domain_graph, morse_decomp)
    morse_graph_poset = morse_graph.poset()
    annotations = [morse_graph.annotation(n)[0] for n in range(morse_graph.poset().size())]
    print('index:', par_index, ', Morse sets:', annotations)<jupyter_output>index: 61 , Morse sets: ['FP { 0, 0, 0 }']
index: 63 , Morse sets: ['FP { 0, 0, 0 }', 'FP { 1, 0, 1 }']
index: 64 , Morse sets: ['FP { 0, 0, 0 }', 'FP { 1, 0, 1 }']
index: 70 , Morse sets: ['FP { 0, 0, 0 }', 'FP { 1, 0, 1 }', 'FP { 2, 2, 1 }']
index: 75 , Morse sets: ['FP { 0, 0, 0 }', 'FP { 2, 2, 1 }']
index: 76 , Morse sets: ['FP { 2, 2, 1 }']
index: 78 , Morse sets: ['FP { 2, 2, 1 }']
index: 79 , Morse sets: ['FP { 2, 2, 1 }']<jupyter_text>Draw table of Morse sets along the path<jupyter_code>Table(["Parameter Index", "Morse Graph"], 
      [[p, DrawGraph(MorseGraph(DomainGraph(parameter_graph.parameter(p))))] for p in hyst_path])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.24262961707895628, 'fraction_numerical': 0.06777363605557438, 'mean_word_length': 6.70757180156658, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '411493', 'license': 'MIT', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1257, 'n_words': 232, 'path': 'Hysteretic_Paths/Read_Hyst_Paths_Data_1.ipynb', 'repo_name': 'marciogameiro/hysteretic-paths', 'size': '2951'}