Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
## Checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] I have incremented the version number in the `pyproject.toml` file if a new version needs to be pushed to pypi (note that not incrementing the number won't push to pypi and throw an error, but it will update the documentation).
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation as necessary and compiled locally to ensure it is clean.
- [ ] I have added tests to cover my changes, and all new and existing tests passed.
- [ ] I have incremented the version number in the `pyproject.toml` file if a new version needs to be pushed to pypi. *Note that if the number isn't incremented, the package will not be pushed to pypi, which is useful if this PR is only for updating documentation.*
- [ ] My code follows the code style of this project and I have run `make format` to clean up the code with `black`.
- [ ] My change requires a change to the documentation. I have updated the documentation as necessary and compiled locally to ensure it is clean.
- [ ] I have added tests to cover my changes, and all new and existing tests passed (run `make tests`).
34 changes: 22 additions & 12 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,34 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Install dependencies for version check
run: pip install requests packaging build
- name: Get local version
id: get_local_version
run: |
local_version=$(grep -m1 version pyproject.toml | sed 's/.*= "\(.*\)"/\1/')
echo "local_version=$local_version" >> $GITHUB_OUTPUT
- name: Get PyPI version
id: get_pypi_version
run: |
pypi_version=$(python -c "import requests; print(requests.get('https://pypi.org/pypi/cereeberus/json').json()['info']['version'])")
echo "pypi_version=$pypi_version" >> $GITHUB_OUTPUT
- name: Check if version is incremented
id: check_version
run: |
if python -c "from packaging.version import parse; print(parse('${{ steps.get_local_version.outputs.local_version }}') > parse('${{ steps.get_pypi_version.outputs.pypi_version }}'))" | grep -q True; then
echo "publish=true" >> $GITHUB_OUTPUT
else
echo "publish=false" >> $GITHUB_OUTPUT
- name: Install package for testing
run: pip install .
- name: Run tests
run: make tests
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
run: |
python -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to PyPI
if: steps.check_version.outputs.publish == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI }}
48 changes: 0 additions & 48 deletions .github/workflows/publish_to_test_pypi.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be master instead

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Create venv and install dependencies
run: |
uv venv
source .venv/bin/activate
uv pip install -e .

- name: Run tests
run: |
source .venv/bin/activate
make tests

32 changes: 29 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,42 @@
.PHONY: tests
lint:
@flake8 cereeberus/

format:
@black cereeberus/

html:
.PHONY: docs
docs:
# Running sphinx-build to build html files in build folder.
rm -rf docs
mkdir -p docs
sphinx-build -M html doc_source docs
rsync -a docs/html/ docs/
rm -rf docs/html

install-editable:
@pip install -e .

release:
python -m build

.PHONY: tests
tests:
# Running unittests
@python -m unittest
@python -m unittest

install-requirements:
@pip install -r requirements.txt

all: install-requirements install-editable format tests docs

help:
@echo "Makefile commands:"
@echo " make lint - Run flake8 linter on the code"
@echo " make format - Format code using black"
@echo " make install-editable - Install the package in editable mode for development"
@echo " make docs - Build the documentation in the docs/ folder"
@echo " make release - Build the package for release"
@echo " make tests - Run the unit tests"
@echo " make install-requirements- Install all dependencies from requirements.txt"
@echo " make all - Run format, tests, docs, and release"
@echo " make help - Show this help message"
25 changes: 20 additions & 5 deletions cereeberus/cereeberus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
__all__ = [
'ReebGraph', 'LowerStar', 'computeReeb',
'MergeTree', 'MapperGraph', 'EmbeddedGraph', 'Interleave', 'Assignment',
'data', 'dist', 'reeb', 'compute'
"ReebGraph",
"LowerStar",
"computeReeb",
"MergeTree",
"MapperGraph",
"EmbeddedGraph",
"Interleave",
"Assignment",
"data",
"dist",
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name 'dist' is exported by all but is not defined.

Copilot uses AI. Check for mistakes.
"reeb",
"compute",
]

from .reeb.reebgraph import ReebGraph
Expand All @@ -12,5 +21,11 @@
from .reeb.lowerstar import LowerStar
from .compute.computereeb import computeReeb

# Examples
from .data import ex_reebgraphs, ex_mergetrees, ex_mappergraphs, ex_embedgraphs, ex_torus
# Examples
from .data import (
ex_reebgraphs,
ex_mergetrees,
ex_mappergraphs,
ex_embedgraphs,
ex_torus,
)
153 changes: 0 additions & 153 deletions cereeberus/cereeberus/compute/Old/degree.py

This file was deleted.

Loading