From ecd48bb596e1bf5a5b80aa86c06d6d8dc02b7f74 Mon Sep 17 00:00:00 2001 From: abikesa Date: Wed, 21 Aug 2024 21:18:08 -0400 Subject: [PATCH] Update documentation --- _sources/ipynb/logo.ipynb | 48 ++++++++++++++++++++++++++++++++------- ipynb/logo.html | 37 +++++++++++++++++++++++++----- searchindex.js | 2 +- 3 files changed, 72 insertions(+), 15 deletions(-) diff --git a/_sources/ipynb/logo.ipynb b/_sources/ipynb/logo.ipynb index 0bb92bd..f3fbc6d 100644 --- a/_sources/ipynb/logo.ipynb +++ b/_sources/ipynb/logo.ipynb @@ -114,7 +114,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 10, "metadata": { "tags": [ "hide-input" @@ -138,7 +138,7 @@ "\n", "def add_fern_edges(G, start, depth, angle, scale):\n", " if depth == 0:\n", - " return\n", + " return start\n", " \n", " end = (start[0] + scale * angle[0], start[1] + scale * angle[1])\n", " \n", @@ -147,21 +147,36 @@ " new_angle1 = (angle[0] * 0.6 - angle[1] * 0.4, angle[0] * 0.4 + angle[1] * 0.6)\n", " new_angle2 = (angle[0] * 0.6 + angle[1] * 0.4, -angle[0] * 0.4 + angle[1] * 0.6)\n", " \n", - " add_fern_edges(G, end, depth - 1, new_angle1, scale * 0.7)\n", - " add_fern_edges(G, end, depth - 1, new_angle2, scale * 0.7)\n", + " child1 = add_fern_edges(G, end, depth - 1, new_angle1, scale * 0.7)\n", + " child2 = add_fern_edges(G, end, depth - 1, new_angle2, scale * 0.7)\n", " \n", + " return end\n", + "\n", "def create_fern_graph(depth, scale=1):\n", " G = nx.Graph()\n", " start = (0, 0)\n", " angle = (0, 1)\n", " \n", - " add_fern_edges(G, start, depth, angle, scale)\n", + " child1 = add_fern_edges(G, start, depth, angle, scale)\n", " \n", - " return G\n", + " return G, start, child1\n", "\n", "# Generate the fern graph\n", "fern_depth = 7 # Adjust depth for more or fewer branches\n", - "fern_graph = create_fern_graph(fern_depth)\n", + "fern_graph, father, son = create_fern_graph(fern_depth)\n", + "\n", + "# Find the children of \"Father\"\n", + "children = list(fern_graph.neighbors(father))\n", + "\n", + "# Ensure there are at least two children\n", + "if len(children) >= 2:\n", + " # Label the edges as \"Son\" and \"HolySpirit\"\n", + " edge_labels = {\n", + " (father, children[0]): \"Son\",\n", + " (father, children[1]): \"HolySpirit\"\n", + " }\n", + "else:\n", + " edge_labels = {}\n", "\n", "# Define colors\n", "leaf_color = '#5F9E54' # A green between lime and cabbage\n", @@ -177,11 +192,28 @@ "pos = {node: node for node in fern_graph.nodes()}\n", "nx.draw(fern_graph, pos, with_labels=False, node_size=0, edge_color=colors, width=2)\n", "\n", + "# Draw edge labels if they exist\n", + "if edge_labels:\n", + " nx.draw_networkx_edge_labels(fern_graph, pos, edge_labels=edge_labels, font_size=12)\n", + "\n", "plt.axis('off')\n", "\n", "# Save the image\n", "# plt.savefig(\"/Users/apollo/Documents/rhythm/music/kitabo/ensi/figures/fern_fractal.png\", dpi=300, bbox_inches='tight')\n", - "plt.show()" + "plt.show()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```{figure} ../figures/blanche.*\n", + "---\n", + "width: 1\n", + "height: 1\n", + "---\n", + "_Extraordinary_. Parent is \"Father\" and children are \"Son\" and \"Holy Spirit\". Everything else springs from these two children: the wave-particle duality of the entire cosmos!\n", + "```" ] }, { diff --git a/ipynb/logo.html b/ipynb/logo.html index 23e9ddd..2df88bb 100644 --- a/ipynb/logo.html +++ b/ipynb/logo.html @@ -519,7 +519,7 @@

Contents

def add_fern_edges(G, start, depth, angle, scale): if depth == 0: - return + return start end = (start[0] + scale * angle[0], start[1] + scale * angle[1]) @@ -528,21 +528,36 @@

Contents

new_angle1 = (angle[0] * 0.6 - angle[1] * 0.4, angle[0] * 0.4 + angle[1] * 0.6) new_angle2 = (angle[0] * 0.6 + angle[1] * 0.4, -angle[0] * 0.4 + angle[1] * 0.6) - add_fern_edges(G, end, depth - 1, new_angle1, scale * 0.7) - add_fern_edges(G, end, depth - 1, new_angle2, scale * 0.7) + child1 = add_fern_edges(G, end, depth - 1, new_angle1, scale * 0.7) + child2 = add_fern_edges(G, end, depth - 1, new_angle2, scale * 0.7) + return end + def create_fern_graph(depth, scale=1): G = nx.Graph() start = (0, 0) angle = (0, 1) - add_fern_edges(G, start, depth, angle, scale) + child1 = add_fern_edges(G, start, depth, angle, scale) - return G + return G, start, child1 # Generate the fern graph fern_depth = 7 # Adjust depth for more or fewer branches -fern_graph = create_fern_graph(fern_depth) +fern_graph, father, son = create_fern_graph(fern_depth) + +# Find the children of "Father" +children = list(fern_graph.neighbors(father)) + +# Ensure there are at least two children +if len(children) >= 2: + # Label the edges as "Son" and "HolySpirit" + edge_labels = { + (father, children[0]): "Son", + (father, children[1]): "HolySpirit" + } +else: + edge_labels = {} # Define colors leaf_color = '#5F9E54' # A green between lime and cabbage @@ -558,6 +573,10 @@

Contents

pos = {node: node for node in fern_graph.nodes()} nx.draw(fern_graph, pos, with_labels=False, node_size=0, edge_color=colors, width=2) +# Draw edge labels if they exist +if edge_labels: + nx.draw_networkx_edge_labels(fern_graph, pos, edge_labels=edge_labels, font_size=12) + plt.axis('off') # Save the image @@ -571,6 +590,12 @@

Contents

../_images/6e3efdc487371d93e0c3060bb272eb87b38dbf6dc9b41975f1096a17b658416b.png +
+../_images/blanche.png +
+

Extraordinary. Parent is “Father” and children are “Son” and “Holy Spirit”. Everything else springs from these two children: the wave-particle duality of the entire cosmos!#

+
+