Skip to content

Commit

Permalink
DiHypergraph class (#372)
Browse files Browse the repository at this point in the history
* Initial commit

* update docstrings

* moved read-only test

* added dihypergraph tutorial

* remove unused convert

* updated the node and edge stats

* style: format with black

* added ability to convert from dihypergraphs to hypergraphs

* Update Tutorial 8 - Directed Hypergraphs.ipynb

* added test for convert

* added source and target methods

* response 1 to review

* added first round of tests

* tests for stats

* new direportview file for organization.

* Update dihypergraph.py

* docs: fixed sphinx errors

* docs: added warning and updated docs
  • Loading branch information
nwlandry authored Jun 5, 2023
1 parent 387647a commit f22c455
Show file tree
Hide file tree
Showing 45 changed files with 4,487 additions and 90 deletions.
3 changes: 2 additions & 1 deletion docs/source/api/algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ algorithms package
~xgi.algorithms.assortativity
~xgi.algorithms.centrality
~xgi.algorithms.clustering
~xgi.algorithms.connected
~xgi.algorithms.connected
~xgi.algorithms.shortest_path
2 changes: 2 additions & 0 deletions docs/source/api/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ classes package
:toctree: classes

~xgi.classes.hypergraph
~xgi.classes.dihypergraph
~xgi.classes.simplicialcomplex
~xgi.classes.reportviews
~xgi.classes.direportviews
~xgi.classes.hypergraphviews
~xgi.classes.function
35 changes: 35 additions & 0 deletions docs/source/api/classes/xgi.classes.dihypergraph.DiHypergraph.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
xgi.classes.dihypergraph.DiHypergraph
=====================================

.. currentmodule:: xgi.classes.dihypergraph

.. autoclass:: DiHypergraph
:show-inheritance:
:members:


.. rubric:: Attributes

.. autosummary::

~DiHypergraph.edges
~DiHypergraph.nodes
~DiHypergraph.num_edges
~DiHypergraph.num_nodes


.. rubric:: Methods that modify the structure

.. autosummary::
:nosignatures:

~DiHypergraph.add_node
~DiHypergraph.add_edge
~DiHypergraph.add_nodes_from
~DiHypergraph.add_edges_from
~DiHypergraph.remove_node
~DiHypergraph.remove_edge
~DiHypergraph.remove_nodes_from
~DiHypergraph.remove_edges_from
~DiHypergraph.clear
~DiHypergraph.copy
14 changes: 14 additions & 0 deletions docs/source/api/classes/xgi.classes.dihypergraph.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
xgi.classes.dihypergraph
========================

.. currentmodule:: xgi.classes.dihypergraph

.. automodule:: xgi.classes.dihypergraph

.. rubric:: Classes

.. autosummary::
:toctree: .
:nosignatures:

DiHypergraph
28 changes: 28 additions & 0 deletions docs/source/api/classes/xgi.classes.direportviews.DiEdgeView.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
xgi.classes.direportviews.DiEdgeView
====================================

.. currentmodule:: xgi.classes.direportviews

.. autoclass:: DiEdgeView
:show-inheritance:
:members:


.. rubric:: Attributes

.. autosummary::

~DiEdgeView.ids


.. rubric:: Methods

.. autosummary::
:nosignatures:

~DiEdgeView.members
~DiEdgeView.dimembers
~DiEdgeView.head
~DiEdgeView.tail
~DiIDView.filterby
~DiIDView.filterby_attr
18 changes: 18 additions & 0 deletions docs/source/api/classes/xgi.classes.direportviews.DiIDView.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
xgi.classes.direportviews.DiIDView
==================================

.. currentmodule:: xgi.classes.direportviews

.. autoclass:: DiIDView
:show-inheritance:
:members:


.. rubric:: Methods

.. autosummary::
:nosignatures:

~DiIDView.from_view
~DiIDView.filterby
~DiIDView.filterby_attr
26 changes: 26 additions & 0 deletions docs/source/api/classes/xgi.classes.direportviews.DiNodeView.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
xgi.classes.direportviews.DiNodeView
====================================

.. currentmodule:: xgi.classes.direportviews

.. autoclass:: DiNodeView
:show-inheritance:
:members:


.. rubric:: Attributes

.. autosummary::

~DiNodeView.ids


.. rubric:: Methods

.. autosummary::
:nosignatures:

~DiNodeView.memberships
~DiNodeView.dimemberships
~DiIDView.filterby
~DiIDView.filterby_attr
16 changes: 16 additions & 0 deletions docs/source/api/classes/xgi.classes.direportviews.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
xgi.classes.direportviews
=========================

.. currentmodule:: xgi.classes.direportviews

.. automodule:: xgi.classes.direportviews

.. rubric:: Classes

.. autosummary::
:toctree: .
:nosignatures:

DiIDView
DiNodeView
DiEdgeView
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ xgi.classes.reportviews.EdgeView

.. autosummary::

~NodeView.ids
~EdgeView.ids


.. rubric:: Methods
Expand Down
8 changes: 8 additions & 0 deletions docs/source/api/stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ stats package

~xgi.stats.nodestats
~xgi.stats.edgestats
~xgi.stats.dinodestats
~xgi.stats.diedgestats


.. rubric:: Classes
Expand All @@ -21,8 +23,12 @@ stats package

~xgi.stats.NodeStat
~xgi.stats.EdgeStat
~xgi.stats.DiNodeStat
~xgi.stats.DiEdgeStat
~xgi.stats.MultiNodeStat
~xgi.stats.MultiEdgeStat
~xgi.stats.MultiDiNodeStat
~xgi.stats.MultiDiEdgeStat


.. rubric:: Decorators
Expand All @@ -33,3 +39,5 @@ stats package

~xgi.stats.nodestat_func
~xgi.stats.edgestat_func
~xgi.stats.dinodestat_func
~xgi.stats.diedgestat_func
34 changes: 34 additions & 0 deletions docs/source/api/stats/xgi.stats.DiEdgeStat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
xgi.stats.DiEdgeStat
====================

.. currentmodule:: xgi.stats

.. autoclass:: DiEdgeStat
:show-inheritance:
:members:
:inherited-members:


.. rubric:: Attributes

.. autosummary::

~DiEdgeStat.name


.. rubric:: Methods

.. autosummary::
:nosignatures:

~DiEdgeStat.asdict
~DiEdgeStat.aslist
~DiEdgeStat.asnumpy
~DiEdgeStat.aspandas
~DiEdgeStat.max
~DiEdgeStat.mean
~DiEdgeStat.median
~DiEdgeStat.min
~DiEdgeStat.std
~DiEdgeStat.var
~DiEdgeStat.moment
33 changes: 33 additions & 0 deletions docs/source/api/stats/xgi.stats.DiNodeStat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
xgi.stats.DiNodeStat
====================

.. currentmodule:: xgi.stats

.. autoclass:: DiNodeStat
:show-inheritance:
:members:


.. rubric:: Attributes

.. autosummary::

~DiNodeStat.name


.. rubric:: Methods

.. autosummary::
:nosignatures:

~DiNodeStat.asdict
~DiNodeStat.aslist
~DiNodeStat.asnumpy
~DiNodeStat.aspandas
~DiNodeStat.max
~DiNodeStat.mean
~DiNodeStat.median
~DiNodeStat.min
~DiNodeStat.std
~DiNodeStat.var
~DiNodeStat.moment
27 changes: 27 additions & 0 deletions docs/source/api/stats/xgi.stats.MultiDiEdgeStat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
xgi.stats.MultiDiEdgeStat
=========================

.. currentmodule:: xgi.stats

.. autoclass:: MultiDiEdgeStat
:show-inheritance:
:members:
:inherited-members:


.. rubric:: Attributes

.. autosummary::

~MultiDiEdgeStat.name


.. rubric:: Methods

.. autosummary::
:nosignatures:

~MultiDiEdgeStat.asdict
~MultiDiEdgeStat.aslist
~MultiDiEdgeStat.asnumpy
~MultiDiEdgeStat.aspandas
27 changes: 27 additions & 0 deletions docs/source/api/stats/xgi.stats.MultiDiNodeStat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
xgi.stats.MultiDiNodeStat
=========================

.. currentmodule:: xgi.stats

.. autoclass:: MultiDiNodeStat
:show-inheritance:
:members:
:inherited-members:


.. rubric:: Attributes

.. autosummary::

~MultiDiNodeStat.name


.. rubric:: Methods

.. autosummary::
:nosignatures:

~MultiDiNodeStat.asdict
~MultiDiNodeStat.aslist
~MultiDiNodeStat.asnumpy
~MultiDiNodeStat.aspandas
8 changes: 4 additions & 4 deletions docs/source/api/stats/xgi.stats.MultiEdgeStat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.. autosummary::
:nosignatures:

~MultiNodeStat.asdict
~MultiNodeStat.aslist
~MultiNodeStat.asnumpy
~MultiNodeStat.aspandas
~MultiEdgeStat.asdict
~MultiEdgeStat.aslist
~MultiEdgeStat.asnumpy
~MultiEdgeStat.aspandas
6 changes: 6 additions & 0 deletions docs/source/api/stats/xgi.stats.diedgestat_func.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
xgi.stats.diedgestat\_func
==========================

.. currentmodule:: xgi.stats

.. autofunction:: diedgestat_func
16 changes: 16 additions & 0 deletions docs/source/api/stats/xgi.stats.diedgestats.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
xgi.stats.diedgestats
=====================

.. currentmodule:: xgi.stats.diedgestats

.. automodule:: xgi.stats.diedgestats

.. rubric:: Functions

.. autofunction:: attrs
.. autofunction:: order
.. autofunction:: size
.. autofunction:: head_order
.. autofunction:: head_size
.. autofunction:: tail_order
.. autofunction:: tail_size
6 changes: 6 additions & 0 deletions docs/source/api/stats/xgi.stats.dinodestat_func.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
xgi.stats.dinodestat\_func
==========================

.. currentmodule:: xgi.stats

.. autofunction:: dinodestat_func
13 changes: 13 additions & 0 deletions docs/source/api/stats/xgi.stats.dinodestats.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
xgi.stats.dinodestats
=====================

.. currentmodule:: xgi.stats.dinodestats

.. automodule:: xgi.stats.dinodestats

.. rubric:: Functions

.. autofunction:: attrs
.. autofunction:: degree
.. autofunction:: in_degree
.. autofunction:: out_degree
Loading

0 comments on commit f22c455

Please sign in to comment.