diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index ade4722..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: 🐛 Bug Report -description: Create a report to help us reproduce and fix the bug -labels: 'bug' - -body: -- type: markdown - attributes: - value: > - #### Before submitting a bug, please make sure the issue hasn't been already addressed by searching through [the existing and past issues](https://github.com/peekxc/simplextree-py/issues?q=is%3Aissue+sort%3Acreated-desc+). -- type: textarea - attributes: - label: 🐛 Describe the bug - description: | - Please provide a clear and concise description of what the bug is. - - If relevant, add a minimal example so that we can reproduce the error by running the code. It is very important for the snippet to be as succinct (minimal) as possible, so please take time to trim down any irrelevant code to help us debug efficiently. We are going to copy-paste your code and we expect to get the same result as you did: avoid any external data, and include the relevant imports, etc. For example: - - ```python - # All necessary imports at the beginning - import simplextree - - # A succinct reproducing example trimmed down to the essential parts: - assert False is True, "Oh no!" - ``` - - If the code is too long (hopefully, it isn't), feel free to put it in a public gist and link it in the issue: https://gist.github.com. - - Please also paste or describe the results you observe instead of the expected results. If you observe an error, please paste the error message including the **full** traceback of the exception. It may be relevant to wrap error messages in ```` ```triple quotes blocks``` ````. - placeholder: | - A clear and concise description of what the bug is. - validations: - required: true -- type: textarea - attributes: - label: Versions - description: | - Please run the following and paste the output below. - ```sh - python --version && pip freeze - ``` - validations: - required: true -- type: markdown - attributes: - value: > - Thanks for contributing 🎉! diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml deleted file mode 100644 index baf085d..0000000 --- a/.github/ISSUE_TEMPLATE/documentation.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: 📚 Documentation -description: Report an issue related to https://simplextree.readthedocs.io/latest -labels: 'documentation' - -body: -- type: textarea - attributes: - label: 📚 The doc issue - description: > - A clear and concise description of what content in https://simplextree.readthedocs.io/latest is an issue. - validations: - required: true -- type: textarea - attributes: - label: Suggest a potential alternative/fix - description: > - Tell us how we could improve the documentation in this regard. -- type: markdown - attributes: - value: > - Thanks for contributing 🎉! diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index 2823b36..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: 🚀 Feature request -description: Submit a proposal/request for a new feature -labels: 'feature request' - -body: -- type: textarea - attributes: - label: 🚀 The feature, motivation and pitch - description: > - A clear and concise description of the feature proposal. Please outline the motivation for the proposal. Is your feature request related to a specific problem? e.g., *"I'm working on X and would like Y to be possible"*. If this is related to another GitHub issue, please link here too. - validations: - required: true -- type: textarea - attributes: - label: Alternatives - description: > - A description of any alternative solutions or features you've considered, if any. -- type: textarea - attributes: - label: Additional context - description: > - Add any other context or screenshots about the feature request. -- type: markdown - attributes: - value: > - Thanks for contributing 🎉! diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9587887..b700c05 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,9 +3,9 @@ updates: - package-ecosystem: "pip" directory: "/" schedule: - interval: "daily" + interval: "monthly" open-pull-requests-limit: 10 - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" + interval: "monthly" diff --git a/pyproject.toml b/pyproject.toml index f46a80d..44e6b2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,6 @@ [build-system] build-backend = 'mesonpy' requires = ['meson-python', "wheel", "ninja", "pybind11", "numpy"] -# requires = ["setuptools", "wheel", "pybind11", "numpy"] -# build-backend = "setuptools.build_meta" [project] name = "simplextree" @@ -38,7 +36,6 @@ dev = [ "black>=23.0,<24.0", "isort>=5.12,<5.13", "pytest", - "pytest-sphinx", "pytest-cov", "twine>=1.11.0", "build", @@ -64,10 +61,10 @@ include-package-data = true simplextree = ["py.typed"] [tool.setuptools.dynamic] -version = {attr = "simplextree.VERSION"} +version = { attr = "simplextree.VERSION" } [tool.black] -line-length = 100 +line-length = 180 include = '\.pyi?$' exclude = ''' ( @@ -91,7 +88,7 @@ multi_line_output = 3 reportPrivateImportUsage = false [tool.ruff] -line-length = 115 +line-length = 140 target-version = "py39" [tool.ruff.per-file-ignores] diff --git a/src/simplextree/SimplexTree.py b/src/simplextree/SimplexTree.py index afa2490..94b7a27 100644 --- a/src/simplextree/SimplexTree.py +++ b/src/simplextree/SimplexTree.py @@ -175,20 +175,20 @@ def traverse(self, order: str = "preorder", f: Callable = print, sigma: Collecti Supported traversals: - breadth-first / level order ("bfs", "levelorder") - depth-first / prefix ("dfs", "preorder") - - faces ("faces") - - cofaces ("cofaces") - - coface roots + - faces + - cofaces + - coface roots ("coface_roots") - p-skeleton - p-simplices - - maximal simplices + - maximal simplices ("maximal") - link To select one of these options, set order to one of ["bfs", "levelorder", "dfs", "preorder"] Parameters: - order : the type of traversal to do - f : a function to evaluate on every simplex in the traversal. Defaults to print. - sigma : simplex to start the traversal at, where applicable. Defaults to the root node (empty set) - p : dimension of simplices to restrict to, where applicable. + order: the type of traversal of the simplex tree to execute. + f: a function to evaluate on every simplex in the traversal. Defaults to print. + sigma: simplex to start the traversal at, where applicable. Defaults to the root node (empty set). + p: dimension of simplices to restrict to, where applicable. Defaults to 0. """ # todo: handle kwargs assert isinstance(order, str) @@ -253,9 +253,9 @@ def simplices(self, p: int = None) -> Iterable[Collection]: self._traverse(6, lambda s: F.append(s), [], p) # order, f, init, k return F - def faces(self, p: int = None, **kwargs) -> Iterable[Collection]: + def faces(self, p: int = None, sigma: Collection = [], **kwargs) -> Iterable[Collection]: """Wrapper for simplices function.""" - return self.simplices(p) + return self.skeleton(p, sigma) def maximal(self) -> Iterable[Collection]: """Returns the maximal simplices in the complex.""" @@ -279,7 +279,7 @@ def expand(self, k: int) -> None: Examples: - from splex import SimplexTree + from simplextree import SimplexTree from itertools import combinations st = SimplexTree(combinations(range(8), 2)) print(st)