diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fc81ff80..2f355b78 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.14 + rev: v0.4.10 hooks: - id: ruff types_or: [python, pyi, jupyter] diff --git a/pyproject.toml b/pyproject.toml index b81c1369..d64ac0c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ dependencies=[ "networkx", "numpy", "pandas", + "pyarrow", "requests", "scipy", "trimesh", @@ -125,7 +126,15 @@ disable_error_code = ["import-untyped"] plugins = "numpy.typing.mypy_plugin" [tool.pytest.ini_options] -addopts = "--capture=no" +minversion = "7.0" +addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] +xfail_strict = true +filterwarnings = [ + "error", + "ignore::scipy.sparse._base.SparseEfficiencyWarning", +] +log_cli_level = "info" +testpaths = ["test"] [tool.coverage.report] exclude_lines = ["pragma: not covered", "@overload"] diff --git a/test/classes/test_simplex.py b/test/classes/test_simplex.py index e47401c0..e10fa46d 100644 --- a/test/classes/test_simplex.py +++ b/test/classes/test_simplex.py @@ -28,11 +28,7 @@ def test_simplex_creation(self): def test_simplex_sign(self): """Test simplex sign method.""" - s = Simplex( - [ - 1, - ] - ) + s = Simplex([1]) with pytest.raises(NotImplementedError): s.sign(face=1) @@ -73,15 +69,18 @@ def test__contains__(self): def test_construct_tree(self): """Test the construct_tree property of the simplex.""" - s = Simplex((1, 2, 3), construct_tree=True) - assert len(s.boundary) == 3 + with pytest.warns(DeprecationWarning): + s = Simplex((1, 2, 3), construct_tree=True) + with pytest.warns(DeprecationWarning): + assert len(s.boundary) == 3 s = Simplex((1, 2, 3), construct_tree=False) - assert len(s.boundary) == 3 + with pytest.warns(DeprecationWarning): + assert len(s.boundary) == 3 def test_getting_and_setting_items(self): """Test getting and setting items in the simplex.""" - s = Simplex((1, 2, 3), construct_tree=True) + s = Simplex((1, 2, 3)) s["weight"] = 1 assert s["weight"] == 1 diff --git a/toponetx/classes/cell_complex.py b/toponetx/classes/cell_complex.py index 7046ac55..71bfe04f 100644 --- a/toponetx/classes/cell_complex.py +++ b/toponetx/classes/cell_complex.py @@ -790,9 +790,7 @@ def add_cell( if not isinstance(cell, list): cell = list(cell) - if self.is_insertable_cycle( - cell, check_skeleton=check_skeleton, warnings_dis=True - ): + if self.is_insertable_cycle(cell, check_skeleton): edges_cell = set(zip_longest(cell, cell[1:] + [cell[0]])) self._G.add_edges_from(edges_cell) self._insert_cell(Cell(cell, regular=self._regular), **attr) diff --git a/toponetx/classes/simplicial_complex.py b/toponetx/classes/simplicial_complex.py index bc247b15..895cd944 100644 --- a/toponetx/classes/simplicial_complex.py +++ b/toponetx/classes/simplicial_complex.py @@ -463,12 +463,11 @@ def remove_maximal_simplex(self, simplex: Collection) -> None: if simplex_ in self._simplex_set.faces_dict[len(simplex_) - 1]: if self.is_maximal(simplex): del self._simplex_set.faces_dict[len(simplex_) - 1][simplex_] - faces = Simplex(simplex_).faces + faces = self.get_boundaries([simplex_]) for s in faces: if len(s) == len(simplex_): continue - s = s.elements self._simplex_set.faces_dict[len(s) - 1][s]["membership"] -= { simplex_ }