diff --git a/docs/source/api/recipes.rst b/docs/source/api/recipes.rst index b8b6b7b4..9b50a1e3 100644 --- a/docs/source/api/recipes.rst +++ b/docs/source/api/recipes.rst @@ -1,3 +1,5 @@ +.. _recipes: + ################## Recipes ################## diff --git a/docs/source/api/tutorials/focus.rst b/docs/source/api/tutorials/focus.rst index 9e5e3b8d..aadf1ade 100644 --- a/docs/source/api/tutorials/focus.rst +++ b/docs/source/api/tutorials/focus.rst @@ -1,5 +1,7 @@ +.. _focus_tutorials: + ################ - Focus tutorials +Focus tutorials ################ @@ -12,4 +14,9 @@ focus_4 focus_5 focus_6 - focus_7 \ No newline at end of file + focus_7 + +.. seealso:: + + This is now too easy and you want to dive deeper into some features of XGI? + Go to the `In-depth Tutorials `_. \ No newline at end of file diff --git a/docs/source/api/tutorials/getting_started.rst b/docs/source/api/tutorials/getting_started.rst index 38e8e86b..10f5caa3 100644 --- a/docs/source/api/tutorials/getting_started.rst +++ b/docs/source/api/tutorials/getting_started.rst @@ -1,3 +1,5 @@ +.. _xgi_in_x_minutes: + ############### Getting started ############### @@ -7,4 +9,11 @@ Getting started getting_started_1 getting_started_2 - getting_started_3 \ No newline at end of file + getting_started_3 + + + +.. seealso:: + + This is now too easy and you want to explore more of what XGI can do? + Go to the `Focus Tutorials `_. \ No newline at end of file diff --git a/docs/source/api/tutorials/in_depth.rst b/docs/source/api/tutorials/in_depth.rst index 60494569..4dc28ef8 100644 --- a/docs/source/api/tutorials/in_depth.rst +++ b/docs/source/api/tutorials/in_depth.rst @@ -1,3 +1,6 @@ +.. _indepth_tutorials: + + ################## In Depth tutorials ################## diff --git a/docs/source/conf.py b/docs/source/conf.py index f03a160c..978fd912 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,8 +20,10 @@ # -- Project information ----------------------------------------------------- project = "XGI" -copyright = "Copyright (C) 2021-2024 XGI Developers" +copyright = "2021-2024 XGI Developers" release = "0.8.9" +version = release +today = "30-08-2024" # -- General configuration --------------------------------------------------- @@ -130,7 +132,7 @@ # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -# add_module_names = True +add_module_names = False # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. @@ -154,17 +156,53 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = "sphinx_rtd_theme" +html_theme = "pydata_sphinx_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -# html_theme_options = {} +html_theme_options = { + "navbar_end": [ + "navbar-icon-links", + ], # Place the social links at the end of the navbar + "icon_links": [ + { + "name": "GitHub", + "url": "https://xgi.readthedocs.io/", + "icon": "fab fa-github-square", # Font Awesome icon + }, + { + "name": "Twitter", + "url": "https://twitter.com/xginets", + "icon": "fab fa-twitter-square", # Font Awesome icon + }, + { + "name": "Mastodon", + "url": "https://mathstodon.xyz/@xginets", + "icon": "fa-brands fa-mastodon", # Font Awesome icon + }, + ], +} + + +html_sidebars = { + "**": ["sidebar-nav-bs", "sidebar-ethical-ads"], + "index": [], + "installing": [], + "tutorial": [], + "xgi-data": [], + "gallery": [], + "contribute": [], + "user_guides": [], + "using-xgi": [], +} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = ["_static"] # html_static_path = ["_static"] +html_logo = "../../logo/logo.svg" + html_show_sphinx = True htmlhelp_basename = "XGIDoc" diff --git a/docs/source/contribute.rst b/docs/source/contribute.rst new file mode 100644 index 00000000..0ec11f90 --- /dev/null +++ b/docs/source/contribute.rst @@ -0,0 +1,189 @@ +.. _contribute: + +**************** +Development +**************** + + +Contribute +========== + +If you want to contribute to this project, please make sure to read the +`contributing guidelines `_. +We expect respectful and kind interactions by all contributors and users +as laid out in our `code of conduct `_. + +The XGI community always welcomes contributions, no matter how small. +We're happy to help troubleshoot XGI issues you run into, +assist you if you would like to add functionality or fixes to the codebase, +or answer any questions you may have. + +Some concrete ways that you can get involved: + +* **Get XGI updates** by following the XGI `Twitter `_ account, signing up for our `mailing list `_, or starring this repository. +* **Spread the word** when you use XGI by sharing with your colleagues and friends. +* **Request a new feature or report a bug** by raising a `new issue `_. +* **Create a Pull Request (PR)** to address an `open issue `_ or add a feature. +* **Join our Zulip channel** to be a part of the `daily goings-on of XGI `_. + + +Contributors +============ + +The XGI project has been helped by invaluable contributions from many members of the community. All listings are alphabetical. + +Core team +--------- + +.. raw:: html + +

+ + @acuschwarze +

+ +

+ + @alpatania +

+ +

+ + @iaciac +

+ +

+ + @leotrs +

+ +

+ + @lordgrilo +

+ +

+ + @maximelucas +

+ +

+ + @nwlandry +

+ +

+ + @tlarock +

+ +

+ + @thomasrobiglio +

+ + +Core team alumni +---------------- + +.. raw:: html + +

+ + @mcontisc +

+ +Contributors +------------ + +.. raw:: html + +

+ + @acombretrenouard +

+ +

+ + @aleable +

+ +

+ + @arnaudon +

+ +

+ + @colltoaction +

+ +

+ + @doabell +

+ +

+ + @goznalo-git +

+ +

+ + @marconurisso +

+ +

+ + @pgberlureau +

+ +

+ + @pietrotraversa +

+ +

+ + @saad1282 +

diff --git a/docs/source/higher-order.rst b/docs/source/higher-order.rst index 6996d672..51214332 100644 --- a/docs/source/higher-order.rst +++ b/docs/source/higher-order.rst @@ -9,4 +9,19 @@ A *higher-order network* is formed by the collection of these higher-order inter Why higher-order interactions? ============================== -Higher-order interactions can reveal more nuanced and sophisticated patterns of connection and can naturally encode different scales of interaction which are inaccessible to pairwise network representations. Higher-order networks can be helpful for describing social networks, ecological communities, co-authorship or citation networks, email, protein interactions, and many more examples. Higher-order networks can also exhibit rich dynamical behavior for simple models of contagion, synchronization, and opinion formation. \ No newline at end of file +Higher-order interactions can reveal more nuanced and sophisticated patterns of connection and can naturally encode different scales of interaction which are inaccessible to pairwise network representations. Higher-order networks can be helpful for describing social networks, ecological communities, co-authorship or citation networks, email, protein interactions, and many more examples. Higher-order networks can also exhibit rich dynamical behavior for simple models of contagion, synchronization, and opinion formation. + + +Academic References +=================== + +* `The Why, How, and When of Representations for Complex Systems + `_, Torres, L., Blevins, A.S., Bassett, D. and Eliassi-Rad, T., 2021. SIAM Review, 63(3), pp.435-485. + +* `Networks beyond pairwise interactions: Structure and dynamics + `_, Battiston, F., Cencetti, G., Iacopini, I., Latora, V., Lucas, M., Patania, A., Young, J.G. and Petri, G., 2020. Physics reports, 874, pp.1-92. + +* `What are higher-order networks? `_, Bick, C., Gross, E., Harrington, H.A. and Schaub, M.T., 2023. SIAM Review, 65(3), pp.686-731. + +* `From networks to optimal higher-order models of complex systems + `_, Lambiotte, R., Rosvall, M. and Scholtes, I., 2019. Nature physics, 15(4), pp.313-320. \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 852e7a7a..93470563 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,133 +3,70 @@ :width: 200 .. toctree:: - :maxdepth: 2 - :caption: Home + :maxdepth: 1 :hidden: - about - contributors - higher-order + installing + user_guides + reference xgi-data gallery + contribute using-xgi -.. toctree:: - :maxdepth: 2 - :caption: Practical guides - :hidden: - - Tutorials - Recipes - -.. toctree:: - :maxdepth: 2 - :caption: Quick reference links - :hidden: - Hypergraph class - Simplicial Complex class - Directed Hypergraph class - -.. toctree:: - :maxdepth: 2 - :caption: API Reference - :hidden: +.. button-link:: https://github.com/xgi-org/xgi/releases/tag/v0.8.9 + :color: primary + :outline: - Core functionality - Node and edge statistics - Algorithms - Generative Models - Linear Algebra - Read/Write - Dynamics - Drawing - Converting to and from other data formats - Utilities + XGI |version| released! |today| -About -===== +Software for higher-order networks +================================== The Comple\ **X** **G**\ roup **I**\ nteractions `(XGI) `_ -library provides data structures and algorithms for modeling and analyzing complex systems -with group (higher-order) interactions. For more information about what higher-order -interactions are, see a `brief overview `_. +library provides data structures and algorithms for modeling, analyzing, and visualizing complex systems +with group (higher-order) interactions. It provides tools to: + +* load and store higher-order networks in standard formats +* generate many random and non-random higher-order networks from models +* analyze the structure of higher-order networks with metrics and algorithms +* compute nodes and edge statistics in a unified interface +* draw higher-order networks +* manipulate hypergraphs (undirected and directed) and simplicial complexes + -Many datasets can be represented as graphs, where pairs of entities (or nodes) are -related via links (or edges). Examples are road networks, energy grids, social -networks, neural networks, etc. However, in many other datasets, more than two entities -can be related at a time. For example, many scientists (entities) can collaborate on a -scientific article together (links), and multiple email accounts (entities) can all -participate on the same email thread (links). In this latter case, graphs no longer -present a viable alternative to represent such datasets. It is for this kind of -datasets, where the interactions are given among groups of more than two entities (also -called higher-order interactions), that XGI was designed for. +Higher-order networks generalize standard (pairwise) networks by allowing to encode higher-order interactions, +that is, interactions between any number of entities. Collaborations and contagion processes are typical +examples where these higher-order interactions are crucial. +For more information about what higher-order +interactions are, see a `brief overview `_. XGI is implemented in pure Python and is designed to seamlessly interoperate with the rest of the Python scientific stack (numpy, scipy, pandas, matplotlib, etc). XGI is designed and developed by network scientists with the needs of network scientists in -mind. - -- Repository: https://github.com/xgi-org/xgi -- PyPI: `latest release `_ -- Twitter: `@xginets `_ -- `List of Contributors `_ -- `Projects Using XGI `_ - -Sign up for our `mailing list `_ and follow XGI on `Twitter `_ or `Mastodon `_! +mind. Browse the `list of projects using XGI `_ to get an idea of what XGI can do and how it is being used by other people. - -Installation -============ - -To install and use XGI as an end user, execute - -.. code:: bash - - pip install xgi - -To install for development purposes, first clone the repository and then execute - -.. code:: bash - - pip install -e .['all'] - -If that command does not work, you may try the following instead - -.. code:: zsh - - pip install -e .\[all\] - -XGI was developed and tested for Python 3.8-3.12 on Mac OS, Windows, and Ubuntu. +Get started immediately by `installing XGI `_ and checking the `XGI in 1 minute `_ tutorial. Corresponding Data ================== A number of higher-order datasets are available in the `XGI-DATA repository `_ and can be easily accessed with the ``load_xgi_data()`` function. +More information about the datasets and how to load them is in the `XGI-DATA menu `_. -Contributing -============ +Get involved +================== -If you want to contribute to this project, please make sure to read the -`contributing guidelines `_. -We expect respectful and kind interactions by all contributors and users -as laid out in our `code of conduct `_. +To simply getting news and updates, you can sign up for our `mailing list `_ and follow XGI on `Twitter `_ or `Mastodon `_! -The XGI community always welcomes contributions, no matter how small. -We're happy to help troubleshoot XGI issues you run into, -assist you if you would like to add functionality or fixes to the codebase, -or answer any questions you may have. +If you want to contribute, even better! The XGI community always welcomes contributions, no matter how small. +For more information, see our `contribution guide `_. -Some concrete ways that you can get involved: -* **Get XGI updates** by following the XGI `Twitter `_ account, signing up for our `mailing list `_, or starring this repository. -* **Spread the word** when you use XGI by sharing with your colleagues and friends. -* **Request a new feature or report a bug** by raising a `new issue `_. -* **Create a Pull Request (PR)** to address an `open issue `_ or add a feature. -* **Join our Zulip channel** to be a part of the `daily goings-on of XGI `_. How to Cite =========== @@ -163,20 +100,15 @@ Academic References =================== * `The Why, How, and When of Representations for Complex Systems - `_, Leo Torres, Ann S. Blevins, Danielle Bassett, - and Tina Eliassi-Rad. + `_, Torres, L., Blevins, A.S., Bassett, D. and Eliassi-Rad, T., 2021. SIAM Review, 63(3), pp.435-485. * `Networks beyond pairwise interactions: Structure and dynamics - `_, Federico Battiston, Giulia - Cencetti, Iacopo Iacopini, Vito Latora, Maxime Lucas, Alice Patania, Jean-Gabriel - Young, and Giovanni Petri. + `_, Battiston, F., Cencetti, G., Iacopini, I., Latora, V., Lucas, M., Patania, A., Young, J.G. and Petri, G., 2020. Physics reports, 874, pp.1-92. -* `What are higher-order networks? `_, Christian Bick, - Elizabeth Gross, Heather A. Harrington, Michael T. Schaub. +* `What are higher-order networks? `_, Bick, C., Gross, E., Harrington, H.A. and Schaub, M.T., 2023. SIAM Review, 65(3), pp.686-731. * `From networks to optimal higher-order models of complex systems - `_, Renaud Lambiotte, Martin - Rosvall, and Ingo Scholtes. + `_, Lambiotte, R., Rosvall, M. and Scholtes, I., 2019. Nature physics, 15(4), pp.313-320. Funding @@ -192,4 +124,3 @@ License This project is licensed under the `BSD 3-Clause License `_. -Copyright (C) 2021-2024 XGI Developers diff --git a/docs/source/installing.rst b/docs/source/installing.rst new file mode 100644 index 00000000..6c955070 --- /dev/null +++ b/docs/source/installing.rst @@ -0,0 +1,45 @@ +.. _installing: + +*************** +Installing +*************** + + +Installing the released version +=============================== + +To install XGI, execute the following in the command line: + +.. code:: bash + + pip install xgi + + +XGI was developed and tested for Python 3.8-3.12 on Mac OS, Windows, and Ubuntu. + +Once installed, go directly to the `User Guides `_ to get started! + +Installing the development version +================================== + + +You can also install the development version, either to contribute or to get the latest (potentially unstable) upgrades without having to wait for a new release. +To do this, you need to first clone the repository and then pip install locally: + +.. code:: bash + + git clone https://github.com/xgi-org/xgi.git + cd xgi + pip install -e .['all'] + +If the last line does not work, you may try the following instead + +.. code:: zsh + + pip install -e .\[all\] + + +.. seealso:: + + For more installation options, see our `guide `_. + diff --git a/docs/source/installing_more.rst b/docs/source/installing_more.rst new file mode 100644 index 00000000..8f920a57 --- /dev/null +++ b/docs/source/installing_more.rst @@ -0,0 +1,51 @@ +.. _installing_more: + +*************************** +Installation instructions +*************************** + +pip installing with options +============================ + +You may wish to selectively install dependencies required for testing, developing, or building certain parts of the project. +The options are the following: + +- ``benchmark``: Requirements needed to run the benchmarking notebooks +- ``tutorial``: Requirements needed to run the Jupyter Notebooks with the examples +- ``test``: Requirements needed to run the test suite +- ``docs``: Requirements needed to build the documentation (see the [docs](https://github.com/xgi-org/xgi/tree/main/docs)) +- ``developer``: Requirements needed to format the codebase +- ``release``: Requirements needed to release new versions of XGI + +You can install XGI with one or more of these options by running the following: + +.. code:: bash + + pip install xgi[option] + pip install xgi[option1,option2] + +pip installing dependencies (without installing XGI) +==================================================== + +You may wish to install the dependencies without actually installing XGI itself. The following are the requirements files to do that: + +- ``benchmark.txt``: Requirements to run the benchmarking notebooks +- ``default.txt``: Default requirements +- ``tutorial.txt``: Requirements for running the Jupyter Notebooks with the examples +- ``test.txt``: Requirements for running test suite +- ```docs.txt``: Requirements for building the documentation (see `../docs/`) +- ``developer.txt``: Requirements for developers +- ``release.txt``: Requirements for making releases + +To install these dependencies, simply run + +.. code:: bash + + pip install -U -r requirements/{filename} + +where the filename is one of the ones listed above. For example, to install the requirements necessary to run the test suite, run + +.. code:: bash + + pip install -U -r requirements/default.txt + pip install -U -r requirements/test.txt diff --git a/docs/source/reference.rst b/docs/source/reference.rst new file mode 100644 index 00000000..1dad224e --- /dev/null +++ b/docs/source/reference.rst @@ -0,0 +1,39 @@ +.. _reference: + +************** +API Reference +************** + +This page gives an overview of all public XGI objects, functions and methods. All classes and functions are exposed in xgi.* namespace are public + +XGI is organized into the following subpackages: + +* ``xgi.algorithms``: Function to compute classic algorightms on higher-order networks +* ``xgi.convert``: Functions to convert between different representations of the data +* ``xgi.core``: Classes for the core datastructures and views +* ``xgi.drawing``: Functions for plotting +* ``xgi.dynamics``: Functions to simulate given dynamical processes +* ``xgi.generators``: Functions to generate higher-order networks from models +* ``xgi.linalg``: Functions to compute matrix and tensors representations +* ``xgi.readwrite``: Functions to load and store higher-order networks in standard formats +* ``xgi.stats``: Functions to compute node and edge statistics in a single interface +* ``xgi.utils``: Small utility functions + + +.. note:: + + This page describes release |version| of XGI. Find out more in the `Release notes `_ about this and previous releases. + +.. toctree:: + :maxdepth: 2 + + Algorithms + Convert + Core functionality + Drawing + Dynamics + Generators + Linear Algebra + I/O + Stats for nodes and edges + Utilities diff --git a/docs/source/user_guides.rst b/docs/source/user_guides.rst new file mode 100644 index 00000000..4d47f3c8 --- /dev/null +++ b/docs/source/user_guides.rst @@ -0,0 +1,84 @@ +.. _guides: + +*********************************** +User Guides +*********************************** + + +.. grid:: + + .. grid-item-card:: + :text-align: center + + Getting started + ^^^ + + "XGI in x minutes" tutorials to quickly get started! + + +++ + + .. button-ref:: xgi_in_x_minutes + :expand: + :color: secondary + :click-parent: + + To the absolute beginner's guide + + .. grid-item-card:: + :text-align: center + + Focus tutorials + ^^^ + + One tutorial per aspect of XGI to learn everything + step by step. + + +++ + + .. button-ref:: focus_tutorials + :expand: + :color: secondary + :click-parent: + + To the focus tutorials + + + +.. grid:: + + .. grid-item-card:: + :text-align: center + + In depth tutorials + ^^^ + + To know everything there is to know about a specific feature of XGI + +++ + + .. button-ref:: indepth_tutorials + :expand: + :color: secondary + :click-parent: + + To the in-depth tutorials + + .. grid-item-card:: + :text-align: center + + Cookbook + ^^^ + + Recipes to solve specific tasks in a few lines + + +++ + + .. button-ref:: recipes + :expand: + :color: secondary + :click-parent: + + To the cookbook + + + +For all specifications and options of a particular function, or to explore all existing function, see the `API Reference `_. \ No newline at end of file diff --git a/docs/source/using-xgi.rst b/docs/source/using-xgi.rst index 18136e36..5438d7d0 100644 --- a/docs/source/using-xgi.rst +++ b/docs/source/using-xgi.rst @@ -1,3 +1,6 @@ +.. _using_xgi: + + ****************** Projects using XGI ****************** diff --git a/docs/source/xgi-data.rst b/docs/source/xgi-data.rst index ec9a9da5..d61f294e 100644 --- a/docs/source/xgi-data.rst +++ b/docs/source/xgi-data.rst @@ -4,6 +4,29 @@ XGI-DATA XGI-DATA is a repository of openly available hypergraph datasets in JSON format with corresponding documentation of network statistics, limitations of the data, and methods of collection. They are hosted in the `XGI Community `_ on Zenodo. This is loosely inspired by `Datasheets for Datasets `_ by Gebru et al. +Loading datasets +---------------- + +Loading a dataset using XGI is as simple as the following two lines: + +.. code-block:: python + + import xgi + H = xgi.load_xgi_data("") + +XGI-DATA uses an HTTP request to load the hypergraph dataset. See the `Reference `_ for a complete description of the function. + +The directed hypergraph datasets from the Biochemical, Genetic and Genomic (BIGG) database can also be loaded with: + + +.. code-block:: python + + import xgi + H = xgi.load_bigg_data("") + + +See the `Reference `_ for a complete description of the function. + Dataset format -------------- @@ -24,18 +47,6 @@ The xgi-data format for higher-order datasets is a JSON data structure with the * :code:`edge-dict`: This tag accesses the edge IDs and the corresponding nodes which participate in that hyperedge. -Loading datasets ----------------- - -Loading a dataset using XGI is as simple as the following two lines: - -.. code-block:: python - - import xgi - H = xgi.load_xgi_data("") - -XGI-DATA uses an HTTP request to load the hypergraph dataset. - Network Statistics ------------------ diff --git a/pyproject.toml b/pyproject.toml index 6106b8b0..bb25b33a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,6 +81,7 @@ docs = [ "ipykernel", "nbsphinx", "nbsphinx-link", + "pydata-sphinx-theme", ] release = [ "twine>=3.4", diff --git a/tests/drawing/test_draw.py b/tests/drawing/test_draw.py index 4eadd158..6edc1e78 100644 --- a/tests/drawing/test_draw.py +++ b/tests/drawing/test_draw.py @@ -340,16 +340,20 @@ def test_draw_hyperedges_ec(edgelist8): H = xgi.Hypergraph(edgelist8) - colors = np.array([[0.6468274 , 0.80289262, 0.56592265, 0.4], - [0.17363177, 0.19076859, 0.44549087, 0.4], - [0.17363177, 0.19076859, 0.44549087, 0.4], - [0.17363177, 0.19076859, 0.44549087, 0.4], - [0.17363177, 0.19076859, 0.44549087, 0.4], - [0.17363177, 0.19076859, 0.44549087, 0.4]]) + colors = np.array( + [ + [0.6468274, 0.80289262, 0.56592265, 0.4], + [0.17363177, 0.19076859, 0.44549087, 0.4], + [0.17363177, 0.19076859, 0.44549087, 0.4], + [0.17363177, 0.19076859, 0.44549087, 0.4], + [0.17363177, 0.19076859, 0.44549087, 0.4], + [0.17363177, 0.19076859, 0.44549087, 0.4], + ] + ) # edge stat color fig, ax = plt.subplots() - ax, collections = xgi.draw_hyperedges(H,ax=ax, edge_ec=H.edges.size, edge_fc="w") + ax, collections = xgi.draw_hyperedges(H, ax=ax, edge_ec=H.edges.size, edge_fc="w") (_, edge_collection) = collections assert np.all(edge_collection.get_edgecolor() == colors) diff --git a/xgi/drawing/draw.py b/xgi/drawing/draw.py index b6a18ff2..c1bf5045 100644 --- a/xgi/drawing/draw.py +++ b/xgi/drawing/draw.py @@ -182,7 +182,7 @@ def draw( * IDStat containing the `ids` as keys If None (default), color by edge size. - Numerical formats will be mapped to colors using edge_vmin, edge_vmax, + Numerical formats will be mapped to colors using edge_vmin, edge_vmax, and edge_fc_cmap. alpha : float, optional The edge transparency. By default, 0.4. @@ -618,7 +618,7 @@ def draw_hyperedges( * IDStat containing the `ids` as keys If None (default), color by edge size. - Numerical formats will be mapped to colors using edge_vmin, edge_vmax, + Numerical formats will be mapped to colors using edge_vmin, edge_vmax, and edge_fc_cmap. alpha : float, optional The edge transparency. By default, 0.4. @@ -752,17 +752,16 @@ def draw_hyperedges( edge_fc_arr = None edge_fc_colors = edge_fc[ids_sorted] if len(edge_fc) > 1 else edge_fc - - edge_ec = edge_ec[ids_sorted] if len(edge_ec) > 1 else edge_ec # reorder + edge_ec = edge_ec[ids_sorted] if len(edge_ec) > 1 else edge_ec # reorder - if edge_ec_to_map: # edgecolors need to be manually mapped + if edge_ec_to_map: # edgecolors need to be manually mapped # create scalarmappable to map floats to colors # we use the same vmin, vmax, and cmap as for edge_fc norm = mpl.colors.Normalize(vmin=edge_vmin, vmax=edge_vmax) sm_edgecolors = cm.ScalarMappable(norm=norm, cmap=edge_fc_cmap) - edge_ec = sm_edgecolors.to_rgba(edge_ec) # map to colors + edge_ec = sm_edgecolors.to_rgba(edge_ec) # map to colors patches = [] for he in np.array(edges.members())[ids_sorted]: @@ -790,7 +789,7 @@ def draw_hyperedges( edge_collection = PatchCollection( patches, facecolors=edge_fc_colors, - array=edge_fc_arr, # will be mapped by PatchCollection + array=edge_fc_arr, # will be mapped by PatchCollection cmap=edge_fc_cmap, edgecolors=edge_ec, alpha=alpha,