Skip to content

Commit

Permalink
Fix module not found (#172)
Browse files Browse the repository at this point in the history
* Convert to src style package from flat

* Update robinhood path for src structure

* Bump version, modify changelog

* Update README
  • Loading branch information
catanzaromj authored Jul 12, 2024
1 parent 64c7517 commit 59610da
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- name: Clone robinhood
run: |
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
git clone https://github.com/martinus/robin-hood-hashing robinhood
- name: Build wheels
uses: pypa/[email protected]
Expand All @@ -41,7 +41,7 @@ jobs:

- name: Clone robinhood
run: |
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
git clone https://github.com/martinus/robin-hood-hashing robinhood
- name: Build sdist
run: pipx run build --sdist
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.6.9

- Convert package to `src` style.
- Fix build command not including python source files.

# 0.6.8

- Update CD commands for newer build system.
Expand Down
6 changes: 3 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include *.txt
include *.md
include ripser/pyRips.pxd
include ripser/ripser.cpp
include ripser/pyRipser.pyx
include src/ripser/pyRips.pxd
include src/ripser/ripser.cpp
include src/ripser/pyRipser.pyx
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ If you're looking for a GPU-accelerated version of Ripser, you can find it at [R

## Setup

Ripser.py is available on all major platforms. All that is required is that you install the standard Python numerical computing libraries and Cython.
Ripser.py is available on `pypi` with wheels for all major platforms. To install, type the following command into your environment:

```bash
pip install python
```
### Local build

If the above command fails, you can build `ripser.py` locally. All that is required is that you
install the standard Python numerical computing libraries and Cython.

Dependencies:

Expand All @@ -47,33 +55,35 @@ Cython should be the only library required before installation. To install, type

```
pip install cython
pip install ripser
```

If you are having trouble installing, please let us know!
Following this, clone the repository, `cd` into the clone, and execute `pip install -v .`

## Optional dependency

#### Optional dependency

Ripser.py when compiled from source can have a _steroid_<sup>1</sup> shot by replacing the standard `unordered_map` from the STL by one of the fastest implementation available: [robin_hood](https://github.com/martinus/robin-hood-hashing). Benchmarking of Ripser.py using the `robin_hood` implementation showed speed-ups up to **30%**.

To be able to use `robin_hood` instead of STL, you only need to clone the repository containing the implementation:

```
# Run this command at the root of the project
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
git clone https://github.com/martinus/robin-hood-hashing robinhood
```

After cloning robinhood with the above command, install `ripser.py` with

```
pip install -v -e .
pip install -v .
```

This will install a local, editable version of `ripser.py` with verbose output. In the verbose output,
This will install a local version of `ripser.py` with verbose output. In the verbose output,
you will see confirmation that robinhood was found or not.

<sup>1</sup> The Python package is already compiled with `robin_hood` by default.

If you are having trouble installing, please let us know!

## Usage

The interface is as simple as can be:
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ docs = ["sktda_docs_config"]

examples = ["tadasets", "jupyter", "pillow"]

[tool.setuptools.packages.find]
where = ["ripser"]

[project.urls]
Homepage = "https://ripser.scikit-tda.org"
Documentation = "https://ripser.scikit-tda.org"
Expand Down
1 change: 0 additions & 1 deletion ripser/_version.py

This file was deleted.

6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


def get_version():
VERSIONFILE = "ripser/_version.py"
VERSIONFILE = "src/ripser/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
Expand Down Expand Up @@ -60,7 +60,7 @@ def run(self):
macros = [("USE_COEFFICIENTS", 1), ("NDEBUG", 1), ("ASSEMBLE_REDUCTION_MATRIX", 1)]

# Robinhood
robinhood_path = os.path.join("ripser", "robinhood")
robinhood_path = os.path.join("robinhood")
if os.path.isdir(robinhood_path):
print(
"\nFound local copy of robinhood! Using robinhood for ripser.py compilation.\n"
Expand All @@ -81,7 +81,7 @@ def run(self):

ext_modules = Extension(
"pyRipser",
sources=["ripser/pyRipser.pyx"],
sources=["src/ripser/pyRipser.pyx"],
define_macros=macros,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/ripser/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.6.10"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 59610da

Please sign in to comment.