Skip to content

Commit

Permalink
Fixes #214, Fixing module import structure to conform to python best …
Browse files Browse the repository at this point in the history
…practices.
  • Loading branch information
devendragovil committed Aug 12, 2023
1 parent 011d6b9 commit f06d339
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 43 deletions.
4 changes: 1 addition & 3 deletions test/classes/test_reportviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import pytest

from toponetx import CombinatorialComplex, HyperEdge
from toponetx.classes.cell import Cell
from toponetx.classes.cell_complex import CellComplex
from toponetx.classes import Cell, CellComplex, CombinatorialComplex, HyperEdge
from toponetx.classes.reportviews import CellView, HyperEdgeView, NodeView, SimplexView
from toponetx.exception import TopoNetXError

Expand Down
28 changes: 1 addition & 27 deletions toponetx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
__version__ = "0.0.2"

from toponetx.exception import (
TopoNetXError,
TopoNetXException,
TopoNetXNotImplementedError,
)

from .classes.cell import Cell
from .classes.cell_complex import CellComplex
from .classes.combinatorial_complex import CombinatorialComplex
from .classes.complex import Complex
from .classes.hyperedge import HyperEdge
from .classes.reportviews import CellView, HyperEdgeView, NodeView, SimplexView
from .classes.simplex import Simplex
from .classes.simplicial_complex import SimplicialComplex
from .datasets.graph import karate_club
from .datasets.mesh import coseg, shrec_16, stanford_bunny
from .transform.graph_to_cell_complex import homology_cycle_cell_complex
from .transform.graph_to_simplicial_complex import (
graph_2_clique_complex,
graph_2_neighbor_complex,
graph_to_clique_complex,
graph_to_neighbor_complex,
)
from .utils.structure import (
neighborhood_list_to_neighborhood_dict,
sparse_array_to_neighborhood_dict,
sparse_array_to_neighborhood_list,
)
__all__ = ["algorithms", "classes", "datasets", "transform", "utils"]
2 changes: 1 addition & 1 deletion toponetx/algorithms/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from toponetx.algorithms.spectrum import *
from .spectrum import *
31 changes: 23 additions & 8 deletions toponetx/classes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
from .cell import *
from .cell_complex import *
from .combinatorial_complex import *
from .complex import *
from .hyperedge import *
from .reportviews import *
from .simplex import *
from .simplicial_complex import *
from .cell import Cell
from .cell_complex import CellComplex
from .combinatorial_complex import CombinatorialComplex
from .complex import Atom, Complex
from .hyperedge import HyperEdge
from .reportviews import CellView, HyperEdgeView, NodeView, SimplexView
from .simplex import Simplex
from .simplicial_complex import SimplicialComplex

__all__ = [
"CellComplex",
"Cell",
"CombinatorialComplex",
"Atom",
"Complex",
"HyperEdge",
"HyperEdgeView",
"CellView",
"SimplexView",
"NodeView",
"Simplex",
"SimplicialComplex",
]
7 changes: 7 additions & 0 deletions toponetx/utils/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@

from scipy.sparse import csr_matrix

__all__ = [
"sparse_array_to_neighborhood_list",
"neighborhood_list_to_neighborhood_dict",
"sparse_array_to_neighborhood_dict",
"incidence_to_adjacency",
]


def sparse_array_to_neighborhood_list(
sparse_array, src_dict=None, dst_dict=None
Expand Down
9 changes: 7 additions & 2 deletions tutorials/01_simplicial_complexes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"source": [
"import numpy as np\n",
"\n",
"from toponetx import SimplicialComplex as sc"
"from toponetx.classes import SimplicialComplex as sc"
]
},
{
Expand Down Expand Up @@ -1274,7 +1274,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3.10.11 ('TopoNetX')",
"language": "python",
"name": "python3"
},
Expand All @@ -1289,6 +1289,11 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
},
"vscode": {
"interpreter": {
"hash": "451a7a2cf09dfa0c0cb86ffbef03c452948bc098596cedd81cbba4e03b20199b"
}
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion tutorials/02_cell_complexes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"source": [
"import numpy as np\n",
"\n",
"from toponetx import CellComplex as Cc"
"from toponetx.classes import CellComplex as Cc"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion tutorials/03_combinatorial_complexes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"metadata": {},
"outputs": [],
"source": [
"from toponetx import CombinatorialComplex as cc"
"from toponetx.classes import CombinatorialComplex as cc"
]
},
{
Expand Down

0 comments on commit f06d339

Please sign in to comment.