Skip to content

Commit

Permalink
Minor fixes (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwlandry authored Sep 8, 2022
1 parent 20ce1b8 commit 70c4bb3
Show file tree
Hide file tree
Showing 37 changed files with 40 additions and 134 deletions.
2 changes: 1 addition & 1 deletion docs/source/api/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ classes package
~xgi.classes.simplicialcomplex
~xgi.classes.reportviews
~xgi.classes.hypergraphviews
~xgi.classes.function
~xgi.classes.function
3 changes: 2 additions & 1 deletion docs/source/api/classes/xgi.classes.function.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. rubric:: Functions

.. autofunction:: convert_labels_to_integers
.. autofunction:: create_empty_copy
.. autofunction:: degree_counts
.. autofunction:: degree_histogram
Expand All @@ -22,4 +23,4 @@
.. autofunction:: max_edge_order
.. autofunction:: set_edge_attributes
.. autofunction:: set_node_attributes
.. autofunction:: unique_edge_sizes
.. autofunction:: unique_edge_sizes
4 changes: 2 additions & 2 deletions docs/source/api/classes/xgi.classes.hypergraph.Hypergraph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
~Hypergraph.remove_node_from_edge
~Hypergraph.clear
~Hypergraph.clear_edges

~Hypergraph.cleanup

.. rubric:: Methods that return other hypergraphs

.. autosummary::
:nosignatures:

~Hypergraph.copy
~Hypergraph.dual
~Hypergraph.dual
6 changes: 1 addition & 5 deletions docs/source/api/classes/xgi.classes.hypergraph.IDDict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
:show-inheritance:
:members:





.. rubric:: Methods

.. autosummary::
:nosignatures:

:nosignatures:
11 changes: 1 addition & 10 deletions docs/source/api/classes/xgi.classes.hypergraph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,4 @@

Hypergraph

IDDict









IDDict
2 changes: 1 addition & 1 deletion docs/source/api/classes/xgi.classes.hypergraphviews.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

.. rubric:: Functions

.. autofunction:: subhypergraph
.. autofunction:: subhypergraph
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ xgi.classes.reportviews.EdgeView
~IDView.duplicates
~IDView.lookup
~IDView.filterby
~IDView.filterby_attr
~IDView.filterby_attr
3 changes: 0 additions & 3 deletions docs/source/api/classes/xgi.classes.reportviews.IDView.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ xgi.classes.reportviews.IDView
:members:





.. rubric:: Methods

.. autosummary::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ xgi.classes.reportviews.NodeView
~IDView.duplicates
~IDView.lookup
~IDView.filterby
~IDView.filterby_attr
~IDView.filterby_attr
2 changes: 1 addition & 1 deletion docs/source/api/classes/xgi.classes.reportviews.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

IDView
NodeView
EdgeView
EdgeView
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
~SimplicialComplex.num_nodes



.. rubric:: Methods

.. autosummary::
Expand All @@ -45,4 +44,4 @@
~SimplicialComplex.remove_edge
~SimplicialComplex.remove_edges_from
~SimplicialComplex.remove_simplex_id
~SimplicialComplex.remove_simplex_ids_from
~SimplicialComplex.remove_simplex_ids_from
11 changes: 1 addition & 10 deletions docs/source/api/classes/xgi.classes.simplicialcomplex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,4 @@
:toctree: .
:nosignatures:

SimplicialComplex









SimplicialComplex
9 changes: 1 addition & 8 deletions docs/source/api/classes/xgi.linalg.matrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,4 @@
.. autofunction:: incidence_matrix
.. autofunction:: intersection_profile
.. autofunction:: laplacian
.. autofunction:: multiorder_laplacian







.. autofunction:: multiorder_laplacian
2 changes: 1 addition & 1 deletion docs/source/api/classes/xgi.utils.utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

.. rubric:: Functions

.. autofunction:: dual_dict
.. autofunction:: dual_dict
2 changes: 1 addition & 1 deletion docs/source/api/generators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ generators package

~xgi.generators.classic
~xgi.generators.nonuniform
~xgi.generators.uniform
~xgi.generators.uniform
9 changes: 1 addition & 8 deletions docs/source/api/generators/xgi.generators.classic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,4 @@
.. autofunction:: empty_hypergraph
.. autofunction:: flag_complex
.. autofunction:: star_clique
.. autofunction:: sunflower







.. autofunction:: sunflower
9 changes: 1 addition & 8 deletions docs/source/api/generators/xgi.generators.nonuniform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,4 @@ xgi.generators.nonuniform
.. autofunction:: random_flag_complex
.. autofunction:: random_flag_complex_d2
.. autofunction:: random_hypergraph
.. autofunction:: random_simplicial_complex







.. autofunction:: random_simplicial_complex
9 changes: 1 addition & 8 deletions docs/source/api/generators/xgi.generators.uniform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,4 @@ xgi.generators.uniform

.. rubric:: Functions

.. autofunction:: uniform_hypergraph_configuration_model







.. autofunction:: uniform_hypergraph_configuration_model
2 changes: 1 addition & 1 deletion docs/source/api/linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ linalg package
.. autosummary::
:toctree: classes

~xgi.linalg.matrix
~xgi.linalg.matrix
2 changes: 1 addition & 1 deletion docs/source/api/readwrite.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ readwrite package
~xgi.readwrite.edgelist
~xgi.readwrite.incidence
~xgi.readwrite.json
~xgi.readwrite.xgi_data
~xgi.readwrite.xgi_data
9 changes: 1 addition & 8 deletions docs/source/api/readwrite/xgi.readwrite.bipartite.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,4 @@ xgi.readwrite.bipartite
.. autofunction:: generate_bipartite_edgelist
.. autofunction:: parse_bipartite_edgelist
.. autofunction:: read_bipartite_edgelist
.. autofunction:: write_bipartite_edgelist







.. autofunction:: write_bipartite_edgelist
9 changes: 1 addition & 8 deletions docs/source/api/readwrite/xgi.readwrite.edgelist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,4 @@ xgi.readwrite.edgelist
.. autofunction:: generate_edgelist
.. autofunction:: parse_edgelist
.. autofunction:: read_edgelist
.. autofunction:: write_edgelist







.. autofunction:: write_edgelist
9 changes: 1 addition & 8 deletions docs/source/api/readwrite/xgi.readwrite.incidence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,4 @@ xgi.readwrite.incidence
.. rubric:: Functions

.. autofunction:: read_incidence_matrix
.. autofunction:: write_incidence_matrix







.. autofunction:: write_incidence_matrix
9 changes: 1 addition & 8 deletions docs/source/api/readwrite/xgi.readwrite.json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,4 @@ xgi.readwrite.json
.. rubric:: Functions

.. autofunction:: read_json
.. autofunction:: write_json







.. autofunction:: write_json
2 changes: 1 addition & 1 deletion docs/source/api/readwrite/xgi.readwrite.xgi_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ xgi.readwrite.xgi_data

.. rubric:: Functions

.. autofunction:: load_xgi_data
.. autofunction:: load_xgi_data
2 changes: 1 addition & 1 deletion docs/source/api/stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ stats package

~xgi.stats.StatDispatcher
~xgi.stats.EdgeStatDispatcher
~xgi.stats.NodeStatDispatcher
~xgi.stats.NodeStatDispatcher
2 changes: 1 addition & 1 deletion docs/source/api/stats/xgi.stats.EdgeStat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
~EdgeStat.min
~EdgeStat.std
~EdgeStat.var
~EdgeStat.moment
~EdgeStat.moment
5 changes: 1 addition & 4 deletions docs/source/api/stats/xgi.stats.EdgeStatDispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
:members:





.. rubric:: Methods

.. autosummary::
:nosignatures:
:nosignatures:
2 changes: 1 addition & 1 deletion docs/source/api/stats/xgi.stats.MultiNodeStat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
~MultiNodeStat.asdict
~MultiNodeStat.aslist
~MultiNodeStat.asnumpy
~MultiNodeStat.aspandas
~MultiNodeStat.aspandas
3 changes: 1 addition & 2 deletions docs/source/api/stats/xgi.stats.NodeStat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
:members:
:inherited-members:


.. rubric:: Attributes

.. autosummary::
Expand All @@ -31,4 +30,4 @@
~NodeStat.min
~NodeStat.std
~NodeStat.var
~NodeStat.moment
~NodeStat.moment
6 changes: 1 addition & 5 deletions docs/source/api/stats/xgi.stats.NodeStatDispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
:show-inheritance:
:members:





.. rubric:: Methods

.. autosummary::
:nosignatures:

:nosignatures:
5 changes: 1 addition & 4 deletions docs/source/api/stats/xgi.stats.StatDispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
:members:





.. rubric:: Methods

.. autosummary::
:nosignatures:

~StatDispatcher.multi
~StatDispatcher.multi
2 changes: 1 addition & 1 deletion docs/source/api/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ utils package
.. autosummary::
:toctree: classes

~xgi.utils.utilities
~xgi.utils.utilities
4 changes: 1 addition & 3 deletions xgi/classes/hypergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,10 +1002,8 @@ def cleanup(
nn = temp.nodes
ee = temp.edges

self.remove_nodes_from(list(self._node))
self.clear()
self.add_nodes_from((n, deepcopy(attr)) for n, attr in nn.items())

self.remove_edges_from(list(self._edge))
self.add_edges_from(
(e, id, deepcopy(temp.edges[id]))
for id, e in ee.members(dtype=dict).items()
Expand Down
4 changes: 1 addition & 3 deletions xgi/classes/reportviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,7 @@ def duplicates(self):
for idx, members in self._id_dict.items():
hashes[frozenset(members)].append(idx)
for _, edges in hashes.items():
if len(edges) == 1:
continue
else:
if len(edges) > 1:
dups.extend(sorted(edges)[1:])
return self.__class__.from_view(self, bunch=dups)

Expand Down
Loading

0 comments on commit 70c4bb3

Please sign in to comment.