# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # <NAME>'s descent
#
# <NAME> (23 March 1882 – 14 April 1935) was a German mathematician who made important contributions to abstract algebra and theoretical physics (https://en.wikipedia.org/wiki/Emmy_Noether).
#
# According to the math genealogy project, <NAME> had 14 doctoral students, who had 76 themselves, ... so until now she has *1365* descendants.

import networkx, json
from francy_widget import FrancyWidget
G = networkx.DiGraph()
data = json.load(open("noether.json"))
nodes = data["nodes"]
#print(len(nodes))
nodes_to_keep = {k:nodes[k] for k in nodes if nodes[k][0]<4}
edges_to_keep = [e for e in data["edges"] if e[1] in nodes_to_keep]
G.add_edges_from(edges_to_keep)
def node_options(n):
    options = {}
    d = nodes[n]
    options["layer"] = d[0]
    options["title"] = "%s (%s)" % (d[2].split(",")[0], d[3])
    if n in ["6967", "63779", "6982", "29850", "121808", "191816",
             "54355", "98035", "44616", "57077", "21851"]:
        options["type"] = 'diamond'
    else:
        options["type"] = 'circle'
    return options
FrancyWidget(G, graphType="directed", height=800, zoomToFit=False,
             node_options=node_options)

StarcoderdataJupyterScriptsDedupFiltered