From f2dee979916a8068109f20a14921f0627bfd0e7f Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 1 Oct 2023 16:42:25 -0500 Subject: [PATCH 01/11] Add notebook for creating (and exploring) logos --- binder/environment.yml | 3 + environment.yml | 3 + notebooks/logos_and_colors.ipynb | 1721 ++++++++++++++++++++++++++++++ 3 files changed, 1727 insertions(+) create mode 100644 notebooks/logos_and_colors.ipynb diff --git a/binder/environment.yml b/binder/environment.yml index ef72a4d2b..a37cc70da 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -1,6 +1,7 @@ name: graphblas channels: - conda-forge + - nodefaults dependencies: - python=3.10 - python-graphblas @@ -8,3 +9,5 @@ dependencies: - networkx - pandas - scipy + - drawsvg + - cairosvg diff --git a/environment.yml b/environment.yml index 1a7fb6fa8..4455f4ac6 100644 --- a/environment.yml +++ b/environment.yml @@ -48,6 +48,9 @@ dependencies: - numpydoc - pydata-sphinx-theme - sphinx-panels + # For building logo + - drawsvg + - cairosvg # EXTRA (optional; uncomment as desired) # - autoflake # - black diff --git a/notebooks/logos_and_colors.ipynb b/notebooks/logos_and_colors.ipynb new file mode 100644 index 000000000..61333adfe --- /dev/null +++ b/notebooks/logos_and_colors.ipynb @@ -0,0 +1,1721 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "1ade2e62-38f4-4017-a0d3-e09f8587c376", + "metadata": {}, + "source": [ + "# Logos and Color Palette of Python-graphblas\n", + "\n", + "To create a minimal environment to run this notebook:\n", + "```bash\n", + "$ conda create -n drawsvg -c conda-forge drawsvg cairosvg scipy jupyter\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "bf42676c-190a-4803-a567-09e0ed260d6a", + "metadata": {}, + "outputs": [], + "source": [ + "import drawsvg as draw\n", + "import numpy as np\n", + "import scipy as sp" + ] + }, + { + "cell_type": "markdown", + "id": "876a6128-94e4-4fb0-938d-0980a2033701", + "metadata": {}, + "source": [ + "## Define color palette" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "786f9c9e-d999-4286-bf79-009ca1681604", + "metadata": {}, + "outputs": [], + "source": [ + "# primary\n", + "blue = \"#208BB4\"\n", + "orange = \"#F87A2D\"\n", + "dark_gray = \"#4D4D4D\"\n", + "light_gray = \"#C9D1D9\"\n", + "\n", + "# Neutral, light/dark compatible\n", + "medium_gray = \"#818081\"\n", + "\n", + "# secondary\n", + "light_blue = \"#68B5D3\"\n", + "light_orange = \"#FFAF7E\"\n", + "celadon = \"#B2C9AB\"\n", + "eggplant = \"#463239\"\n", + "dutch_white = \"#E8DDB5\"" + ] + }, + { + "cell_type": "markdown", + "id": "adb66550-f1e8-4846-a12a-e178fe801295", + "metadata": {}, + "source": [ + "## Display color palette" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "983b0cb8-db8b-4ad0-ad5a-36975d59289e", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "Primary\n", + "\n", + "#208BB4\n", + "\n", + "#F87A2D\n", + "\n", + "#4D4D4D\n", + "\n", + "#C9D1D9\n", + "\n", + "#818081\n", + "Secondary\n", + "\n", + "#68B5D3\n", + "\n", + "#FFAF7E\n", + "\n", + "#B2C9AB\n", + "\n", + "#463239\n", + "\n", + "#E8DDB5\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d = draw.Drawing(750, 500, origin=\"center\")\n", + "d.append(\n", + " draw.Rectangle(-375, -250, 750, 500, fill=\"white\")\n", + ") # Add `stroke=\"black\"` border to see boundaries for testing\n", + "\n", + "dy = 25\n", + "dx = 0\n", + "w = h = 150\n", + "b = 25\n", + "x = -400 + 62.5 + dx\n", + "y = -200 + dy\n", + "\n", + "d.draw(\n", + " draw.Text(\n", + " \"Primary\",\n", + " x=x + 1.5 * (b + w) + w / 2,\n", + " y=y - b,\n", + " font_size=1.5 * b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"black\",\n", + " )\n", + ")\n", + "d.draw(draw.Rectangle(x, y, w, h, fill=blue))\n", + "d.draw(\n", + " draw.Text(\n", + " blue.upper(),\n", + " x=x + w / 2,\n", + " y=y + h - b,\n", + " font_size=b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"white\",\n", + " )\n", + ")\n", + "d.draw(draw.Rectangle(x + b + w, y, w, h, fill=orange))\n", + "d.draw(\n", + " draw.Text(\n", + " orange.upper(),\n", + " x=x + (b + w) + w / 2,\n", + " y=y + h - b,\n", + " font_size=b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"white\",\n", + " )\n", + ")\n", + "d.draw(draw.Rectangle(x + 2 * (b + w), y, w, h, fill=dark_gray))\n", + "d.draw(\n", + " draw.Text(\n", + " dark_gray.upper(),\n", + " x=x + 2 * (b + w) + w / 2,\n", + " y=y + h - b,\n", + " font_size=b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"white\",\n", + " )\n", + ")\n", + "d.draw(draw.Rectangle(x + 3 * (b + w), y, w, h, fill=light_gray))\n", + "d.draw(\n", + " draw.Text(\n", + " light_gray.upper(),\n", + " x=x + 3 * (b + w) + w / 2,\n", + " y=y + h - b,\n", + " font_size=b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"black\",\n", + " )\n", + ")\n", + "\n", + "d.draw(draw.Rectangle(x, -25 + dy, 675, 45, fill=medium_gray))\n", + "d.draw(\n", + " draw.Text(\n", + " medium_gray.upper(),\n", + " x=x + 675 / 2,\n", + " y=-25 + 30 + dy,\n", + " font_size=22.5,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"white\",\n", + " )\n", + ")\n", + "\n", + "y = 40 + dy\n", + "w = h = 119\n", + "b = 20\n", + "d.draw(\n", + " draw.Text(\n", + " \"Secondary\",\n", + " x=x + 2 * (b + w) + w / 2,\n", + " y=y + h + 2 * b,\n", + " font_size=1.5 * b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"black\",\n", + " )\n", + ")\n", + "d.draw(draw.Rectangle(x, y, w, h, fill=light_blue))\n", + "d.draw(\n", + " draw.Text(\n", + " light_blue.upper(),\n", + " x=x + w / 2,\n", + " y=y + h - b,\n", + " font_size=b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"black\",\n", + " )\n", + ")\n", + "d.draw(draw.Rectangle(x + b + w, y, w, h, fill=light_orange))\n", + "d.draw(\n", + " draw.Text(\n", + " light_orange.upper(),\n", + " x=x + (b + w) + w / 2,\n", + " y=y + h - b,\n", + " font_size=b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"black\",\n", + " )\n", + ")\n", + "d.draw(draw.Rectangle(x + 2 * (b + w), y, w, h, fill=celadon))\n", + "d.draw(\n", + " draw.Text(\n", + " celadon.upper(),\n", + " x=x + 2 * (b + w) + w / 2,\n", + " y=y + h - b,\n", + " font_size=b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"black\",\n", + " )\n", + ")\n", + "d.draw(draw.Rectangle(x + 3 * (b + w), y, w, h, fill=eggplant))\n", + "d.draw(\n", + " draw.Text(\n", + " eggplant.upper(),\n", + " x=x + 3 * (b + w) + w / 2,\n", + " y=y + h - b,\n", + " font_size=b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"white\",\n", + " )\n", + ")\n", + "d.draw(draw.Rectangle(x + 4 * (b + w), y, w, h, fill=dutch_white))\n", + "d.draw(\n", + " draw.Text(\n", + " dutch_white.upper(),\n", + " x=x + 4 * (b + w) + w / 2,\n", + " y=y + h - b,\n", + " font_size=b,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Arial\",\n", + " fill=\"black\",\n", + " )\n", + ")\n", + "\n", + "# d.save()\n", + "d_color_palette = d\n", + "d" + ] + }, + { + "cell_type": "markdown", + "id": "e59c3941-c73b-455e-88f2-4b3aae228421", + "metadata": {}, + "source": [ + "## Display color wheel" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "c27e8ef2-04f2-4752-9c3b-cf297a0c87a5", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d = draw.Drawing(300, 300, origin=\"center\")\n", + "\n", + "color_wheel = [\n", + " blue,\n", + " light_gray,\n", + " light_blue,\n", + " dark_gray,\n", + " orange,\n", + " light_orange,\n", + "]\n", + "theta = np.pi / 3\n", + "\n", + "angle = 0\n", + "for i, color in enumerate(color_wheel):\n", + " angle = i * np.pi / 3\n", + " clip = draw.ClipPath()\n", + " if i == 5:\n", + " angle_offset = theta\n", + " else:\n", + " angle_offset = theta * 1.5\n", + " clip.append(\n", + " draw.Lines(\n", + " 0,\n", + " 0,\n", + " 300 * np.sin(angle),\n", + " 300 * np.cos(angle),\n", + " 300 * np.sin(angle + angle_offset),\n", + " 300 * np.cos(angle + angle_offset),\n", + " close=True,\n", + " )\n", + " )\n", + " if i == 0:\n", + " clip = None\n", + " d.append(draw.Circle(0, 0, 145, fill=color, clip_path=clip))\n", + "\n", + "angle = 3 * theta\n", + "for i, color in enumerate(color_wheel):\n", + " angle = ((i + 3) % 6) * np.pi / 3\n", + " clip = draw.ClipPath()\n", + " if i == 5:\n", + " angle_offset = theta\n", + " else:\n", + " angle_offset = theta * 1.5\n", + " clip.append(\n", + " draw.Lines(\n", + " 0,\n", + " 0,\n", + " 300 * np.sin(angle),\n", + " 300 * np.cos(angle),\n", + " 300 * np.sin(angle + angle_offset),\n", + " 300 * np.cos(angle + angle_offset),\n", + " close=True,\n", + " )\n", + " )\n", + " if i == 0:\n", + " clip = None\n", + " d.append(draw.Circle(0, 0, 105, fill=color, clip_path=clip))\n", + "\n", + "angle = theta\n", + "for i, color in enumerate(color_wheel):\n", + " angle = ((i + 1) % 6) * np.pi / 3\n", + " clip = draw.ClipPath()\n", + " if i == 5:\n", + " angle_offset = theta\n", + " else:\n", + " angle_offset = theta * 1.5\n", + " clip.append(\n", + " draw.Lines(\n", + " 0,\n", + " 0,\n", + " 300 * np.sin(angle),\n", + " 300 * np.cos(angle),\n", + " 300 * np.sin(angle + angle_offset),\n", + " 300 * np.cos(angle + angle_offset),\n", + " close=True,\n", + " )\n", + " )\n", + " if i == 0:\n", + " clip = None\n", + " d.append(draw.Circle(0, 0, 65, fill=color, clip_path=clip))\n", + "\n", + "d.append(draw.Circle(0, 0, 25, fill=medium_gray))\n", + "d_color_wheel = d\n", + "d" + ] + }, + { + "cell_type": "markdown", + "id": "343256c8-35a7-4c89-aa60-c6bf60930c09", + "metadata": {}, + "source": [ + "## Create logos" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "7855cd3f-8155-4d11-9730-b6041578e112", + "metadata": {}, + "outputs": [], + "source": [ + "angles = [\n", + " 180, # Don't modify this\n", + " 30, # How much of the \"left face\" to see\n", + " 22.5, # How much of the \"top face\" to see\n", + "]\n", + "R = sp.spatial.transform.Rotation.from_euler(\"ZYX\", angles, degrees=True).as_matrix()\n", + "\n", + "gcube = np.array(\n", + " [\n", + " [-1, 1, -1],\n", + " [-1, 1, 1],\n", + " [1, 1, 1],\n", + " [-1, -1, 1],\n", + " [1, -1, 1],\n", + " [1, 0, 1],\n", + " [0, 0, 1],\n", + " ]\n", + ")\n", + "gcube_major = gcube[:5] # Big circles\n", + "gcube_minor = gcube[5:] # Small circles\n", + "lines = np.array(\n", + " [\n", + " [gcube[1], gcube[0]],\n", + " ]\n", + ")\n", + "Gpath = np.array(\n", + " [\n", + " gcube[2],\n", + " gcube[1],\n", + " gcube[3],\n", + " gcube[4],\n", + " gcube[5],\n", + " gcube[6],\n", + " ]\n", + ")\n", + "\n", + "\n", + "def create_logo(\n", + " *,\n", + " bracket_color=None,\n", + " bg_color=None,\n", + " edge_color=None,\n", + " edge_border_color=\"white\",\n", + " edge_border_width=16,\n", + " node_color=None,\n", + " node_border_color=\"white\",\n", + " node_stroke_width=4,\n", + "):\n", + " if bracket_color is None:\n", + " bracket_color = medium_gray\n", + " if edge_color is None:\n", + " edge_color = orange\n", + " if node_color is None:\n", + " node_color = blue\n", + "\n", + " d = draw.Drawing(190, 190, origin=\"center\")\n", + " if bg_color:\n", + " # Add `stroke=\"black\"` border to see boundaries for testing\n", + " d.append(draw.Rectangle(-95, -95, 190, 190, fill=bg_color))\n", + "\n", + " scale = 40\n", + " dx = 0\n", + " dy = -2\n", + "\n", + " if edge_border_width:\n", + " # Add white border around lines\n", + " d.append(\n", + " draw.Lines(\n", + " *(((Gpath @ R) * scale)[:, :2] * [-1, 1]).ravel().tolist(),\n", + " fill=\"none\",\n", + " stroke=edge_border_color,\n", + " stroke_width=edge_border_width,\n", + " )\n", + " )\n", + " for (x0, y0, z0), (x1, y1, z1) in ((lines @ R) * scale).tolist():\n", + " x0 = -x0\n", + " x1 = -x1 # Just live with this\n", + " d.append(\n", + " draw.Line(\n", + " x0 + dx,\n", + " y0 + dy,\n", + " x1 + dx,\n", + " y1 + dy,\n", + " stroke=edge_border_color,\n", + " stroke_width=edge_border_width,\n", + " )\n", + " )\n", + "\n", + " # Add edges\n", + " d.append(\n", + " draw.Lines(\n", + " *(((Gpath @ R) * scale)[:, :2] * [-1, 1]).ravel().tolist(),\n", + " fill=\"none\",\n", + " stroke=edge_color,\n", + " stroke_width=8,\n", + " )\n", + " )\n", + " for (x0, y0, z0), (x1, y1, z1) in ((lines @ R) * scale).tolist():\n", + " x0 = -x0\n", + " x1 = -x1\n", + " d.append(draw.Line(x0 + dx, y0 + dy, x1 + dx, y1 + dy, stroke=edge_color, stroke_width=8))\n", + "\n", + " # Add vertices\n", + " for x, y, z in ((gcube_major @ R) * scale).tolist():\n", + " x = -x\n", + " d.append(\n", + " draw.Circle(\n", + " x + dx, y + dy, 16, fill=node_color, stroke=node_border_color, stroke_width=4\n", + " )\n", + " )\n", + " for x, y, z in ((gcube_minor @ R) * scale).tolist():\n", + " x = -x\n", + " d.append(\n", + " draw.Circle(\n", + " x + dx, y + dy, 8, fill=node_color, stroke=node_border_color, stroke_width=4\n", + " )\n", + " )\n", + "\n", + " # Add brackets\n", + " d.append(\n", + " draw.Text(\n", + " \"[\",\n", + " x=-85,\n", + " y=52,\n", + " font_size=214,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Courier New\",\n", + " fill=bracket_color,\n", + " )\n", + " )\n", + " d.append(\n", + " draw.Text(\n", + " \"]\",\n", + " x=85,\n", + " y=52,\n", + " font_size=214,\n", + " text_anchor=\"middle\",\n", + " font_family=\"Courier New\",\n", + " fill=bracket_color,\n", + " )\n", + " )\n", + "\n", + " return d" + ] + }, + { + "cell_type": "markdown", + "id": "b187c131-d337-4a7b-ab54-80ebe0f48ab4", + "metadata": {}, + "source": [ + "### Background-agnostic (works with light and dark mode)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "acca9b2e-2f54-4b86-9a33-2c57502f6160", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "create_logo(bracket_color=medium_gray, bg_color=\"white\")" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "f5d0086d-b50e-49eb-9aae-b0953cdc0045", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 0\n", + "create_logo(bracket_color=medium_gray, bg_color=\"black\")" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "20f2d568-1f85-4a16-adca-953e0dcda861", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 1\n", + "create_logo(bracket_color=medium_gray, bg_color=\"black\", edge_border_width=0)" + ] + }, + { + "cell_type": "markdown", + "id": "c4dce89d-e34c-4190-a068-7e78cdeea745", + "metadata": {}, + "source": [ + "### For light mode" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "27137343-141a-422e-abd6-123af3416ea4", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "create_logo(bracket_color=dark_gray, bg_color=\"white\")" + ] + }, + { + "cell_type": "markdown", + "id": "8a70b0f7-c3c4-44ae-af09-8992400f362e", + "metadata": {}, + "source": [ + "### For dark mode" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "3ab9bb40-d7a8-4788-9971-54a5779d284d", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 0\n", + "create_logo(bracket_color=light_gray, bg_color=\"black\")" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "2a161fe5-e9d5-4a29-b4cc-20c7aea027a7", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 1\n", + "create_logo(bracket_color=light_gray, bg_color=\"black\", edge_border_width=0)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "8316a01d-5908-4f16-84ce-9e929ca34685", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 2\n", + "create_logo(\n", + " bracket_color=light_gray,\n", + " bg_color=\"black\",\n", + " edge_border_width=0,\n", + " node_color=light_blue,\n", + " edge_color=light_orange,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "174bb288-15ab-4643-862c-3a05f8d38538", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 3\n", + "create_logo(\n", + " bracket_color=light_gray,\n", + " bg_color=\"black\",\n", + " edge_border_color=light_orange,\n", + " node_border_color=light_blue,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "917363b5-f40d-4cc5-813b-446d1e9e7bca", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 3 for light mode\n", + "create_logo(\n", + " bracket_color=dark_gray,\n", + " bg_color=\"white\",\n", + " edge_border_color=light_orange,\n", + " node_border_color=light_blue,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "f44f2e90-5f55-481f-a7db-fda630a1ad20", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 4\n", + "create_logo(\n", + " bracket_color=light_gray,\n", + " bg_color=\"black\",\n", + " edge_color=light_orange,\n", + " edge_border_color=\"black\",\n", + " node_color=light_blue,\n", + " node_border_color=\"black\",\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "65566321-1438-4ff2-a2be-aab94830607d", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 5 (dark)\n", + "create_logo(\n", + " bracket_color=light_gray,\n", + " bg_color=\"black\",\n", + " edge_border_color=eggplant,\n", + " node_color=light_blue,\n", + " node_border_color=eggplant,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "bf672773-ecdd-43c2-90ed-0b8b919528cd", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 5 (light)\n", + "create_logo(\n", + " bracket_color=dark_gray,\n", + " bg_color=\"white\",\n", + " edge_border_color=eggplant,\n", + " node_color=light_blue,\n", + " node_border_color=eggplant,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "175d64aa-40c9-4734-9966-2b3928d96df6", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 5 (light & dark)\n", + "create_logo(\n", + " bracket_color=medium_gray,\n", + " bg_color=\"black\",\n", + " edge_border_color=eggplant,\n", + " node_color=light_blue,\n", + " node_border_color=eggplant,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "7aa17514-8ae4-42df-a841-582c0ff7cba6", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Variant 5 (light & dark)\n", + "create_logo(\n", + " bracket_color=medium_gray,\n", + " bg_color=\"white\",\n", + " edge_border_color=eggplant,\n", + " node_color=light_blue,\n", + " node_border_color=eggplant,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "ae39a9e1-dc41-411c-b111-09b78fac3f94", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Misc 0\n", + "create_logo(\n", + " bracket_color=medium_gray, bg_color=\"white\", edge_border_width=0, node_border_color=light_blue\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "490f2ea1-43fe-4310-bdd2-d4e931a70545", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Misc 1 (light & dark)\n", + "create_logo(\n", + " bracket_color=medium_gray, bg_color=\"white\", edge_border_width=0, node_border_color=light_gray\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "bbbc309a-40d5-40f2-a637-044f650a5761", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Misc 1 (light & dark)\n", + "create_logo(\n", + " bracket_color=medium_gray, bg_color=\"black\", edge_border_width=0, node_border_color=light_gray\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "07858758-7de0-40ce-ba79-860f9b24461d", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Misc 2 (light)\n", + "create_logo(\n", + " bracket_color=dark_gray,\n", + " bg_color=\"white\",\n", + " edge_border_color=dark_gray,\n", + " edge_color=light_orange,\n", + " node_border_color=dark_gray,\n", + " node_color=light_blue,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "78b64fa7-eab4-4a17-beea-f7e771dec9aa", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Misc 3 (dark)\n", + "create_logo(\n", + " bracket_color=light_gray,\n", + " bg_color=\"black\",\n", + " edge_border_color=light_gray,\n", + " node_border_color=light_gray,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "f8f96ab4-ea12-489e-9680-0d1a2ebc56df", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Misc 4 (light & dark)\n", + "create_logo(bracket_color=medium_gray, bg_color=\"white\", edge_color=blue, node_color=orange)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "b304e83d-e258-49b2-b262-1bcdde4185b6", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Misc 4 (light & dark)\n", + "create_logo(bracket_color=medium_gray, bg_color=\"black\", edge_color=blue, node_color=orange)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "2bb14d0a-2838-418f-9190-15fcb90a7748", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Misc 5 (dark)\n", + "create_logo(\n", + " bracket_color=light_gray,\n", + " bg_color=\"black\",\n", + " edge_color=light_blue,\n", + " node_color=orange,\n", + " edge_border_width=0,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "d53046c1-8cbb-47fa-a88b-4d98958df26b", + "metadata": {}, + "outputs": [], + "source": [ + "if False:\n", + " # Don't set the background so it will be transparent\n", + " create_logo(bracket_color=medium_gray).save_svg(\"logo-medium.svg\")\n", + " create_logo(bracket_color=dark_gray).save_svg(\"logo-light.svg\")\n", + " create_logo(bracket_color=light_gray).save_svg(\"logo-dark.svg\")\n", + " d_color_palette.save_svg(\"color-palette.svg\")\n", + " d_color_wheel.save_svg(\"color-wheel.svg\")\n", + " d_color_palette.save_png(\"color-palette.png\")\n", + " d_color_wheel.save_png(\"color-wheel.png\")" + ] + }, + { + "cell_type": "markdown", + "id": "51093fab-600b-47d7-9809-fa0f16e7246f", + "metadata": {}, + "source": [ + "### *NOTE: The font in the SVG files should be converted to paths, because not all systems have Courier New*" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.5" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From c9362ac30ebbfe1f31e543111a2e9685cc4531a4 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 1 Oct 2023 17:27:12 -0500 Subject: [PATCH 02/11] Install drawsvg when testing notebooks --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 5f1ab7dde..e353862f8 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -260,7 +260,7 @@ jobs: pyyaml${yamlver} ${sparse} pandas${pdver} scipy${spver} numpy${npver} ${awkward} \ networkx${nxver} ${numba} ${fmm} ${psg} \ ${{ matrix.slowtask == 'pytest_bizarro' && 'black' || '' }} \ - ${{ matrix.slowtask == 'notebooks' && 'matplotlib nbconvert jupyter "ipython>=7"' || '' }} \ + ${{ matrix.slowtask == 'notebooks' && 'matplotlib nbconvert jupyter "ipython>=7" drawsvg' || '' }} \ ${{ steps.sourcetype.outputs.selected == 'upstream' && 'cython' || '' }} \ ${{ steps.sourcetype.outputs.selected != 'wheel' && '"graphblas>=7.4"' || '' }} \ ${{ contains(steps.pyver.outputs.selected, 'pypy') && 'pypy' || '' }} \ From c3c38800392484389aeb43b308f13eaf3f78e7f8 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 3 Oct 2023 16:51:16 -0500 Subject: [PATCH 03/11] Update logo notebook --- notebooks/logos_and_colors.ipynb | 1842 +++++++++++++----------------- 1 file changed, 794 insertions(+), 1048 deletions(-) diff --git a/notebooks/logos_and_colors.ipynb b/notebooks/logos_and_colors.ipynb index 61333adfe..344f86c74 100644 --- a/notebooks/logos_and_colors.ipynb +++ b/notebooks/logos_and_colors.ipynb @@ -41,20 +41,22 @@ "outputs": [], "source": [ "# primary\n", - "blue = \"#208BB4\"\n", - "orange = \"#F87A2D\"\n", - "dark_gray = \"#4D4D4D\"\n", - "light_gray = \"#C9D1D9\"\n", + "blue = \"#409DC1\"\n", + "orange = \"#FF8552\"\n", + "dark_gray = \"#39393A\"\n", + "light_gray = \"#C3C3C7\"\n", "\n", "# Neutral, light/dark compatible\n", - "medium_gray = \"#818081\"\n", + "medium_gray = \"#848487\"\n", "\n", "# secondary\n", - "light_blue = \"#68B5D3\"\n", - "light_orange = \"#FFAF7E\"\n", - "celadon = \"#B2C9AB\"\n", - "eggplant = \"#463239\"\n", - "dutch_white = \"#E8DDB5\"" + "light_blue = \"#81B7CC\"\n", + "light_orange = \"#FFBB9E\"\n", + "red = \"#6D213C\"\n", + "light_red = \"#BA708A\"\n", + "green = \"#85FFC7\"\n", + "\n", + "french_rose = \"#FA4B88\" # ;)" ] }, { @@ -81,31 +83,31 @@ "\n", "\n", "Primary\n", - "\n", - "#208BB4\n", - "\n", - "#F87A2D\n", - "\n", - "#4D4D4D\n", - "\n", - "#C9D1D9\n", - "\n", - "#818081\n", + "\n", + "#409DC1\n", + "\n", + "#FF8552\n", + "\n", + "#39393A\n", + "\n", + "#C3C3C7\n", + "\n", + "#848487\n", "Secondary\n", - "\n", - "#68B5D3\n", - "\n", - "#FFAF7E\n", - "\n", - "#B2C9AB\n", - "\n", - "#463239\n", - "\n", - "#E8DDB5\n", + "\n", + "#81B7CC\n", + "\n", + "#FFBB9E\n", + "\n", + "#6D213C\n", + "\n", + "#BA708A\n", + "\n", + "#85FFC7\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 3, @@ -146,7 +148,7 @@ " font_size=b,\n", " text_anchor=\"middle\",\n", " font_family=\"Arial\",\n", - " fill=\"white\",\n", + " fill=\"black\",\n", " )\n", ")\n", "d.draw(draw.Rectangle(x + b + w, y, w, h, fill=orange))\n", @@ -158,7 +160,7 @@ " font_size=b,\n", " text_anchor=\"middle\",\n", " font_family=\"Arial\",\n", - " fill=\"white\",\n", + " fill=\"black\",\n", " )\n", ")\n", "d.draw(draw.Rectangle(x + 2 * (b + w), y, w, h, fill=dark_gray))\n", @@ -195,7 +197,7 @@ " font_size=22.5,\n", " text_anchor=\"middle\",\n", " font_family=\"Arial\",\n", - " fill=\"white\",\n", + " fill=\"black\",\n", " )\n", ")\n", "\n", @@ -237,34 +239,34 @@ " fill=\"black\",\n", " )\n", ")\n", - "d.draw(draw.Rectangle(x + 2 * (b + w), y, w, h, fill=celadon))\n", + "d.draw(draw.Rectangle(x + 2 * (b + w), y, w, h, fill=red))\n", "d.draw(\n", " draw.Text(\n", - " celadon.upper(),\n", + " red.upper(),\n", " x=x + 2 * (b + w) + w / 2,\n", " y=y + h - b,\n", " font_size=b,\n", " text_anchor=\"middle\",\n", " font_family=\"Arial\",\n", - " fill=\"black\",\n", + " fill=\"white\",\n", " )\n", ")\n", - "d.draw(draw.Rectangle(x + 3 * (b + w), y, w, h, fill=eggplant))\n", + "d.draw(draw.Rectangle(x + 3 * (b + w), y, w, h, fill=light_red))\n", "d.draw(\n", " draw.Text(\n", - " eggplant.upper(),\n", + " light_red.upper(),\n", " x=x + 3 * (b + w) + w / 2,\n", " y=y + h - b,\n", " font_size=b,\n", " text_anchor=\"middle\",\n", " font_family=\"Arial\",\n", - " fill=\"white\",\n", + " fill=\"black\",\n", " )\n", ")\n", - "d.draw(draw.Rectangle(x + 4 * (b + w), y, w, h, fill=dutch_white))\n", + "d.draw(draw.Rectangle(x + 4 * (b + w), y, w, h, fill=green))\n", "d.draw(\n", " draw.Text(\n", - " dutch_white.upper(),\n", + " green.upper(),\n", " x=x + 4 * (b + w) + w / 2,\n", " y=y + h - b,\n", " font_size=b,\n", @@ -274,8 +276,7 @@ " )\n", ")\n", "\n", - "# d.save()\n", - "d_color_palette = d\n", + "color_palette = d\n", "d" ] }, @@ -292,6 +293,90 @@ "execution_count": 4, "id": "c27e8ef2-04f2-4752-9c3b-cf297a0c87a5", "metadata": {}, + "outputs": [], + "source": [ + "def create_color_wheel(color_wheel):\n", + " d = draw.Drawing(300, 300, origin=\"center\")\n", + " theta = np.pi / 3\n", + "\n", + " angle = 0\n", + " for i, color in enumerate(color_wheel):\n", + " angle = i * np.pi / 3\n", + " clip = draw.ClipPath()\n", + " if i == 5:\n", + " angle_offset = theta\n", + " else:\n", + " angle_offset = theta * 1.05\n", + " clip.append(\n", + " draw.Lines(\n", + " 0,\n", + " 0,\n", + " 300 * np.sin(angle),\n", + " 300 * np.cos(angle),\n", + " 300 * np.sin(angle + angle_offset),\n", + " 300 * np.cos(angle + angle_offset),\n", + " close=True,\n", + " )\n", + " )\n", + " if i == 0:\n", + " clip = None\n", + " d.append(draw.Circle(0, 0, 145, fill=color, clip_path=clip))\n", + "\n", + " angle = 3 * theta\n", + " for i, color in enumerate(color_wheel):\n", + " angle = ((i + 3) % 6) * np.pi / 3\n", + " clip = draw.ClipPath()\n", + " if i == 5:\n", + " angle_offset = theta\n", + " else:\n", + " angle_offset = theta * 1.05\n", + " clip.append(\n", + " draw.Lines(\n", + " 0,\n", + " 0,\n", + " 300 * np.sin(angle),\n", + " 300 * np.cos(angle),\n", + " 300 * np.sin(angle + angle_offset),\n", + " 300 * np.cos(angle + angle_offset),\n", + " close=True,\n", + " )\n", + " )\n", + " if i == 0:\n", + " clip = None\n", + " d.append(draw.Circle(0, 0, 105, fill=color, clip_path=clip))\n", + "\n", + " angle = theta\n", + " for i, color in enumerate(color_wheel):\n", + " angle = ((i + 1) % 6) * np.pi / 3\n", + " clip = draw.ClipPath()\n", + " if i == 5:\n", + " angle_offset = theta\n", + " else:\n", + " angle_offset = theta * 1.05\n", + " clip.append(\n", + " draw.Lines(\n", + " 0,\n", + " 0,\n", + " 300 * np.sin(angle),\n", + " 300 * np.cos(angle),\n", + " 300 * np.sin(angle + angle_offset),\n", + " 300 * np.cos(angle + angle_offset),\n", + " close=True,\n", + " )\n", + " )\n", + " if i == 0:\n", + " clip = None\n", + " d.append(draw.Circle(0, 0, 65, fill=color, clip_path=clip))\n", + "\n", + " d.append(draw.Circle(0, 0, 25, fill=medium_gray))\n", + " return d" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "2564bf63-8293-4828-8e38-d00a3b96b067", + "metadata": {}, "outputs": [ { "data": { @@ -300,167 +385,511 @@ "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "" ], "text/plain": [ - "" + "" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "d = draw.Drawing(300, 300, origin=\"center\")\n", - "\n", - "color_wheel = [\n", - " blue,\n", - " light_gray,\n", - " light_blue,\n", - " dark_gray,\n", - " orange,\n", - " light_orange,\n", - "]\n", - "theta = np.pi / 3\n", - "\n", - "angle = 0\n", - "for i, color in enumerate(color_wheel):\n", - " angle = i * np.pi / 3\n", - " clip = draw.ClipPath()\n", - " if i == 5:\n", - " angle_offset = theta\n", - " else:\n", - " angle_offset = theta * 1.5\n", - " clip.append(\n", - " draw.Lines(\n", - " 0,\n", - " 0,\n", - " 300 * np.sin(angle),\n", - " 300 * np.cos(angle),\n", - " 300 * np.sin(angle + angle_offset),\n", - " 300 * np.cos(angle + angle_offset),\n", - " close=True,\n", - " )\n", - " )\n", - " if i == 0:\n", - " clip = None\n", - " d.append(draw.Circle(0, 0, 145, fill=color, clip_path=clip))\n", - "\n", - "angle = 3 * theta\n", - "for i, color in enumerate(color_wheel):\n", - " angle = ((i + 3) % 6) * np.pi / 3\n", - " clip = draw.ClipPath()\n", - " if i == 5:\n", - " angle_offset = theta\n", - " else:\n", - " angle_offset = theta * 1.5\n", - " clip.append(\n", - " draw.Lines(\n", - " 0,\n", - " 0,\n", - " 300 * np.sin(angle),\n", - " 300 * np.cos(angle),\n", - " 300 * np.sin(angle + angle_offset),\n", - " 300 * np.cos(angle + angle_offset),\n", - " close=True,\n", - " )\n", - " )\n", - " if i == 0:\n", - " clip = None\n", - " d.append(draw.Circle(0, 0, 105, fill=color, clip_path=clip))\n", - "\n", - "angle = theta\n", - "for i, color in enumerate(color_wheel):\n", - " angle = ((i + 1) % 6) * np.pi / 3\n", - " clip = draw.ClipPath()\n", - " if i == 5:\n", - " angle_offset = theta\n", - " else:\n", - " angle_offset = theta * 1.5\n", - " clip.append(\n", - " draw.Lines(\n", - " 0,\n", - " 0,\n", - " 300 * np.sin(angle),\n", - " 300 * np.cos(angle),\n", - " 300 * np.sin(angle + angle_offset),\n", - " 300 * np.cos(angle + angle_offset),\n", - " close=True,\n", - " )\n", - " )\n", - " if i == 0:\n", - " clip = None\n", - " d.append(draw.Circle(0, 0, 65, fill=color, clip_path=clip))\n", - "\n", - "d.append(draw.Circle(0, 0, 25, fill=medium_gray))\n", - "d_color_wheel = d\n", - "d" + "# Standard\n", + "standard_wheel = create_color_wheel(\n", + " [\n", + " blue,\n", + " light_gray,\n", + " light_blue,\n", + " dark_gray,\n", + " orange,\n", + " light_orange,\n", + " ]\n", + ")\n", + "standard_wheel" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "7a500a39-4114-49bb-aa19-912c6a8a8d95", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# High contrast\n", + "high_wheel = create_color_wheel(\n", + " [\n", + " light_gray,\n", + " blue,\n", + " green,\n", + " dark_gray,\n", + " orange,\n", + " red,\n", + " ]\n", + ")\n", + "high_wheel" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "8f404efe-2b88-4bdf-9102-2e6ad9389ca3", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Low contrast\n", + "low_wheel = create_color_wheel(\n", + " [\n", + " green,\n", + " light_red,\n", + " orange,\n", + " light_blue,\n", + " light_orange,\n", + " blue,\n", + " ]\n", + ")\n", + "low_wheel" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "fd913698-ea45-4219-8003-0fd30124d091", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Warm :)\n", + "warm_wheel = create_color_wheel(\n", + " [\n", + " light_gray, # or dark_gray\n", + " light_red,\n", + " french_rose, # ;)\n", + " red,\n", + " orange,\n", + " light_orange,\n", + " ]\n", + ")\n", + "warm_wheel" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "c7a3a5e6-4be4-4def-9687-00d1e3f80375", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Cool\n", + "cool_wheel = create_color_wheel(\n", + " [\n", + " light_blue,\n", + " light_gray,\n", + " blue,\n", + " light_red,\n", + " green,\n", + " dark_gray,\n", + " ]\n", + ")\n", + "cool_wheel" ] }, { @@ -473,17 +902,17 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 10, "id": "7855cd3f-8155-4d11-9730-b6041578e112", "metadata": {}, "outputs": [], "source": [ - "angles = [\n", + "default_angles = [\n", " 180, # Don't modify this\n", " 30, # How much of the \"left face\" to see\n", " 22.5, # How much of the \"top face\" to see\n", "]\n", - "R = sp.spatial.transform.Rotation.from_euler(\"ZYX\", angles, degrees=True).as_matrix()\n", + "R = sp.spatial.transform.Rotation.from_euler(\"ZYX\", default_angles, degrees=True).as_matrix()\n", "\n", "gcube = np.array(\n", " [\n", @@ -520,23 +949,34 @@ " bracket_color=None,\n", " bg_color=None,\n", " edge_color=None,\n", + " edge_width=8,\n", " edge_border_color=\"white\",\n", " edge_border_width=16,\n", " node_color=None,\n", + " large_node_width=16,\n", + " small_node_width=8,\n", " node_border_color=\"white\",\n", " node_stroke_width=4,\n", + " large_border=True,\n", + " g_color=None,\n", + " angles=None,\n", "):\n", - " if bracket_color is None:\n", - " bracket_color = medium_gray\n", + " if angles is None:\n", + " angles = default_angles\n", " if edge_color is None:\n", - " edge_color = orange\n", + " edge_color = blue\n", + " if bracket_color is None:\n", + " bracket_color = edge_color\n", " if node_color is None:\n", - " node_color = blue\n", + " node_color = orange\n", + " if g_color is None:\n", + " g_color = edge_color\n", "\n", " d = draw.Drawing(190, 190, origin=\"center\")\n", " if bg_color:\n", - " # Add `stroke=\"black\"` border to see boundaries for testing\n", - " d.append(draw.Rectangle(-95, -95, 190, 190, fill=bg_color))\n", + " d.append(\n", + " draw.Rectangle(-95, -95, 190, 190, fill=bg_color)\n", + " ) # Add `stroke=\"black\"` border to see boundaries for testing\n", "\n", " scale = 40\n", " dx = 0\n", @@ -571,28 +1011,42 @@ " draw.Lines(\n", " *(((Gpath @ R) * scale)[:, :2] * [-1, 1]).ravel().tolist(),\n", " fill=\"none\",\n", - " stroke=edge_color,\n", - " stroke_width=8,\n", + " stroke=g_color,\n", + " stroke_width=edge_width,\n", " )\n", " )\n", " for (x0, y0, z0), (x1, y1, z1) in ((lines @ R) * scale).tolist():\n", " x0 = -x0\n", " x1 = -x1\n", - " d.append(draw.Line(x0 + dx, y0 + dy, x1 + dx, y1 + dy, stroke=edge_color, stroke_width=8))\n", + " d.append(\n", + " draw.Line(\n", + " x0 + dx, y0 + dy, x1 + dx, y1 + dy, stroke=edge_color, stroke_width=edge_width\n", + " )\n", + " )\n", "\n", " # Add vertices\n", " for x, y, z in ((gcube_major @ R) * scale).tolist():\n", " x = -x\n", " d.append(\n", " draw.Circle(\n", - " x + dx, y + dy, 16, fill=node_color, stroke=node_border_color, stroke_width=4\n", + " x + dx,\n", + " y + dy,\n", + " large_node_width,\n", + " fill=node_color,\n", + " stroke=node_border_color,\n", + " stroke_width=node_stroke_width if large_border else 0,\n", " )\n", " )\n", " for x, y, z in ((gcube_minor @ R) * scale).tolist():\n", " x = -x\n", " d.append(\n", " draw.Circle(\n", - " x + dx, y + dy, 8, fill=node_color, stroke=node_border_color, stroke_width=4\n", + " x + dx,\n", + " y + dy,\n", + " small_node_width,\n", + " fill=node_color,\n", + " stroke=node_border_color,\n", + " stroke_width=node_stroke_width,\n", " )\n", " )\n", "\n", @@ -624,291 +1078,29 @@ ] }, { - "cell_type": "markdown", - "id": "b187c131-d337-4a7b-ab54-80ebe0f48ab4", + "cell_type": "code", + "execution_count": 11, + "id": "4325e0b8-dbbb-4219-a2b3-4d9cdee2bdc8", "metadata": {}, + "outputs": [], "source": [ - "### Background-agnostic (works with light and dark mode)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "acca9b2e-2f54-4b86-9a33-2c57502f6160", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "create_logo(bracket_color=medium_gray, bg_color=\"white\")" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "f5d0086d-b50e-49eb-9aae-b0953cdc0045", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Variant 0\n", - "create_logo(bracket_color=medium_gray, bg_color=\"black\")" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "20f2d568-1f85-4a16-adca-953e0dcda861", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Variant 1\n", - "create_logo(bracket_color=medium_gray, bg_color=\"black\", edge_border_width=0)" - ] - }, - { - "cell_type": "markdown", - "id": "c4dce89d-e34c-4190-a068-7e78cdeea745", - "metadata": {}, - "source": [ - "### For light mode" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "27137343-141a-422e-abd6-123af3416ea4", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "create_logo(bracket_color=dark_gray, bg_color=\"white\")" - ] - }, - { - "cell_type": "markdown", - "id": "8a70b0f7-c3c4-44ae-af09-8992400f362e", - "metadata": {}, - "source": [ - "### For dark mode" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "3ab9bb40-d7a8-4788-9971-54a5779d284d", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Variant 0\n", - "create_logo(bracket_color=light_gray, bg_color=\"black\")" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "2a161fe5-e9d5-4a29-b4cc-20c7aea027a7", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Variant 1\n", - "create_logo(bracket_color=light_gray, bg_color=\"black\", edge_border_width=0)" + "logo_defaults = dict(\n", + " bracket_color=blue,\n", + " edge_color=blue,\n", + " node_color=orange,\n", + " edge_border_width=0,\n", + " edge_width=11,\n", + " small_node_width=11,\n", + " large_node_width=17,\n", + " node_border_color=\"none\",\n", + " node_stroke_width=0,\n", + ")" ] }, { "cell_type": "code", "execution_count": 12, - "id": "8316a01d-5908-4f16-84ce-9e929ca34685", + "id": "f886df89-b3b5-4671-bcc0-98e8705feb5a", "metadata": {}, "outputs": [ { @@ -919,22 +1111,22 @@ " width=\"190\" height=\"190\" viewBox=\"-95.0 -95.0 190 190\">\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 12, @@ -943,20 +1135,13 @@ } ], "source": [ - "# Variant 2\n", - "create_logo(\n", - " bracket_color=light_gray,\n", - " bg_color=\"black\",\n", - " edge_border_width=0,\n", - " node_color=light_blue,\n", - " edge_color=light_orange,\n", - ")" + "create_logo(bg_color=\"white\", **logo_defaults)" ] }, { "cell_type": "code", "execution_count": 13, - "id": "174bb288-15ab-4643-862c-3a05f8d38538", + "id": "68e01137-55e3-4973-bf97-4fcd36c8c662", "metadata": {}, "outputs": [ { @@ -968,23 +1153,21 @@ "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 13, @@ -993,19 +1176,13 @@ } ], "source": [ - "# Variant 3\n", - "create_logo(\n", - " bracket_color=light_gray,\n", - " bg_color=\"black\",\n", - " edge_border_color=light_orange,\n", - " node_border_color=light_blue,\n", - ")" + "create_logo(bg_color=\"black\", **logo_defaults)" ] }, { "cell_type": "code", "execution_count": 14, - "id": "917363b5-f40d-4cc5-813b-446d1e9e7bca", + "id": "b1d5e928-16c5-4377-aee1-1489ab45efc8", "metadata": {}, "outputs": [ { @@ -1016,24 +1193,21 @@ " width=\"190\" height=\"190\" viewBox=\"-95.0 -95.0 190 190\">\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 14, @@ -1042,314 +1216,24 @@ } ], "source": [ - "# Variant 3 for light mode\n", - "create_logo(\n", - " bracket_color=dark_gray,\n", - " bg_color=\"white\",\n", - " edge_border_color=light_orange,\n", - " node_border_color=light_blue,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "f44f2e90-5f55-481f-a7db-fda630a1ad20", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Variant 4\n", - "create_logo(\n", - " bracket_color=light_gray,\n", - " bg_color=\"black\",\n", - " edge_color=light_orange,\n", - " edge_border_color=\"black\",\n", - " node_color=light_blue,\n", - " node_border_color=\"black\",\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "65566321-1438-4ff2-a2be-aab94830607d", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Variant 5 (dark)\n", - "create_logo(\n", - " bracket_color=light_gray,\n", - " bg_color=\"black\",\n", - " edge_border_color=eggplant,\n", - " node_color=light_blue,\n", - " node_border_color=eggplant,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "bf672773-ecdd-43c2-90ed-0b8b919528cd", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Variant 5 (light)\n", - "create_logo(\n", - " bracket_color=dark_gray,\n", - " bg_color=\"white\",\n", - " edge_border_color=eggplant,\n", - " node_color=light_blue,\n", - " node_border_color=eggplant,\n", - ")" + "# Transparent background\n", + "logo = create_logo(**logo_defaults)\n", + "logo" ] }, { - "cell_type": "code", - "execution_count": 18, - "id": "175d64aa-40c9-4734-9966-2b3928d96df6", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Variant 5 (light & dark)\n", - "create_logo(\n", - " bracket_color=medium_gray,\n", - " bg_color=\"black\",\n", - " edge_border_color=eggplant,\n", - " node_color=light_blue,\n", - " node_border_color=eggplant,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "7aa17514-8ae4-42df-a841-582c0ff7cba6", + "cell_type": "markdown", + "id": "b187c131-d337-4a7b-ab54-80ebe0f48ab4", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], "source": [ - "# Variant 5 (light & dark)\n", - "create_logo(\n", - " bracket_color=medium_gray,\n", - " bg_color=\"white\",\n", - " edge_border_color=eggplant,\n", - " node_color=light_blue,\n", - " node_border_color=eggplant,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "id": "ae39a9e1-dc41-411c-b111-09b78fac3f94", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Misc 0\n", - "create_logo(\n", - " bracket_color=medium_gray, bg_color=\"white\", edge_border_width=0, node_border_color=light_blue\n", - ")" + "## Alternatives with gray brackets\n", + "### Background-agnostic (works with light and dark mode)" ] }, { "cell_type": "code", - "execution_count": 21, - "id": "490f2ea1-43fe-4310-bdd2-d4e931a70545", + "execution_count": 15, + "id": "acca9b2e-2f54-4b86-9a33-2c57502f6160", "metadata": {}, "outputs": [ { @@ -1361,39 +1245,37 @@ "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", "" ], "text/plain": [ - "" + "" ] }, - "execution_count": 21, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "# Misc 1 (light & dark)\n", - "create_logo(\n", - " bracket_color=medium_gray, bg_color=\"white\", edge_border_width=0, node_border_color=light_gray\n", - ")" + "medium_logo = create_logo(**{**logo_defaults, \"bracket_color\": medium_gray})\n", + "create_logo(bg_color=\"white\", **{**logo_defaults, \"bracket_color\": medium_gray})" ] }, { "cell_type": "code", - "execution_count": 22, - "id": "bbbc309a-40d5-40f2-a637-044f650a5761", + "execution_count": 16, + "id": "f5d0086d-b50e-49eb-9aae-b0953cdc0045", "metadata": {}, "outputs": [ { @@ -1405,139 +1287,44 @@ "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", "" ], "text/plain": [ - "" + "" ] }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Misc 1 (light & dark)\n", - "create_logo(\n", - " bracket_color=medium_gray, bg_color=\"black\", edge_border_width=0, node_border_color=light_gray\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "id": "07858758-7de0-40ce-ba79-860f9b24461d", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 23, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "# Misc 2 (light)\n", - "create_logo(\n", - " bracket_color=dark_gray,\n", - " bg_color=\"white\",\n", - " edge_border_color=dark_gray,\n", - " edge_color=light_orange,\n", - " node_border_color=dark_gray,\n", - " node_color=light_blue,\n", - ")" + "create_logo(bg_color=\"black\", **{**logo_defaults, \"bracket_color\": medium_gray})" ] }, { - "cell_type": "code", - "execution_count": 24, - "id": "78b64fa7-eab4-4a17-beea-f7e771dec9aa", + "cell_type": "markdown", + "id": "c4dce89d-e34c-4190-a068-7e78cdeea745", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], "source": [ - "# Misc 3 (dark)\n", - "create_logo(\n", - " bracket_color=light_gray,\n", - " bg_color=\"black\",\n", - " edge_border_color=light_gray,\n", - " node_border_color=light_gray,\n", - ")" + "### For light mode" ] }, { "cell_type": "code", - "execution_count": 25, - "id": "f8f96ab4-ea12-489e-9680-0d1a2ebc56df", + "execution_count": 17, + "id": "27137343-141a-422e-abd6-123af3416ea4", "metadata": {}, "outputs": [ { @@ -1549,83 +1336,45 @@ "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", "" ], "text/plain": [ - "" + "" ] }, - "execution_count": 25, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "# Misc 4 (light & dark)\n", - "create_logo(bracket_color=medium_gray, bg_color=\"white\", edge_color=blue, node_color=orange)" + "light_logo = create_logo(**{**logo_defaults, \"bracket_color\": dark_gray})\n", + "create_logo(bg_color=\"white\", **{**logo_defaults, \"bracket_color\": dark_gray})" ] }, { - "cell_type": "code", - "execution_count": 26, - "id": "b304e83d-e258-49b2-b262-1bcdde4185b6", + "cell_type": "markdown", + "id": "8a70b0f7-c3c4-44ae-af09-8992400f362e", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" - } - ], "source": [ - "# Misc 4 (light & dark)\n", - "create_logo(bracket_color=medium_gray, bg_color=\"black\", edge_color=blue, node_color=orange)" + "### For dark mode" ] }, { "cell_type": "code", - "execution_count": 27, - "id": "2bb14d0a-2838-418f-9190-15fcb90a7748", + "execution_count": 18, + "id": "3ab9bb40-d7a8-4788-9971-54a5779d284d", "metadata": {}, "outputs": [ { @@ -1637,55 +1386,51 @@ "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "[\n", - "]\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "[\n", + "]\n", "" ], "text/plain": [ - "" + "" ] }, - "execution_count": 27, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "# Misc 5 (dark)\n", - "create_logo(\n", - " bracket_color=light_gray,\n", - " bg_color=\"black\",\n", - " edge_color=light_blue,\n", - " node_color=orange,\n", - " edge_border_width=0,\n", - ")" + "dark_logo = create_logo(**{**logo_defaults, \"bracket_color\": light_gray})\n", + "create_logo(bg_color=\"black\", **{**logo_defaults, \"bracket_color\": light_gray})" ] }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 19, "id": "d53046c1-8cbb-47fa-a88b-4d98958df26b", "metadata": {}, "outputs": [], "source": [ "if False:\n", - " # Don't set the background so it will be transparent\n", - " create_logo(bracket_color=medium_gray).save_svg(\"logo-medium.svg\")\n", - " create_logo(bracket_color=dark_gray).save_svg(\"logo-light.svg\")\n", - " create_logo(bracket_color=light_gray).save_svg(\"logo-dark.svg\")\n", - " d_color_palette.save_svg(\"color-palette.svg\")\n", - " d_color_wheel.save_svg(\"color-wheel.svg\")\n", - " d_color_palette.save_png(\"color-palette.png\")\n", - " d_color_wheel.save_png(\"color-wheel.png\")" + " logo.save_svg(\"python-graphblas-logo.svg\")\n", + " light_logo.save_svg(\"python-graphblas-logo-light.svg\")\n", + " medium_logo.save_svg(\"python-graphblas-logo-medium.svg\")\n", + " dark_logo.save_svg(\"python-graphblas-logo-dark.svg\")\n", + " color_palette.save_svg(\"color-palette.svg\")\n", + " standard_wheel.save_svg(\"color-wheel.svg\")\n", + " high_wheel.save_svg(\"color-wheel-high.svg\")\n", + " low_wheel.save_svg(\"color-wheel-low.svg\")\n", + " warm_wheel.save_svg(\"color-wheel-warm.svg\")\n", + " cool_wheel.save_svg(\"color-wheel-cool.svg\")" ] }, { @@ -1693,7 +1438,8 @@ "id": "51093fab-600b-47d7-9809-fa0f16e7246f", "metadata": {}, "source": [ - "### *NOTE: The font in the SVG files should be converted to paths, because not all systems have Courier New*" + "### *NOTE: The font in the SVG files should be converted to paths, because not all systems have Courier New*\n", + "Also, SVG files can be minified here: https://vecta.io/nano" ] } ], From e3609e751cf9a720b9cc859fc0c7f77f4f74ffb9 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 3 Oct 2023 17:06:36 -0500 Subject: [PATCH 04/11] Add docs/_static/img/python-graphblas-logo.svg --- docs/_static/img/python-graphblas-logo.svg | 1 + 1 file changed, 1 insertion(+) create mode 100755 docs/_static/img/python-graphblas-logo.svg diff --git a/docs/_static/img/python-graphblas-logo.svg b/docs/_static/img/python-graphblas-logo.svg new file mode 100755 index 000000000..a4007fdb8 --- /dev/null +++ b/docs/_static/img/python-graphblas-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file From 414a85faadc2c4e8fd86a7c0b67e76e732acd0ea Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 3 Oct 2023 17:59:34 -0500 Subject: [PATCH 05/11] maybe fix tests --- .github/workflows/test_and_build.yml | 2 + notebooks/logos_and_colors.ipynb | 330 +++++++++++++-------------- 2 files changed, 167 insertions(+), 165 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index e353862f8..f43cb7c84 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -210,6 +210,8 @@ jobs: numbaver="" if [[ ${spver} == "=1.8" ]] ; then spver=$(python -c 'import random ; print(random.choice(["=1.9", "=1.10", "=1.11", ""]))') + elif [[ ${spver} == "=1.9" && ${npver} == "=1.26" ]] ; then + spver=$(python -c 'import random ; print(random.choice(["=1.10", "=1.11", ""]))') fi elif [[ ${npver} == "=1.24" || ${{ startsWith(steps.pyver.outputs.selected, '3.11') }} == true ]] ; then numbaver=$(python -c 'import random ; print(random.choice(["=0.57", ""]))') diff --git a/notebooks/logos_and_colors.ipynb b/notebooks/logos_and_colors.ipynb index 344f86c74..3d4ade5e2 100644 --- a/notebooks/logos_and_colors.ipynb +++ b/notebooks/logos_and_colors.ipynb @@ -22,7 +22,7 @@ "source": [ "import drawsvg as draw\n", "import numpy as np\n", - "import scipy as sp" + "from scipy.spatial.transform import Rotation" ] }, { @@ -107,7 +107,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 3, @@ -385,75 +385,75 @@ "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -489,75 +489,75 @@ "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 6, @@ -593,75 +593,75 @@ "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 7, @@ -697,75 +697,75 @@ "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 8, @@ -801,75 +801,75 @@ "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 9, @@ -912,7 +912,7 @@ " 30, # How much of the \"left face\" to see\n", " 22.5, # How much of the \"top face\" to see\n", "]\n", - "R = sp.spatial.transform.Rotation.from_euler(\"ZYX\", default_angles, degrees=True).as_matrix()\n", + "R = Rotation.from_euler(\"ZYX\", default_angles, degrees=True).as_matrix()\n", "\n", "gcube = np.array(\n", " [\n", @@ -1126,7 +1126,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 12, @@ -1167,7 +1167,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 13, @@ -1207,7 +1207,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 14, @@ -1259,7 +1259,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 15, @@ -1301,7 +1301,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 16, @@ -1350,7 +1350,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 17, @@ -1400,7 +1400,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 18, From 223b24f7bf3be69f8e89626d5b9c0ef11ffaf8a3 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 3 Oct 2023 18:06:58 -0500 Subject: [PATCH 06/11] bump --- .pre-commit-config.yaml | 6 +++--- scripts/check_versions.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bff5b80cd..565e1dc0d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,7 @@ repos: - id: isort # Let's keep `pyupgrade` even though `ruff --fix` probably does most of it - repo: https://github.com/asottile/pyupgrade - rev: v3.13.0 + rev: v3.14.0 hooks: - id: pyupgrade args: [--py39-plus] @@ -80,14 +80,14 @@ repos: # These versions need updated manually - flake8==6.1.0 - flake8-bugbear==23.9.16 - - flake8-simplify==0.20.0 + - flake8-simplify==0.21.0 - repo: https://github.com/asottile/yesqa rev: v1.5.0 hooks: - id: yesqa additional_dependencies: *flake8_dependencies - repo: https://github.com/codespell-project/codespell - rev: v2.2.5 + rev: v2.2.6 hooks: - id: codespell types_or: [python, rst, markdown] diff --git a/scripts/check_versions.sh b/scripts/check_versions.sh index a76fee1d2..9051ebe6e 100755 --- a/scripts/check_versions.sh +++ b/scripts/check_versions.sh @@ -4,12 +4,12 @@ # This may be helpful when updating dependency versions in CI. # Tip: add `--json` for more information. conda search 'flake8-bugbear[channel=conda-forge]>=23.9.16' -conda search 'flake8-simplify[channel=conda-forge]>=0.20.0' +conda search 'flake8-simplify[channel=conda-forge]>=0.21.0' conda search 'numpy[channel=conda-forge]>=1.26.0' conda search 'pandas[channel=conda-forge]>=2.1.1' -conda search 'scipy[channel=conda-forge]>=1.11.2' +conda search 'scipy[channel=conda-forge]>=1.11.3' conda search 'networkx[channel=conda-forge]>=3.1' -conda search 'awkward[channel=conda-forge]>=2.4.3' +conda search 'awkward[channel=conda-forge]>=2.4.4' conda search 'sparse[channel=conda-forge]>=0.14.0' conda search 'fast_matrix_market[channel=conda-forge]>=1.7.3' conda search 'numba[channel=conda-forge]>=0.57.1' From 7fca22e04706e43042ca8e5ad496a4126a6e194d Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 3 Oct 2023 18:21:52 -0500 Subject: [PATCH 07/11] Bump edge_width --- docs/_static/img/python-graphblas-logo.svg | 2 +- notebooks/logos_and_colors.ipynb | 356 ++++++++++----------- 2 files changed, 179 insertions(+), 179 deletions(-) diff --git a/docs/_static/img/python-graphblas-logo.svg b/docs/_static/img/python-graphblas-logo.svg index a4007fdb8..2422973ff 100755 --- a/docs/_static/img/python-graphblas-logo.svg +++ b/docs/_static/img/python-graphblas-logo.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/notebooks/logos_and_colors.ipynb b/notebooks/logos_and_colors.ipynb index 3d4ade5e2..7b64a2208 100644 --- a/notebooks/logos_and_colors.ipynb +++ b/notebooks/logos_and_colors.ipynb @@ -107,7 +107,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 3, @@ -385,75 +385,75 @@ "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -489,75 +489,75 @@ "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 6, @@ -593,75 +593,75 @@ "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 7, @@ -697,75 +697,75 @@ "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 8, @@ -801,75 +801,75 @@ "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 9, @@ -1089,7 +1089,7 @@ " edge_color=blue,\n", " node_color=orange,\n", " edge_border_width=0,\n", - " edge_width=11,\n", + " edge_width=12,\n", " small_node_width=11,\n", " large_node_width=17,\n", " node_border_color=\"none\",\n", @@ -1112,8 +1112,8 @@ "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", @@ -1126,7 +1126,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 12, @@ -1153,8 +1153,8 @@ "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", @@ -1167,7 +1167,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 13, @@ -1193,8 +1193,8 @@ " width=\"190\" height=\"190\" viewBox=\"-95.0 -95.0 190 190\">\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", @@ -1207,7 +1207,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 14, @@ -1245,8 +1245,8 @@ "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", @@ -1259,7 +1259,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 15, @@ -1287,8 +1287,8 @@ "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", @@ -1301,7 +1301,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 16, @@ -1336,8 +1336,8 @@ "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", @@ -1350,7 +1350,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 17, @@ -1386,8 +1386,8 @@ "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", @@ -1400,7 +1400,7 @@ "" ], "text/plain": [ - "" + "" ] }, "execution_count": 18, From de8829a82379d54011d99075ed3d1153fed29c44 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 3 Oct 2023 18:40:13 -0500 Subject: [PATCH 08/11] Fix? --- .github/workflows/test_and_build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index f43cb7c84..e3930a853 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -206,12 +206,15 @@ jobs: else psgver="" fi - if [[ ${npver} == "=1.25" || ${npver} == "=1.26" ]] ; then + if [[ ${npver} == "=1.26" ]] ; then + numbaver="" + if [[ ${spver} == "=1.8" || ${spver} == "=1.9" ]] ; then + spver=$(python -c 'import random ; print(random.choice(["=1.10", "=1.11", ""]))') + fi + elif [[ ${npver} == "=1.25" ]] ; then numbaver="" if [[ ${spver} == "=1.8" ]] ; then spver=$(python -c 'import random ; print(random.choice(["=1.9", "=1.10", "=1.11", ""]))') - elif [[ ${spver} == "=1.9" && ${npver} == "=1.26" ]] ; then - spver=$(python -c 'import random ; print(random.choice(["=1.10", "=1.11", ""]))') fi elif [[ ${npver} == "=1.24" || ${{ startsWith(steps.pyver.outputs.selected, '3.11') }} == true ]] ; then numbaver=$(python -c 'import random ; print(random.choice(["=0.57", ""]))') From 0dd9942e32ee124284833049fc88aea95d469cfb Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sat, 7 Oct 2023 11:33:09 -0500 Subject: [PATCH 09/11] update text logos --- binder/environment.yml | 3 +-- docs/_static/img/logo-name-light.svg | 2 +- docs/_static/img/logo-name-medium-big.svg | 1 + docs/_static/img/logo-name-medium.svg | 2 +- docs/_static/img/python-graphblas-logo.svg | 0 docs/_static/img/task-graph.svg | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 docs/_static/img/logo-name-medium-big.svg mode change 100755 => 100644 docs/_static/img/python-graphblas-logo.svg diff --git a/binder/environment.yml b/binder/environment.yml index a37cc70da..11cd98e0c 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -1,9 +1,8 @@ name: graphblas channels: - conda-forge - - nodefaults dependencies: - - python=3.10 + - python=3.11 - python-graphblas - matplotlib - networkx diff --git a/docs/_static/img/logo-name-light.svg b/docs/_static/img/logo-name-light.svg index e9d9738ee..3331ae561 100644 --- a/docs/_static/img/logo-name-light.svg +++ b/docs/_static/img/logo-name-light.svg @@ -1 +1 @@ - + diff --git a/docs/_static/img/logo-name-medium-big.svg b/docs/_static/img/logo-name-medium-big.svg new file mode 100644 index 000000000..7bb245898 --- /dev/null +++ b/docs/_static/img/logo-name-medium-big.svg @@ -0,0 +1 @@ + diff --git a/docs/_static/img/logo-name-medium.svg b/docs/_static/img/logo-name-medium.svg index 2c718ba26..3128fda35 100644 --- a/docs/_static/img/logo-name-medium.svg +++ b/docs/_static/img/logo-name-medium.svg @@ -1 +1 @@ - + diff --git a/docs/_static/img/python-graphblas-logo.svg b/docs/_static/img/python-graphblas-logo.svg old mode 100755 new mode 100644 diff --git a/docs/_static/img/task-graph.svg b/docs/_static/img/task-graph.svg index f48284d93..d8d772a58 100644 --- a/docs/_static/img/task-graph.svg +++ b/docs/_static/img/task-graph.svg @@ -1 +1 @@ -StartLoad File 1Load File 2Load File 3MergeCleanNormalizeWeekly SummaryDaily SummarySerializeReport 1Report 2DashboardReport 3 +StartLoad File 1Load File 2Load File 3MergeCleanNormalizeWeekly SummaryDaily SummarySerializeReport 1Report 2DashboardReport 3 From 2de08ba9228023589555d046734e330adeb7dffb Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sat, 7 Oct 2023 15:55:37 -0500 Subject: [PATCH 10/11] Add horizontal and vertical logos (w/ img and text) and update usage --- README.md | 2 +- docs/_static/img/logo-horizontal-dark.svg | 1 + docs/_static/img/logo-horizontal-light.svg | 1 + docs/_static/img/logo-horizontal-medium-big.svg | 1 + docs/_static/img/logo-horizontal-medium.svg | 1 + docs/_static/img/logo-vertical-dark.svg | 1 + docs/_static/img/logo-vertical-light.svg | 1 + docs/_static/img/logo-vertical-medium.svg | 1 + docs/conf.py | 6 ++++-- 9 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 docs/_static/img/logo-horizontal-dark.svg create mode 100644 docs/_static/img/logo-horizontal-light.svg create mode 100644 docs/_static/img/logo-horizontal-medium-big.svg create mode 100644 docs/_static/img/logo-horizontal-medium.svg create mode 100644 docs/_static/img/logo-vertical-dark.svg create mode 100644 docs/_static/img/logo-vertical-light.svg create mode 100644 docs/_static/img/logo-vertical-medium.svg diff --git a/README.md b/README.md index 4581ef54a..4509e44ac 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Python-graphblas](https://raw.githubusercontent.com/python-graphblas/python-graphblas/main/docs/_static/img/logo-name-medium.svg) +![Python-graphblas](https://raw.githubusercontent.com/python-graphblas/python-graphblas/main/docs/_static/img/logo-horizontal-medium-big.svg) [![conda-forge](https://img.shields.io/conda/vn/conda-forge/python-graphblas.svg)](https://anaconda.org/conda-forge/python-graphblas) [![pypi](https://img.shields.io/pypi/v/python-graphblas.svg)](https://pypi.python.org/pypi/python-graphblas/) diff --git a/docs/_static/img/logo-horizontal-dark.svg b/docs/_static/img/logo-horizontal-dark.svg new file mode 100644 index 000000000..be9e5ccca --- /dev/null +++ b/docs/_static/img/logo-horizontal-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/_static/img/logo-horizontal-light.svg b/docs/_static/img/logo-horizontal-light.svg new file mode 100644 index 000000000..5894eed9a --- /dev/null +++ b/docs/_static/img/logo-horizontal-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/_static/img/logo-horizontal-medium-big.svg b/docs/_static/img/logo-horizontal-medium-big.svg new file mode 100644 index 000000000..649c2aef3 --- /dev/null +++ b/docs/_static/img/logo-horizontal-medium-big.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/_static/img/logo-horizontal-medium.svg b/docs/_static/img/logo-horizontal-medium.svg new file mode 100644 index 000000000..038781a3f --- /dev/null +++ b/docs/_static/img/logo-horizontal-medium.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/_static/img/logo-vertical-dark.svg b/docs/_static/img/logo-vertical-dark.svg new file mode 100644 index 000000000..25dcefc17 --- /dev/null +++ b/docs/_static/img/logo-vertical-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/_static/img/logo-vertical-light.svg b/docs/_static/img/logo-vertical-light.svg new file mode 100644 index 000000000..1cb22644d --- /dev/null +++ b/docs/_static/img/logo-vertical-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/_static/img/logo-vertical-medium.svg b/docs/_static/img/logo-vertical-medium.svg new file mode 100644 index 000000000..db2fcaefe --- /dev/null +++ b/docs/_static/img/logo-vertical-medium.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 2e6f616d8..283f6d047 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,14 +55,16 @@ # html_theme = "pydata_sphinx_theme" +html_favicon = "_static/img/python-graphblas-logo.svg" + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] html_theme_options = { "logo": { - "image_light": "_static/img/logo-name-light.svg", - "image_dark": "_static/img/logo-name-dark.svg", + "image_light": "_static/img/logo-horizontal-light.svg", + "image_dark": "_static/img/logo-horizontal-dark.svg", }, "github_url": "https://github.com/python-graphblas/python-graphblas", } From 057845234bf27dfaacbd6b0080a8f80bddcd65cf Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sat, 7 Oct 2023 16:07:42 -0500 Subject: [PATCH 11/11] Undo change to task-graph.svg --- docs/_static/img/task-graph.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_static/img/task-graph.svg b/docs/_static/img/task-graph.svg index d8d772a58..f48284d93 100644 --- a/docs/_static/img/task-graph.svg +++ b/docs/_static/img/task-graph.svg @@ -1 +1 @@ -StartLoad File 1Load File 2Load File 3MergeCleanNormalizeWeekly SummaryDaily SummarySerializeReport 1Report 2DashboardReport 3 +StartLoad File 1Load File 2Load File 3MergeCleanNormalizeWeekly SummaryDaily SummarySerializeReport 1Report 2DashboardReport 3