Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed sphinx errors #487

Merged
merged 8 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ cython_debug/

# test files
test.*
tutorials/test.*
/.vscode

# airspeed velocity files
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: "3.9"
python: "3.12"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ include CITATION.cff
include CODE_OF_CONDUCT.md
include pytest.ini

recursive-include tutorials *.ipynb
recursive-include logo *.pdf *.png *.svg
recursive-include requirements *.txt *.md

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pip install -e .\[all\]


## Getting Started
To get started, take a look at the [tutorials](/tutorials/) illustrating the library's basic functionality.
To get started, take a look at the [tutorials](https://xgi.readthedocs.io/en/stable/api/tutorials.html) illustrating the library's basic functionality.


## Corresponding Data
Expand Down
11 changes: 5 additions & 6 deletions docs/source/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ mind.
- Repository: https://github.com/xgi-org/xgi
- PyPI: `latest release <https://pypi.org/project/xgi/>`_
- Twitter: `@xginets <https://twitter.com/xginets>`_
- Contributors: `list <contributors.html>`_
- Projects using XGI: `list <using-xgi.html>`_
- `List of Contributors <contributors.html>`_
- `Projects Using XGI <using-xgi.html>`_

Sign up for our `mailing list <http://eepurl.com/igE6ez>`_ and follow XGI on `Twitter <https://twitter.com/xginets>`_ or `Mastodon <https://mathstodon.xyz/@xginets>`_!

Expand Down Expand Up @@ -78,9 +78,9 @@ Contributing
============

If you want to contribute to this project, please make sure to read the
`contributing guidelines <HOW_TO_CONTRIBUTE.md>`_.
`contributing guidelines <https://github.com/xgi-org/xgi/blob/main/HOW_TO_CONTRIBUTE.md>`_.
We expect respectful and kind interactions by all contributors and users
as laid out in our `code of conduct <CODE_OF_CONDUCT.md>`_.
as laid out in our `code of conduct <https://github.com/xgi-org/xgi/blob/main/CODE_OF_CONDUCT.md>`_.

The XGI community always welcomes contributions, no matter how small.
We're happy to help troubleshoot XGI issues you run into,
Expand All @@ -92,9 +92,8 @@ Some concrete ways that you can get involved:
* **Get XGI updates** by following the XGI `Twitter <https://twitter.com/xginets>`_ account, signing up for our `mailing list <http://eepurl.com/igE6ez>`_, 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 <https://github.com/xgi-org/xgi/issues/new>`_.
* **Create a Pull Request (PR)** to address an `open issue <../../issues>`_ or add a feature.
* **Create a Pull Request (PR)** to address an `open issue <https://github.com/xgi-org/xgi/issues>`_ or add a feature.
* **Join our Zulip channel** to be a part of the `daily goings-on of XGI <https://xgi.zulipchat.com/join/7agfwo7dh7jo56ppnk5kc23r/>`_.
.


Funding
Expand Down
6 changes: 3 additions & 3 deletions docs/source/api/convert/xgi.convert.higher_order_network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ xgi.convert.higher_order_network

.. rubric:: Functions

.. autofunction:: convert_to_hypergraph
.. autofunction:: convert_to_dihypergraph
.. autofunction:: convert_to_simplicial_complex
.. autofunction:: to_hypergraph
.. autofunction:: to_dihypergraph
.. autofunction:: to_simplicial_complex
4 changes: 2 additions & 2 deletions docs/source/api/stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ stats package
~xgi.stats.nodestats.clique_eigenvector_centrality
~xgi.stats.nodestats.clustering_coefficient
~xgi.stats.nodestats.degree
~xgi.stats.nodestats.eigenvector_centrality
~xgi.stats.nodestats.h_eigenvector_centrality
~xgi.stats.nodestats.local_clustering_coefficient
~xgi.stats.nodestats.node_edge_centrality
~xgi.stats.nodestats.two_nodes_clustering_coefficient
~xgi.stats.nodestats.two_node_clustering_coefficient

*Statistics of edges*

Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/source/api/tutorials/XGI in 5 minutes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"XGI also offers several ways to personalize your plots for higher-order structures. For more options, explore the [focus tutorial on plotting](https://xgi.readthedocs.io/en/stable/api/main/tutorials/Tutorial%205%20-%20Plotting.html) or consult the [documentation](https://xgi.readthedocs.io/en/stable/api/drawing.html).\n",
"XGI also offers several ways to personalize your plots for higher-order structures. For more options, explore the [focus tutorial on plotting](https://xgi.readthedocs.io/en/stable/api/tutorials/Tutorial%205%20-%20Plotting.html) or consult the [documentation](https://xgi.readthedocs.io/en/stable/api/drawing.html).\n",
"\n",
"For example, you can place the nodes on a circle:"
]
Expand Down Expand Up @@ -400,7 +400,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
},
"toc": {
"base_numbering": 1,
Expand Down
30 changes: 15 additions & 15 deletions docs/source/api/tutorials/quickstart.ipynb

Large diffs are not rendered by default.

42 changes: 22 additions & 20 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ mind.
- Repository: https://github.com/xgi-org/xgi
- PyPI: `latest release <https://pypi.org/project/xgi/>`_
- Twitter: `@xginets <https://twitter.com/xginets>`_
- Contributors: `list <contributors.html>`_
- Projects using XGI: `list <using-xgi.html>`_
- `List of Contributors <contributors.html>`_
- `Projects Using XGI <using-xgi.html>`_

Sign up for our `mailing list <http://eepurl.com/igE6ez>`_ and follow XGI on `Twitter <https://twitter.com/xginets>`_ or `Mastodon <https://mathstodon.xyz/@xginets>`_!

Expand Down Expand Up @@ -113,9 +113,9 @@ Contributing
============

If you want to contribute to this project, please make sure to read the
`contributing guidelines <HOW_TO_CONTRIBUTE.md>`_.
`contributing guidelines <https://github.com/xgi-org/xgi/blob/main/HOW_TO_CONTRIBUTE.md>`_.
We expect respectful and kind interactions by all contributors and users
as laid out in our `code of conduct <CODE_OF_CONDUCT.md>`_.
as laid out in our `code of conduct <https://github.com/xgi-org/xgi/blob/main/CODE_OF_CONDUCT.md>`_.

The XGI community always welcomes contributions, no matter how small.
We're happy to help troubleshoot XGI issues you run into,
Expand All @@ -127,7 +127,7 @@ Some concrete ways that you can get involved:
* **Get XGI updates** by following the XGI `Twitter <https://twitter.com/xginets>`_ account, signing up for our `mailing list <http://eepurl.com/igE6ez>`_, 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 <https://github.com/xgi-org/xgi/issues/new>`_.
* **Create a Pull Request (PR)** to address an `open issue <../../issues>`_ or add a feature.
* **Create a Pull Request (PR)** to address an `open issue <https://github.com/xgi-org/xgi/issues>`_ or add a feature.
* **Join our Zulip channel** to be a part of the `daily goings-on of XGI <https://xgi.zulipchat.com/join/7agfwo7dh7jo56ppnk5kc23r/>`_.

How to Cite
Expand All @@ -139,21 +139,23 @@ You can cite XGI either by going to our repository page
`repository page <https://github.com/xgi-org/xgi>`_ and
clicking the "cite this repository" button on the right sidebar (which will generate
a citation in your preferred format) or by copying the following BibTeX entry:
```
@article{Landry_XGI_2023,
author = {Landry, Nicholas W. and Lucas, Maxime and Iacopini, Iacopo and Petri, Giovanni and Schwarze, Alice and Patania, Alice and Torres, Leo},
title = {{XGI: A Python package for higher-order interaction networks}},
doi = {10.21105/joss.05162},
journal = {Journal of Open Source Software},
publisher = {The Open Journal},
year = {2023},
month = may,
volume = {8},
number = {85},
pages = {5162},
url = {https://joss.theoj.org/papers/10.21105/joss.05162},
}
```

.. code:: text

@article{Landry_XGI_2023,
author = {Landry, Nicholas W. and Lucas, Maxime and Iacopini, Iacopo and Petri, Giovanni and Schwarze, Alice and Patania, Alice and Torres, Leo},
title = {{XGI: A Python package for higher-order interaction networks}},
doi = {10.21105/joss.05162},
journal = {Journal of Open Source Software},
publisher = {The Open Journal},
year = {2023},
month = may,
volume = {8},
number = {85},
pages = {5162},
url = {https://joss.theoj.org/papers/10.21105/joss.05162},
}


Academic References
===================
Expand Down
2 changes: 1 addition & 1 deletion long_description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ To install this package locally:

Getting Started
---------------
To get started, take a look at the `tutorials <https://github.com/xgi-org/xgi/tree/main/tutorials>`_
To get started, take a look at the `tutorials <https://xgi.readthedocs.io/en/stable/api/tutorials.html>`_
illustrating the library's basic functionality.

Corresponding Data
Expand Down
6 changes: 3 additions & 3 deletions tests/convert/test_graph.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import xgi


def test_convert_to_graph(edgelist2, edgelist5):
def test_to_graph(edgelist2, edgelist5):
H1 = xgi.Hypergraph(edgelist2)
H2 = xgi.Hypergraph(edgelist5)

G1 = xgi.convert_to_graph(H1)
G1 = xgi.to_graph(H1)
assert set(G1.nodes) == {1, 2, 3, 4, 5, 6}
assert set(G1.edges) == {(1, 2), (3, 4), (4, 5), (4, 6), (5, 6)}

G2 = xgi.convert_to_graph(H2)
G2 = xgi.to_graph(H2)
assert set(G2.nodes) == {0, 1, 2, 3, 4, 5, 6, 7, 8}
assert {frozenset(e) for e in G2.edges} == {
frozenset({0, 1}),
Expand Down
20 changes: 10 additions & 10 deletions tests/convert/test_higher_order_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,72 @@


def test_convert_empty_hypergraph():
H = xgi.convert_to_hypergraph(None)
H = xgi.to_hypergraph(None)
assert H.num_nodes == 0
assert H.num_edges == 0


def test_convert_empty_dihypergraph():
H = xgi.convert_to_dihypergraph(None)
H = xgi.to_dihypergraph(None)
assert H.num_nodes == 0
assert H.num_edges == 0


def test_convert_simplicial_complex_to_hypergraph():
SC = xgi.SimplicialComplex()
SC.add_simplices_from([[3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]])
H = xgi.convert_to_hypergraph(SC)
H = xgi.to_hypergraph(SC)
assert isinstance(H, xgi.Hypergraph)
assert SC.nodes == H.nodes
assert SC.edges.members() == H.edges.members()


def test_convert_list_to_hypergraph(edgelist2):
H = xgi.convert_to_hypergraph(edgelist2)
H = xgi.to_hypergraph(edgelist2)
assert isinstance(H, xgi.Hypergraph)
assert set(H.nodes) == {1, 2, 3, 4, 5, 6}
assert H.edges.members() == [{1, 2}, {3, 4}, {4, 5, 6}]


def test_convert_pandas_dataframe_to_hypergraph(dataframe5):
H = xgi.convert_to_hypergraph(dataframe5)
H = xgi.to_hypergraph(dataframe5)
assert isinstance(H, xgi.Hypergraph)
assert set(H.nodes) == set(dataframe5["col1"])
assert H.edges.members() == [{0, 1, 2, 3}, {4}, {5, 6}, {8, 6, 7}]


def test_convert_empty_simplicial_complex():
S = xgi.convert_to_simplicial_complex(None)
S = xgi.to_simplicial_complex(None)
assert S.num_nodes == 0
assert S.num_edges == 0


def test_convert_hypergraph_to_simplicial_complex():
H = xgi.Hypergraph()
H.add_edges_from([[1, 2, 3], [3, 4], [4, 5, 6, 7], [7, 8, 9, 10, 11]])
SC = xgi.convert_to_simplicial_complex(H)
SC = xgi.to_simplicial_complex(H)
assert isinstance(SC, xgi.SimplicialComplex)
assert H.nodes == SC.nodes
assert H.edges.members() == SC.edges.maximal().members()


def test_convert_dihypergraph_to_hypergraph(diedgelist2):
DH = xgi.DiHypergraph(diedgelist2)
H = xgi.convert_to_hypergraph(DH)
H = xgi.to_hypergraph(DH)
assert isinstance(H, xgi.Hypergraph)
assert H.nodes == DH.nodes
assert H.edges.members() == [{0, 1, 2}, {1, 2, 4}, {2, 3, 4, 5}]


def test_convert_list_to_simplicial_complex(edgelist2):
SC = xgi.convert_to_simplicial_complex(edgelist2)
SC = xgi.to_simplicial_complex(edgelist2)
assert isinstance(SC, xgi.SimplicialComplex)
assert set(SC.nodes) == {1, 2, 3, 4, 5, 6}
assert SC.edges.maximal().members() == [{1, 2}, {3, 4}, {4, 5, 6}]


def test_convert_pandas_dataframe_to_simplicial_complex(dataframe5):
SC = xgi.convert_to_simplicial_complex(dataframe5)
SC = xgi.to_simplicial_complex(dataframe5)
assert isinstance(SC, xgi.SimplicialComplex)
assert set(SC.nodes) == set(dataframe5["col1"])
assert SC.edges.maximal().members() == [{0, 1, 2, 3}, {4}, {5, 6}, {8, 6, 7}]
4 changes: 2 additions & 2 deletions xgi/convert/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from ..linalg import adjacency_matrix

__all__ = ["convert_to_graph"]
__all__ = ["to_graph"]


def convert_to_graph(H):
def to_graph(H):
"""Graph projection (1-skeleton) of the hypergraph H.
Weights are not considered.

Expand Down
18 changes: 9 additions & 9 deletions xgi/convert/higher_order_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
from .simplex import from_simplex_dict

__all__ = [
"convert_to_hypergraph",
"convert_to_dihypergraph",
"convert_to_simplicial_complex",
"to_hypergraph",
"to_dihypergraph",
"to_simplicial_complex",
]


def convert_to_hypergraph(data, create_using=None):
def to_hypergraph(data, create_using=None):
"""Make a hypergraph from a known data structure.

The preferred way to call this is automatically from the class constructor.
Expand Down Expand Up @@ -127,7 +127,7 @@ def convert_to_hypergraph(data, create_using=None):
raise XGIError("Input data has unsupported type.")


def convert_to_dihypergraph(data, create_using=None):
def to_dihypergraph(data, create_using=None):
"""Make a dihypergraph from a known data structure.

The preferred way to call this is automatically from the class constructor.
Expand Down Expand Up @@ -184,7 +184,7 @@ def convert_to_dihypergraph(data, create_using=None):
from ..generators import empty_simplicial_complex


def convert_to_simplicial_complex(data, create_using=None):
def to_simplicial_complex(data, create_using=None):
"""Make a hypergraph from a known data structure.
The preferred way to call this is automatically
from the class constructor.
Expand Down Expand Up @@ -238,17 +238,17 @@ def convert_to_simplicial_complex(data, create_using=None):
# edge list
result = from_hyperedge_list(data, create_using)
if not isinstance(create_using, SimplicialComplex):
return convert_to_simplicial_complex(result)
return to_simplicial_complex(result)

elif isinstance(data, pd.DataFrame):
result = from_bipartite_pandas_dataframe(data, create_using)
if not isinstance(create_using, SimplicialComplex):
return convert_to_simplicial_complex(result)
return to_simplicial_complex(result)

elif isinstance(data, dict):
result = from_simplex_dict(data, create_using)
if not isinstance(create_using, SimplicialComplex):
return convert_to_simplicial_complex(result)
return to_simplicial_complex(result)
elif isinstance(
data,
(
Expand Down
6 changes: 3 additions & 3 deletions xgi/core/dihypergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class DiHypergraph:
In addition to the methods listed in this page, other methods defined in the `stats`
package are also accessible via the `DiHypergraph` class. For more details, see the
`tutorial
<https://github.com/ComplexGroupInteractions/xgi/blob/main/tutorials/Tutorial%206%20-%20Statistics.ipynb>`_.
<https://xgi.readthedocs.io/en/stable/api/tutorials/Tutorial%206%20-%20Statistics.html>`_.

References
----------
Expand Down Expand Up @@ -157,9 +157,9 @@ def __init__(self, incoming_data=None, **attr):
if incoming_data is not None:
# This import needs to happen when this function is called, not when it is
# defined. Otherwise, a circular import error would happen.
from ..convert import convert_to_dihypergraph
from ..convert import to_dihypergraph

convert_to_dihypergraph(incoming_data, create_using=self)
to_dihypergraph(incoming_data, create_using=self)
self._hypergraph.update(attr) # must be after convert

def __str__(self):
Expand Down
Loading
Loading