adjustment of skewed edge weights

This commit is contained in:
Florian Förster 2024-07-03 18:01:33 +02:00
parent 2656780907
commit 55a9ef7f69
5 changed files with 853 additions and 134 deletions

205
pdm.lock generated
View File

@ -2,17 +2,17 @@
# It is not intended for manual editing.
[metadata]
groups = ["default", "notebooks", "trials", "trails"]
groups = ["default", "notebooks", "trials", "trails", "dev"]
strategy = ["cross_platform", "inherit_metadata"]
lock_version = "4.4.2"
content_hash = "sha256:36979d60d30dad28e15e0f93496b4ea25af7fc5a12b91e82c12e1b957325c0af"
content_hash = "sha256:5c4c7b58272b6a8845865dde1fc6c953611f3e9424823eea35682da5cb6e112c"
[[package]]
name = "alph"
version = "0.4.10"
requires_python = "<4.0,>=3.9"
summary = "alph"
groups = ["trails", "trials"]
groups = ["trials"]
dependencies = [
"altair>=5.0.1",
"networkx>=2.6.3",
@ -30,7 +30,7 @@ version = "0.4.10"
extras = ["graphviz"]
requires_python = "<4.0,>=3.9"
summary = "alph"
groups = ["trails", "trials"]
groups = ["trials"]
dependencies = [
"alph==0.4.10",
"pygraphviz>=1.10",
@ -45,7 +45,7 @@ name = "altair"
version = "5.3.0"
requires_python = ">=3.8"
summary = "Vega-Altair: A declarative statistical visualization library for Python."
groups = ["trails", "trials"]
groups = ["trials"]
dependencies = [
"jinja2",
"jsonschema>=3.0",
@ -188,7 +188,7 @@ name = "attrs"
version = "23.2.0"
requires_python = ">=3.7"
summary = "Classes Without Boilerplate"
groups = ["notebooks", "trails", "trials"]
groups = ["notebooks", "trials"]
files = [
{file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"},
{file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"},
@ -205,6 +205,17 @@ files = [
{file = "babel-2.15.0.tar.gz", hash = "sha256:8daf0e265d05768bc6c7a314cf1321e9a123afc328cc635c18622a2f30a04413"},
]
[[package]]
name = "backoff"
version = "2.2.1"
requires_python = ">=3.7,<4.0"
summary = "Function decoration for backoff and retry"
groups = ["trials"]
files = [
{file = "backoff-2.2.1-py3-none-any.whl", hash = "sha256:63579f9a0628e06278f7e47b7d7d5b6ce20dc65c5e96a6f3ca99a6adca0396e8"},
{file = "backoff-2.2.1.tar.gz", hash = "sha256:03f829f5bb1923180821643f8753b0502c3b682293992485b0eef2807afa5cba"},
]
[[package]]
name = "beautifulsoup4"
version = "4.12.3"
@ -283,7 +294,7 @@ name = "certifi"
version = "2024.2.2"
requires_python = ">=3.6"
summary = "Python package for providing Mozilla's CA Bundle."
groups = ["default", "notebooks"]
groups = ["default", "notebooks", "trials"]
files = [
{file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"},
{file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"},
@ -323,12 +334,23 @@ files = [
{file = "cffi-1.16.0.tar.gz", hash = "sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0"},
]
[[package]]
name = "chardet"
version = "5.2.0"
requires_python = ">=3.7"
summary = "Universal encoding detector for Python 3"
groups = ["trials"]
files = [
{file = "chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970"},
{file = "chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7"},
]
[[package]]
name = "charset-normalizer"
version = "3.3.2"
requires_python = ">=3.7.0"
summary = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
groups = ["default", "notebooks"]
groups = ["default", "notebooks", "trials"]
files = [
{file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"},
{file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"},
@ -401,6 +423,29 @@ files = [
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
[[package]]
name = "colorbrewer"
version = "0.2.0"
summary = "constants from Cynthia Brewer's ColorBrewer"
groups = ["trials"]
dependencies = [
"six",
]
files = [
{file = "colorbrewer-0.2.0-py3-none-any.whl", hash = "sha256:b0e6a7dd472174f6a7691db55a0ca79f4ab63780d6c62c3acff78b5920f3e249"},
{file = "colorbrewer-0.2.0.tar.gz", hash = "sha256:f124d0051086887b52d3643203a7722252b50204f8af93e6ae63fc0013f42456"},
]
[[package]]
name = "colour"
version = "0.1.5"
summary = "converts and manipulates various color representation (HSL, RVB, web, X11, ...)"
groups = ["trials"]
files = [
{file = "colour-0.1.5-py2.py3-none-any.whl", hash = "sha256:33f6db9d564fadc16e59921a56999b79571160ce09916303d35346dddc17978c"},
{file = "colour-0.1.5.tar.gz", hash = "sha256:af20120fefd2afede8b001fbef2ea9da70ad7d49fafdb6489025dae8745c3aee"},
]
[[package]]
name = "comm"
version = "0.2.2"
@ -449,6 +494,33 @@ files = [
{file = "cymem-2.0.8.tar.gz", hash = "sha256:8fb09d222e21dcf1c7e907dc85cf74501d4cea6c4ed4ac6c9e016f98fb59cbbf"},
]
[[package]]
name = "cython"
version = "3.0.10"
requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7"
summary = "The Cython compiler for writing C extensions in the Python language."
groups = ["dev"]
files = [
{file = "Cython-3.0.10-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:051069638abfb076900b0c2bcb6facf545655b3f429e80dd14365192074af5a4"},
{file = "Cython-3.0.10-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:712760879600907189c7d0d346851525545484e13cd8b787e94bfd293da8ccf0"},
{file = "Cython-3.0.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:38d40fa1324ac47c04483d151f5e092406a147eac88a18aec789cf01c089c3f2"},
{file = "Cython-3.0.10-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5bd49a3a9fdff65446a3e1c2bfc0ec85c6ce4c3cad27cd4ad7ba150a62b7fb59"},
{file = "Cython-3.0.10-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e8df79b596633b8295eaa48b1157d796775c2bb078f32267d32f3001b687f2fd"},
{file = "Cython-3.0.10-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bcc9795990e525c192bc5c0775e441d7d56d7a7d02210451e9e13c0448dba51b"},
{file = "Cython-3.0.10-cp311-cp311-win32.whl", hash = "sha256:09f2000041db482cad3bfce94e1fa3a4c82b0e57390a164c02566cbbda8c4f12"},
{file = "Cython-3.0.10-cp311-cp311-win_amd64.whl", hash = "sha256:3919a55ec9b6c7db6f68a004c21c05ed540c40dbe459ced5d801d5a1f326a053"},
{file = "Cython-3.0.10-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:8f2864ab5fcd27a346f0b50f901ebeb8f60b25a60a575ccfd982e7f3e9674914"},
{file = "Cython-3.0.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:407840c56385b9c085826fe300213e0e76ba15d1d47daf4b58569078ecb94446"},
{file = "Cython-3.0.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a036d00caa73550a3a976432ef21c1e3fa12637e1616aab32caded35331ae96"},
{file = "Cython-3.0.10-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9cc6a0e7e23a96dec3f3c9d39690d4281beabd5297855140d0d30855f950275e"},
{file = "Cython-3.0.10-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:a5e14a8c6a8157d2b0cdc2e8e3444905d20a0e78e19d2a097e89fb8b04b51f6b"},
{file = "Cython-3.0.10-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f8a2b8fa0fd8358bccb5f3304be563c4750aae175100463d212d5ea0ec74cbe0"},
{file = "Cython-3.0.10-cp312-cp312-win32.whl", hash = "sha256:2d29e617fd23cf4b83afe8f93f2966566c9f565918ad1e86a4502fe825cc0a79"},
{file = "Cython-3.0.10-cp312-cp312-win_amd64.whl", hash = "sha256:6c5af936940a38c300977b81598d9c0901158f220a58c177820e17e1774f1cf1"},
{file = "Cython-3.0.10-py2.py3-none-any.whl", hash = "sha256:fcbb679c0b43514d591577fd0d20021c55c240ca9ccafbdb82d3fb95e5edfee2"},
{file = "Cython-3.0.10.tar.gz", hash = "sha256:dcc96739331fb854dcf503f94607576cfe8488066c61ca50dfd55836f132de99"},
]
[[package]]
name = "dash"
version = "2.17.0"
@ -541,7 +613,7 @@ name = "decorator"
version = "5.1.1"
requires_python = ">=3.5"
summary = "Decorators for Humans"
groups = ["notebooks"]
groups = ["notebooks", "trials"]
files = [
{file = "decorator-5.1.1-py3-none-any.whl", hash = "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186"},
{file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"},
@ -699,12 +771,53 @@ name = "idna"
version = "3.7"
requires_python = ">=3.5"
summary = "Internationalized Domain Names in Applications (IDNA)"
groups = ["default", "notebooks"]
groups = ["default", "notebooks", "trials"]
files = [
{file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"},
{file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"},
]
[[package]]
name = "igraph"
version = "0.11.5"
requires_python = ">=3.8"
summary = "High performance graph data structures and algorithms"
groups = ["trials"]
dependencies = [
"texttable>=1.6.2",
]
files = [
{file = "igraph-0.11.5-cp39-abi3-macosx_10_9_x86_64.whl", hash = "sha256:164718e7dcf3096c2e73d26c4c98c5f963033af1148b1fa390ff916eb31dd31d"},
{file = "igraph-0.11.5-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:7ea75561e921e05635e67a98735aca240e4bbc8df5909eb3b8df196fca334c31"},
{file = "igraph-0.11.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9bcfd3c9308150d69644744c6bec1ff75a3dd7ea9b4fa6f9587664ef88d271a"},
{file = "igraph-0.11.5-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:845cb179a0876c6c23eb0869bb984f85cd8131f8131595e935e902020df1327e"},
{file = "igraph-0.11.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0eb2fd96b729ce2f6eb7a2e95ec1b522ca7359e10c5609a7e3b686777bab89f4"},
{file = "igraph-0.11.5-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:e6eac30df9294c3d9de73c1975358600b3230e408c2292a7a2e145e42faf12a8"},
{file = "igraph-0.11.5-cp39-abi3-musllinux_1_1_i686.whl", hash = "sha256:3c98990f785117b00ff077d96aa9080d6934a21fdd1c2c06d3f4945ac212a6ac"},
{file = "igraph-0.11.5-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ff3ba7a82a0a1b42bfcda6a379f3de78e0dabf84d0d582083ddecc52fdc81a40"},
{file = "igraph-0.11.5-cp39-abi3-win32.whl", hash = "sha256:db8e4942574c6b4b0afb8d219a9a8e38e75d3cc3bad68aa7f438e8604a7d4d8a"},
{file = "igraph-0.11.5-cp39-abi3-win_amd64.whl", hash = "sha256:034c1f8b50d58c911c2ff45cf299fb64255aa0ede6fa880a75d8d7493da743d8"},
{file = "igraph-0.11.5-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:e4970886a79c1641d082a31cc2bbc17de956929e091770af0c3a37971f44568f"},
{file = "igraph-0.11.5-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:213ee64c8dfe03ca2d9e6a0fa87f283decc44c79d94b75121acf97753bedc21e"},
{file = "igraph-0.11.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8850b29d63e218da70f8a05cb29af3166c2ccdda3b7a44902cf05a5f0d234ec8"},
{file = "igraph-0.11.5-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f68f020e4f83d6764952c48c7401316e33d0336607551711282b0177df0e9732"},
{file = "igraph-0.11.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa5239c3b4405eddb424ffcd3c21a4e7d3e8f170d2da54b6c8e2bd980f4c1130"},
{file = "igraph-0.11.5-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:59a66ff91a9d7e60b61fb842e1c1b987e258fb95d1d366b998d3e83948939a19"},
{file = "igraph-0.11.5-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:29698baa1ada3bdbb746b03e8cfedfa950c8ebf91a3ed466ec423aa5d03552fd"},
{file = "igraph-0.11.5-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:7da25d7966f5934de245370b67b7ed47bded36d32ab21a9bc78b710d07b48732"},
{file = "igraph-0.11.5-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e00ac0542f014ef966f19629112065f6366fda4cd164b6107f8245868ebb0667"},
{file = "igraph-0.11.5-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c51a9405b47f5b14ceabc4cf47ac2a440cead0a032fac6b22f2f171b09266ea8"},
{file = "igraph-0.11.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49aa55e8bac8eb41f712340154d37c96b3021131ba72769006aa5ce354a275f8"},
{file = "igraph-0.11.5-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:2ff0162bad7e9b88d3de3afffcb509413a1173359b10b59625ecdfc69b0602cd"},
{file = "igraph-0.11.5-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:848206e8db2d47b9a252a994105f963eb03bce0c7455c5478478a02734cd4cc3"},
{file = "igraph-0.11.5-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:ba42b1b38c8cd3fd4ed73bbe9f9f7da2d8c7457e3b61ddd235deed9593fc26c8"},
{file = "igraph-0.11.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63074458ba8c26057cc22db46cace78276db4b3e9f231e3b2047139979647ffc"},
{file = "igraph-0.11.5-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1a7fe9a87b9b904d14cfe0167ae8f7231a4cb951969652372b4a3b2cb23ca827"},
{file = "igraph-0.11.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dfdd7266080e96d0a569e13ebd6219d2bd1cfabaa4db8c5ba8380360fccd0883"},
{file = "igraph-0.11.5-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:4305185b65cb6b2e8a22c9d5e834978093d4a8a65dd71dc42db7a13f8614864d"},
{file = "igraph-0.11.5.tar.gz", hash = "sha256:2d71d645a4c3344c5910543fabbae10d3163f46a3e824ba7753c14b9036b8233"},
]
[[package]]
name = "importlib-metadata"
version = "7.1.0"
@ -844,7 +957,7 @@ name = "jinja2"
version = "3.1.4"
requires_python = ">=3.7"
summary = "A very fast and expressive template engine."
groups = ["default", "notebooks", "trails", "trials"]
groups = ["default", "notebooks", "trials"]
dependencies = [
"MarkupSafe>=2.0",
]
@ -891,7 +1004,7 @@ name = "jsonschema"
version = "4.22.0"
requires_python = ">=3.8"
summary = "An implementation of JSON Schema validation for Python"
groups = ["notebooks", "trails", "trials"]
groups = ["notebooks", "trials"]
dependencies = [
"attrs>=22.2.0",
"jsonschema-specifications>=2023.03.6",
@ -908,7 +1021,7 @@ name = "jsonschema-specifications"
version = "2023.12.1"
requires_python = ">=3.8"
summary = "The JSON Schema meta-schemas and vocabularies, exposed as a Registry"
groups = ["notebooks", "trails", "trials"]
groups = ["notebooks", "trials"]
dependencies = [
"referencing>=0.31.0",
]
@ -1212,7 +1325,7 @@ name = "markupsafe"
version = "2.1.5"
requires_python = ">=3.7"
summary = "Safely add untrusted strings to HTML/XML markup."
groups = ["default", "notebooks", "trails", "trials"]
groups = ["default", "notebooks", "trials"]
files = [
{file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f"},
{file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2"},
@ -1388,7 +1501,7 @@ name = "networkx"
version = "3.3"
requires_python = ">=3.10"
summary = "Python package for creating and manipulating graphs and networks"
groups = ["default", "trails", "trials"]
groups = ["default", "trials"]
files = [
{file = "networkx-3.3-py3-none-any.whl", hash = "sha256:28575580c6ebdaf4505b22c6256a2b9de86b316dc63ba9e93abde3d78dfdbcf2"},
{file = "networkx-3.3.tar.gz", hash = "sha256:0c127d8b2f4865f59ae9cb8aafcd60b5c70f3241ebd66f7defad7c4ab90126c9"},
@ -1413,7 +1526,7 @@ name = "numpy"
version = "1.26.4"
requires_python = ">=3.9"
summary = "Fundamental package for array computing in Python"
groups = ["default", "trails", "trials"]
groups = ["default", "trials"]
files = [
{file = "numpy-1.26.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c66707fabe114439db9068ee468c26bbdf909cac0fb58686a42a24de1760c71"},
{file = "numpy-1.26.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef"},
@ -1607,7 +1720,7 @@ name = "packaging"
version = "24.0"
requires_python = ">=3.7"
summary = "Core utilities for Python packages"
groups = ["default", "notebooks", "trails", "trials"]
groups = ["default", "notebooks", "trials"]
files = [
{file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"},
{file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"},
@ -1618,7 +1731,7 @@ name = "pandas"
version = "2.2.2"
requires_python = ">=3.9"
summary = "Powerful data structures for data analysis, time series, and statistics"
groups = ["default", "trails", "trials"]
groups = ["default", "trials"]
dependencies = [
"numpy>=1.23.2; python_version == \"3.11\"",
"numpy>=1.26.0; python_version >= \"3.12\"",
@ -1849,6 +1962,28 @@ files = [
{file = "pure_eval-0.2.2.tar.gz", hash = "sha256:2b45320af6dfaa1750f543d714b6d1c520a1688dec6fd24d339063ce0aaa9ac3"},
]
[[package]]
name = "py4cytoscape"
version = "1.9.0"
requires_python = ">=3.8"
summary = "Cytoscape Automation API"
groups = ["trials"]
dependencies = [
"backoff",
"chardet",
"colorbrewer",
"colour",
"decorator",
"igraph",
"networkx",
"pandas",
"requests",
]
files = [
{file = "py4cytoscape-1.9.0-py3-none-any.whl", hash = "sha256:7e9088832d49489406d1933596225256652c9d58f1d1ee097fea50762bd70dca"},
{file = "py4cytoscape-1.9.0.tar.gz", hash = "sha256:ebf214c5888497ecb9db0c166f6e66123e49402522f7058fe1169b87307e8512"},
]
[[package]]
name = "pycparser"
version = "2.22"
@ -1947,7 +2082,7 @@ name = "pygraphviz"
version = "1.13"
requires_python = ">=3.10"
summary = "Python interface to Graphviz"
groups = ["trails", "trials"]
groups = ["trials"]
files = [
{file = "pygraphviz-1.13.tar.gz", hash = "sha256:6ad8aa2f26768830a5a1cfc8a14f022d13df170a8f6fdfd68fd1aa1267000964"},
]
@ -1957,7 +2092,7 @@ name = "python-dateutil"
version = "2.9.0.post0"
requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
summary = "Extensions to the standard Python datetime module"
groups = ["default", "notebooks", "trails", "trials"]
groups = ["default", "notebooks", "trials"]
dependencies = [
"six>=1.5",
]
@ -1981,7 +2116,7 @@ files = [
name = "pytz"
version = "2024.1"
summary = "World timezone definitions, modern and historical"
groups = ["default", "trails", "trials"]
groups = ["default", "trials"]
files = [
{file = "pytz-2024.1-py2.py3-none-any.whl", hash = "sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319"},
{file = "pytz-2024.1.tar.gz", hash = "sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812"},
@ -2103,7 +2238,7 @@ name = "referencing"
version = "0.35.1"
requires_python = ">=3.8"
summary = "JSON Referencing + Python"
groups = ["notebooks", "trails", "trials"]
groups = ["notebooks", "trials"]
dependencies = [
"attrs>=22.2.0",
"rpds-py>=0.7.0",
@ -2158,7 +2293,7 @@ name = "requests"
version = "2.31.0"
requires_python = ">=3.7"
summary = "Python HTTP for Humans."
groups = ["default", "notebooks"]
groups = ["default", "notebooks", "trials"]
dependencies = [
"certifi>=2017.4.17",
"charset-normalizer<4,>=2",
@ -2213,7 +2348,7 @@ name = "rpds-py"
version = "0.18.1"
requires_python = ">=3.8"
summary = "Python bindings to Rust's persistent data structures (rpds)"
groups = ["notebooks", "trails", "trials"]
groups = ["notebooks", "trials"]
files = [
{file = "rpds_py-0.18.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6b5ff7e1d63a8281654b5e2896d7f08799378e594f09cf3674e832ecaf396ce8"},
{file = "rpds_py-0.18.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8927638a4d4137a289e41d0fd631551e89fa346d6dbcfc31ad627557d03ceb6d"},
@ -2369,7 +2504,7 @@ name = "scikit-network"
version = "0.32.1"
requires_python = ">=3.8"
summary = "Graph algorithms"
groups = ["trails", "trials"]
groups = ["trials"]
dependencies = [
"numpy>=1.22.4",
"scipy>=1.7.3",
@ -2386,7 +2521,7 @@ name = "scipy"
version = "1.13.0"
requires_python = ">=3.9"
summary = "Fundamental algorithms for scientific computing in Python"
groups = ["default", "trails", "trials"]
groups = ["default", "trials"]
dependencies = [
"numpy<2.3,>=1.22.4",
]
@ -2454,7 +2589,7 @@ name = "six"
version = "1.16.0"
requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
summary = "Python 2 and 3 compatibility utilities"
groups = ["default", "notebooks", "trails", "trials"]
groups = ["default", "notebooks", "trials"]
files = [
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
@ -2736,6 +2871,16 @@ files = [
{file = "terminado-0.18.1.tar.gz", hash = "sha256:de09f2c4b85de4765f7714688fff57d3e75bad1f909b589fde880460c753fd2e"},
]
[[package]]
name = "texttable"
version = "1.7.0"
summary = "module to create simple ASCII tables"
groups = ["trials"]
files = [
{file = "texttable-1.7.0-py2.py3-none-any.whl", hash = "sha256:72227d592c82b3d7f672731ae73e4d1f88cd8e2ef5b075a7a7f01a23a3743917"},
{file = "texttable-1.7.0.tar.gz", hash = "sha256:2d2068fb55115807d3ac77a4ca68fa48803e84ebb0ee2340f858107a36522638"},
]
[[package]]
name = "thinc"
version = "8.2.3"
@ -2874,7 +3019,7 @@ name = "toolz"
version = "0.12.1"
requires_python = ">=3.7"
summary = "List processing tools and functional utilities"
groups = ["trails", "trials"]
groups = ["trials"]
files = [
{file = "toolz-0.12.1-py3-none-any.whl", hash = "sha256:d22731364c07d72eea0a0ad45bafb2c2937ab6fd38a3507bf55eae8744aa7d85"},
{file = "toolz-0.12.1.tar.gz", hash = "sha256:ecca342664893f177a13dac0e6b41cbd8ac25a358e5f215316d43e2100224f4d"},
@ -3042,7 +3187,7 @@ name = "tzdata"
version = "2024.1"
requires_python = ">=2"
summary = "Provider of IANA time zone data"
groups = ["default", "trails", "trials"]
groups = ["default", "trials"]
files = [
{file = "tzdata-2024.1-py2.py3-none-any.whl", hash = "sha256:9068bc196136463f5245e51efda838afa15aaeca9903f49050dfa2679db4d252"},
{file = "tzdata-2024.1.tar.gz", hash = "sha256:2674120f8d891909751c38abcdfd386ac0a5a1127954fbc332af6b5ceae07efd"},
@ -3064,7 +3209,7 @@ name = "urllib3"
version = "2.2.1"
requires_python = ">=3.8"
summary = "HTTP library with thread-safe connection pooling, file post, and more."
groups = ["default", "notebooks"]
groups = ["default", "notebooks", "trials"]
files = [
{file = "urllib3-2.2.1-py3-none-any.whl", hash = "sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d"},
{file = "urllib3-2.2.1.tar.gz", hash = "sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19"},

View File

@ -39,8 +39,12 @@ notebooks = [
# (Linux not tested yet). The compiler needs additional information about the location of Graphviz
# files. This information is provided by extra options.
# --config-setting="--global-option=build_ext" --config-setting="--global-option=-IC:\Program Files\Graphviz\include" --config-setting="--global-option=-LC:\Program Files\Graphviz\lib"
trails = [
trials = [
"alph[graphviz]>=0.4.10",
"py4cytoscape>=1.9.0",
]
dev = [
"cython>=3.0.10",
]
[tool.ruff]

View File

@ -13,6 +13,7 @@ import numpy.typing as npt
from networkx import DiGraph, Graph
from pandas import DataFrame
from lang_main.constants import EDGE_WEIGHT_DECIMALS
from lang_main.io import load_pickle, save_pickle
from lang_main.loggers import logger_graphs as logger
from lang_main.types import (
@ -105,15 +106,26 @@ def update_graph(
def convert_graph_to_undirected(
graph: DiGraph,
logging: bool = LOGGING_DEFAULT,
cast_int: bool = False,
) -> Graph:
dtype = np.float32
if cast_int:
dtype = np.uint32
# get adjacency matrix
adj_mat = typing.cast(DataFrame, nx.to_pandas_adjacency(G=graph, dtype=np.uint32))
arr = typing.cast(npt.NDArray[np.uint32], adj_mat.to_numpy())
adj_mat = typing.cast(DataFrame, nx.to_pandas_adjacency(G=graph, dtype=dtype))
arr = typing.cast(npt.NDArray[np.float32 | np.uint32], adj_mat.to_numpy())
if not cast_int:
arr = arr * (10**EDGE_WEIGHT_DECIMALS)
arr = np.round(arr, decimals=0)
arr = arr.astype(np.uint32)
# build undirected array: adding edges of lower triangular matrix to upper one
arr_upper = np.triu(arr)
arr_lower = np.tril(arr)
arr_lower = np.rot90(np.fliplr(arr_lower))
arr_new = arr_upper + arr_lower
if not cast_int:
arr_new = (arr_new / 10**EDGE_WEIGHT_DECIMALS).astype(np.float32)
arr_new = np.round(arr_new, decimals=EDGE_WEIGHT_DECIMALS)
# assign new data and create graph
adj_mat.loc[:] = arr_new # type: ignore
graph_undir = typing.cast(Graph, nx.from_pandas_adjacency(df=adj_mat))
@ -164,6 +176,7 @@ def convert_graph_to_cytoscape(
}
cyto_data.append(edge_data)
# TODO: add internal behaviour (if edge added check for new min/max)
min_weight: int = 0
max_weight: int = 0
if weights:
@ -257,6 +270,78 @@ def filter_graph_by_node_degree(
return filtered_graph
def normalise_array_linear(
array: npt.NDArray[np.float_],
) -> npt.NDArray[np.float32]:
"""apply standard linear normalisation
Parameters
----------
array : npt.NDArray[np.float_]
array which shall be normalised
Returns
-------
npt.NDArray[np.float32]
min/max normalised array
"""
arr_norm = (array - array.min()) / (array.max() - array.min())
return arr_norm.astype(np.float32)
def weight_scaling(
weights: npt.NDArray[np.float32],
a: float = 1.1,
b: float = 0.05,
) -> npt.NDArray[np.float32]:
"""non-linear scaling of already normalised edge weights [0;1]: bigger weights
have smaller weight delta than smaller weights. Bigger values für parameter
`b` reinforce this effect.
Based on:
https://math.stackexchange.com/questions/4297805/exponential-function-that-passes-through-0-0-and-1-1-with-variable-slope
With default values the range of edge weights lies approximately between [0.1; 1]
Parameters
----------
weights : npt.NDArray[np.float32]
pre-normalised edge weights as 1D array
a : float, optional
factor to determine the value for edge weights with value 0
with default approx. 0.1, by default 1.1
b : float, optional
adjust the curvature, smaller values increase it, by default 0.05
Returns
-------
npt.NDArray[np.float32]
non-linear adjusted edge weights as 1D array
"""
adjusted_weights = (b**weights - a) / (b - a)
return np.round(adjusted_weights, decimals=EDGE_WEIGHT_DECIMALS)
def rescale_edge_weights(
graph: TokenGraph,
) -> TokenGraph:
graph = graph.copy()
weights = cast(list[int], [data['weight'] for data in graph.edges.values()])
w_log = cast(npt.NDArray[np.float32], np.log(weights, dtype=np.float32))
weights_norm = normalise_array_linear(w_log)
weights_adjusted = weight_scaling(weights_norm)
# assign new weight values
for idx, (node_1, node_2) in enumerate(list(graph.edges)):
graph[node_1][node_2]['weight'] = weights_adjusted[idx]
graph.rescaled_weights = True
graph.update_metadata(logging=False)
return graph
# ** ---------------------------------------
class TokenGraph(DiGraph):
def __init__(
@ -276,6 +361,8 @@ class TokenGraph(DiGraph):
self._metadata_directed: dict[str, int] = {}
self._undirected: Graph | None = None
self._metadata_undirected: dict[str, int] = {}
# indicate rescaled weights
self.rescaled_weights: bool = False
def __repr__(self) -> str:
return self.__str__()
@ -350,11 +437,17 @@ class TokenGraph(DiGraph):
) -> Graph | None:
if logging is None:
logging = self.logging
# cast to integer edge weights only if edges were not rescaled previously
cast_int: bool = True
if self.rescaled_weights:
cast_int = False
self._undirected = convert_graph_to_undirected(graph=self, logging=logging)
self._metadata_undirected = get_graph_metadata(
graph=self._undirected, logging=logging
self._undirected = convert_graph_to_undirected(
graph=self,
logging=logging,
cast_int=cast_int,
)
self._metadata_undirected = get_graph_metadata(graph=self._undirected, logging=False)
if not inplace:
return self._undirected

View File

@ -56,6 +56,7 @@ THRESHOLD_SIMILARITY: Final[float] = CONFIG['preprocess']['threshold_similarity'
# ** token analysis
# ** graph postprocessing
EDGE_WEIGHT_DECIMALS: Final[int] = 4
THRESHOLD_EDGE_WEIGHT: Final[int] = CONFIG['graph_postprocessing']['threshold_edge_weight']
# ** time analysis.uniqueness
THRESHOLD_UNIQUE_TEXTS: Final[int] = CONFIG['time_analysis']['uniqueness'][

File diff suppressed because one or more lines are too long