Commit 272c17ed authored by Felix's avatar Felix
Browse files

fix bugs and rebuild wheel

parent d1e95fb9
......@@ -3,7 +3,7 @@
# @Email: kramer@mpi-cbg.de
# @Project: go-with-the-flow
# @Last modified by: Felix Kramer
# @Last modified time: 2021-05-23T23:17:43+02:00
# @Last modified time: 2021-05-23T23:55:51+02:00
# @License: MIT
import networkx as nx
......@@ -11,11 +11,10 @@ import numpy as np
import scipy.linalg as lina
import sys
from kirchhoff.kirchhoff_init import *
from kirchhoff.kirchhoff_flow import *
from kirchhoff.kirchhoff_flux import *
import kirchhoff.init_dual
from kirchhoff.circuit_init import *
from kirchhoff.circuit_flow import *
from kirchhoff.circuit_flux import *
import kirchhoff.init_dual as init_dual
def initialize_dual_circuit_from_networkx(input_graph1,input_graph2,e_adj):
......
......@@ -3,7 +3,7 @@
# @Email: kramer@mpi-cbg.de
# @Project: go-with-the-flow
# @Last modified by: Felix Kramer
# @Last modified time: 2021-05-23T23:17:20+02:00
# @Last modified time: 2021-05-23T23:56:10+02:00
# @License: MIT
import random as rd
......@@ -11,12 +11,12 @@ import networkx as nx
import numpy as np
import sys
import pandas as pd
# import kirchhoff_init
from kirchhoff.kirchhoff_init import *
from kirchhoff.circuit_init import *
# custom embeddings/architectures
import init_crystal
import init_random
import kirchhoff.init_crystal as init_crystal
import kirchhoff.init_random as init_random
def initialize_flow_circuit_from_networkx(input_graph):
......
......@@ -3,7 +3,7 @@
# @Email: kramer@mpi-cbg.de
# @Project: go-with-the-flow
# @Last modified by: Felix Kramer
# @Last modified time: 2021-05-23T23:17:02+02:00
# @Last modified time: 2021-05-23T23:55:42+02:00
# @License: MIT
import random as rd
......@@ -11,10 +11,10 @@ import networkx as nx
import numpy as np
import sys
import pandas as pd
# import kirchhoff_flow
from kirchhoff.kirchhoff_flow import *
import init_crystal
import init_random
from kirchhoff.circuit_flow import *
import kirchhoff.init_crystal as init_crystal
import kirchhoff.init_random as init_random
def initialize_flux_circuit_from_networkx(input_graph):
......
......@@ -3,13 +3,14 @@
# @Email: kramer@mpi-cbg.de
# @Project: go-with-the-flow
# @Last modified by: Felix Kramer
# @Last modified time: 2021-05-23T23:17:55+02:00
# @Last modified time: 2021-05-24T00:03:20+02:00
# @License: MIT
import networkx as nx
import numpy as np
import kirchhoff.init_crystal
from scipy.spatial import Voronoi
import kirchhoff.init_crystal as init_crystal
def init_dual_minsurf_graphs(dual_type,num_periods):
......
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import networkx as nx\n",
"import sys\n",
"import numpy as np\n",
"sys.path.insert(0,'../goflow')\n",
"import kirchhoff_init as ki\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"circuit(): initialized and ready for (some) action :)\n"
]
}
],
"source": [
"n=3\n",
"G=nx.grid_graph(( n,n,1))\n",
"K = ki.initialize_circuit_from_networkx(G)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"circuit(): initialized and ready for (some) action :)\n"
]
}
],
"source": [
"import kirchhoff_flow as kf\n",
"n=3\n",
"G=nx.grid_graph(( n,n,1))\n",
"K= kf.initialize_flow_circuit_from_networkx(G)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"set_source_landscape(): root_multi is set and consistent :)\n"
]
}
],
"source": [
"K.graph['num_sources']=4\n",
"K.set_source_landscape('root_multi',num_sources=2)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 -1.0\n",
"1 -1.0\n",
"2 3.5\n",
"3 -1.0\n",
"4 -1.0\n",
"5 3.5\n",
"6 -1.0\n",
"7 -1.0\n",
"8 -1.0\n",
"Name: source, dtype: float64\n"
]
},
{
"data": {
"text/plain": [
"<AxesSubplot:xlabel='source', ylabel='source'>"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEGCAYAAABsLkJ6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAN70lEQVR4nO3dfaxcdZ3H8c+HtjxkrSHYEVkoXlgIgQUp9goUogmlxtL9oyi7ArtCYkyqZomYuJtoZI0YH2JiiA9BaROJEInGB4pE2IWKV1gMAnOxQOsV2yDaSgPXaKUIUVu+/jGn9t5ypWd658xv7nzfr2TCPXNv53w7ofO+55yZcxwRAgDkc0jpAQAAZRAAAEiKAABAUgQAAJIiAACQ1PzSA3Rj0aJFMTIyUnoMAJhTxsfHfxsRrf3vn1MBGBkZUbvdLj0GAMwptn810/3sAgKApAgAACRFAAAgKQIAAEkRAABIigAAwIDb+swufae9TVuf2dXTx51TbwMFgGw+dtvjuvknv/7b8pXLjtcnVp/Rk8dmCwAABtTWZ3ZNe/GXpJsf+HXPtgQIAAAMqI3bdnZ1f7cIAAAMqCWLj+zq/m4RAAAYUCcdvVBXLjt+2n1XLjteJx29sCePz0FgABhgn1h9hq48d0Qbt+3UksVH9uzFXyIAADDwTjp6YU9f+PdiFxAAJEUAACApAgAASREAAEiKAABAUgQAAJIiAACQFAEAgKQIAAAkRQAAICkCAABJEQAASIoAAEBSBAAAkioWANuH237I9qO2N9u+ttQsAJBRyesB/EnS8oh43vYCSffb/t+I+EnBmQAgjWIBiIiQ9Hy1uKC6Ral5ACCboscAbM+zvVHSs5I2RMSDM/zMGttt2+3Jycm+zwgAw6poACJiT0QskXScpLNtnz7Dz6yLiNGIGG21Wn2fEQCG1UC8Cygidkr6kaSVZScBgDxKvguoZfvI6usjJK2Q9PNS8wBANiXfBXSMpJtsz1MnRN+KiO8XnAcAUin5LqDHJJ1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bYAAAD7EAAASIoAAEBSBAAAkiIAAJAUAQCApAgA0ADbQ/cpewwfAgBIsv0Ptu+ozv++yfalti+0/VPbj1fXDjis+tmnbC+qvh6tThMg2x+3vc723ZJutn207fXVYz5q+7zq595VnWt+o+211Wm6gb4jAEDHSklPR8SZEXG6pP9T53oBl0bEGeqcN+v9NR5nqaTVEfHvkr4o6d7qnPJvlLTZ9qmSLpV0fkQskbRH0n/0+i8D1EEAgI7HJa2w/Vnbb5Y0IumXEfGL6vs3SXpLjce5PSJerL5eLukrUufMkhHxB0kXqhOJh6tTDV8o6cSe/S2ALrCfEpAUEb+wvVTSKkmfkXT3K/z4bu375enw/b73xwOsypJuioiPHNSgQA+xBQBIsv2Pkl6IiK9L+pyk8ySN2D6p+pErJN1bff2UOr/FS9Ilr/Cw96jabVRdXOTV1X3/avu11f1H2X59L/8uQF0EAOg4Q9JD1W6Zj0q6RtK7JX3b9uOSXpJ0Q/Wz10r6gu3/V2cf/t9ztaQLqj8/LumfI+Jn1WPfXZ1pcoM6Z54E+o6zgQJAUmwBAEBSBAAAkiIAAJAUAQCApAgAACRFAAAgKQIAAEn9FTtsJZL6Xox7AAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"print(K.nodes['source'])\n",
"K.nodes.plot('source','source',kind='scatter')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{0: 8, 1: -1, 2: -1, 3: -1, 4: -1, 5: -1, 6: -1, 7: -1, 8: -1}\n",
"set networkx.spring_layout()\n",
"set_source_landscape(): root_geometric is set and consistent :)\n"
]
}
],
"source": [
"custom={}\n",
"for i,n in enumerate(K.G.nodes()):\n",
" if i==0:\n",
" custom.update({n:len(K.G.nodes())-1})\n",
" else:\n",
" custom.update({n:-1})\n",
"print(custom)\n",
"K.set_source_landscape('root_geometric')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"set_plexus_landscape(): root_geometric is set and consistent :)\n"
]
}
],
"source": [
"K.set_plexus_landscape()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"set_source_landscape(): default is set and consistent :)\n"
]
}
],
"source": [
"K.set_source_landscape()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
......@@ -8,13 +8,7 @@
"source": [
"import networkx as nx\n",
"import numpy as np\n",
"import sys\n",
"sys.path.insert(0,'../kirchhoff')\n",
"\n",
"import kirchhoff_init as ki\n",
"import kirchhoff_flow as kiw\n",
"import kirchhoff_flux as kix\n",
"import kirchhoff_dual as kid\n"
"import kirchhoff "
]
},
{
......@@ -31,6 +25,7 @@
}
],
"source": [
"import kirchhoff.circuit_init as ki\n",
"n=3\n",
"G=nx.grid_graph(( n,n,1))\n",
"K = ki.initialize_circuit_from_networkx(G)"
......@@ -45,13 +40,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"circuit(): initialized and ready for (some) action :)\n",
"circuit(): initialized and ready for (some) action :)\n",
"circuit(): initialized and ready for (some) action :)\n"
]
},
{
"data": {
"text/plain": [
"<kirchhoff_init.circuit at 0x16367462c48>"
"<kirchhoff.circuit_flow.flow_circuit at 0x1480007a0c8>"
]
},
"execution_count": 3,
......@@ -60,7 +57,10 @@
}
],
"source": [
"kiw.initialize_circuit_from_networkx(G)"
"import kirchhoff.circuit_flow as kfc\n",
"kfc.initialize_circuit_from_networkx(G)\n",
"kfc.initialize_flow_circuit_from_crystal('simple',3)\n",
"kfc.initialize_flow_circuit_from_random(random_type='voronoi_volume')"
]
},
{
......@@ -72,13 +72,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"circuit(): initialized and ready for (some) action :)\n",
"circuit(): initialized and ready for (some) action :)\n",
"circuit(): initialized and ready for (some) action :)\n"
]
},
{
"data": {
"text/plain": [
"<kirchhoff_init.circuit at 0x1636747bd48>"
"<kirchhoff.circuit_flow.flow_circuit at 0x14803149788>"
]
},
"execution_count": 4,
......@@ -87,67 +89,16 @@
}
],
"source": [
"kix.initialize_circuit_from_networkx(G)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"circuit(): initialized and ready for (some) action :)\n"
]
},
{
"data": {
"text/plain": [
"<kirchhoff_flow.flow_circuit at 0x1636748c088>"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"kiw.initialize_flow_circuit_from_crystal('chain',3)"
"import kirchhoff.circuit_flux as kfc\n",
"kfc.initialize_circuit_from_networkx(G)\n",
"kfc.initialize_flow_circuit_from_crystal('simple',3)\n",
"kfc.initialize_flow_circuit_from_random(random_type='voronoi_volume')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"circuit(): initialized and ready for (some) action :)\n"
]
},
{
"data": {
"text/plain": [
"<kirchhoff_flow.flow_circuit at 0x16367467288>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"kiw.initialize_flow_circuit_from_random(random_type='voronoi_volume')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
......@@ -160,16 +111,17 @@
{
"data": {
"text/plain": [
"<kirchhoff_dual.dual_circuit at 0x163674ffd48>"
"<kirchhoff.circuit_dual.dual_circuit at 0x148031ead08>"
]
},
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"kid.initialize_dual_flux_circuit_from_minsurf('laves',3)"
"import kirchhoff.circuit_dual as kid\n",
"kid.initialize_dual_flux_circuit_from_minsurf('simple',3)"
]
},
{
......
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAaCElEQVR4nO3df3Dcd33n8ecL2SkiDlHTEE0iu2fDGOVSQjAWMcVcK4fm5NBSu2kyTTAppMl5Mo0NPYqLddDSm3YatS4cpE1wPcEJHD3UAzzCJJ4oGRyFUkiwjZIIOwiMgcTrHCGAnMgIYov3/bGrZCWv5LWk7652P6/HjEe73+/nu5/3hw372u+P/XwVEZiZWbpeUu0CzMysuhwEZmaJcxCYmSXOQWBmljgHgZlZ4uZVu4DTde6558bixYunte2xY8c488wzZ7egOc5jToPHnIaZjHnfvn3PRMQrSq2ruSBYvHgxe/funda2fX19tLe3z25Bc5zHnAaPOQ0zGbOkH0y2zoeGzMwS5yAwM0ucg8DMLHEOAjOzxDkIzMwSl1kQSNou6WlJ35xkvSTdKumgpMckvT6rWi7/SB+LN9/DQO4oizffw+Uf6cuqq5N8sGeAV3XuYvHme3hV5y4+2DNQ0X4Hckcr2i9AT3+OlV27WbL5HlZ27aanP1fRfgdyRyvab3HfKY3ZKifr9znLPYK7gNVTrL8CWFr4tx74eBZFXP6RPr7z9LFxy77z9LGKhMEHewb49ENPMFqY4XU0gk8/9ETmH8rV6hfy/8F27hggNzRCALmhETp3DGT+AVXcLxXsd2LfqYzZKqcS73NmQRARXwZ+MkWTNcCnIu8hoEnS+bNdx8QQONXy2fSZh588re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ngW+NOidT+PiDdHRDewIyLeEBFj8/TfUNTufODNwO+R/8Umkq4gP7XvisI2/1DUfl5EXAr8GflfeZZyIdBBfurzDxU+pNuAPyQ/A+yVwEmHmErYBmyMiOXA+4DbI+Io8Cjw24U2bwN6C3PunNS+jD7MAB8astr1ZET8R+Hxp8nfrOQfC8//rajdayT9LdAELCA/zciYnoj4JXBAUnNh2e8Ad0bEzwAiong++LGJ+/YBiyep656I+AXwC0lPA83kw+YLETECIOmLUw2sMGPsm4DP5qfTAeBXisb2R8AD5OdUuv0U7c1OyUFgtWri3CjFz48VPb4LWBsRj0p6F/m5W8b8ouixiv5ONu/KWPtRJv//TvFrjrUrNQ36VF4CDEXE60qs2wncIukcYDmwGzhzivZmp+RDQ1arfl0v3pv3WuArk7Q7C3iqMCX3ujJe9z7gT4rOJZwz40rztb1N0ksL395/d6rGhftGfE/S1YUaJOmSwrph4Ovkb095d0SMTtXerBwOAqtVjwPvlPQYcA7w8Una/SX5O7PdD3zrVC8aEfeS/9a9tzBr64wvvYyIPYXXfJT84aW9wNFTbLYOuEHSo8B+xt9a9d+AdzD+ENhU7c2m5NlHzSpA0oKIGC7saXwZWD92T2mzavM5ArPK2CbpIuClwCcdAjaXeI/AzCxxPkdgZpY4B4GZWeIcBGZmiXMQmJklzkFgZpa4/w8VewwwMdqd6QAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import test as cat\n",
"import networkx as nx\n",
"import matplotlib.pyplot as plt\n",
"import cycle_analysis.cycle_tools_coalescence as ctc\n",
"import cycle_analysis.test as cat\n",
"\n",
"# generate a dummy graph for testing\n",
"# put an edge weight distribution on the system, available are random/gradient/bigradient/nested_square\n",
"n=7\n",
"G=nx.grid_graph(( n,n,1))\n",
"G=cat.generate_pattern(G,'random')\n",
"\n",
"weights=[G.edges[e]['weight'] for e in G.edges()]\n",
"pos=nx.get_node_attributes(G,'pos')\n",
"\n",
"# merge all shortest cycles and create merging tree, then calc asymmetry of the tree's branches\n",
"T=ctc.coalescence()\n",
"minimum_basis=T.construct_networkx_basis(G)\n",
"cycle_tree=T.calc_cycle_coalescence(G,minimum_basis)\n",
"dict_asymmetry=T.calc_tree_asymmetry()\n",
"\n",
"# plot branching asymmetry in dependence of branching level\n",
"x,y=[],[]\n",
"for n in dict_asymmetry:\n",
" x.append((cycle_tree.nodes[n]['pos'][1]-6)/2.)\n",
" y.append(dict_asymmetry[n])\n",
"plt.scatter(x,y)\n",
"plt.ylabel('asymmetry')\n",
"plt.xlabel('branching level')\n",
"plt.grid(True)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import networkx as nx\n",
"import numpy as np\n",
"import scipy.linalg as snl"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Name: \n",
"Type: Graph\n",
"Number of nodes: 4\n",
"Number of edges: 4\n",
"Average degree: 2.0000\n",
"32.0\n"
]
}
],
"source": [
"n=2\n",
"G=nx.grid_graph(dim=(n,n,1))\n",
"print(nx.info(G))\n",
"\n",
"p=4\n",
"adj=nx.adjacency_matrix(G).todense()\n",
"adj_p=np.linalg.matrix_power(adj,p)\n",
"evs=snl.eigvalsh(adj_p)\n",
"\n",
"print(np.sum(evs))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
......@@ -3,7 +3,7 @@
# @Email: kramer@mpi-cbg.de
# @Project: go-with-the-flow
# @Last modified by: Felix Kramer
# @Last modified time: 2021-05-23T23:29:24+02:00
# @Last modified time: 2021-05-24T00:03:32+02:00
# @License: MIT
......@@ -15,7 +15,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setuptools.setup(
name="kirchhoff", # Replace with your own username
version="0.0.1",
version="0.0.6",
author="felixk1990",
author_email="felixuwekramer@protonmail.com",
description="Collecton of routines for creation and manipulation of Kirchhoff circuits based on resistor-only networks, together with 2D/3D