Skip to content

Commit

Permalink
Renamed to pyrivet, made tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
xoltar committed Jun 20, 2018
1 parent 430f014 commit a66de57
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 21 deletions.
10 changes: 5 additions & 5 deletions pr-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

set -ev

if [ ! -f atlatl/__init__.py ]
if [ ! -f pyrivet/__init__.py ]
then
echo "Run "$(basename "$0")" from the root of the Atlatl repository"
echo "Run "$(basename "$0")" from the root of the pyrivet repository"
exit 1
fi

Expand Down Expand Up @@ -95,7 +95,7 @@ else
fi

# optional, but highly recommended: create a virtualenv to isolate tests
venv=$(mktemp -u atlatl_pr_venv_XXXXX) || \
venv=$(mktemp -u pyrivet_pr_venv_XXXXX) || \
exit_with_error "mktemp -u error"
$create_venv $venv || {
exit_with_error "virtualenv creation failed"
Expand All @@ -105,9 +105,9 @@ $activate_venv $venv || {
exit_with_error "virtualenv activation failed"
}

# install atlatl in editable mode (required for testing)
# install pyrivet in editable mode (required for testing)
pip3 install $ignore_installed -U -e . || \
exit_with_error_and_venv "pip3 failed to install atlatl"
exit_with_error_and_venv "pip3 failed to install pyrivet"

# install developer dependencies
pip3 install $ignore_installed -U -r requirements-dev.txt || \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions atlatl/matching_distance.py → pyrivet/matching_distance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import numpy as np
from atlatl import rivet, barcode, hera
from atlatl.rivet import Point, PointCloud
from pyrivet import rivet, barcode, hera
from pyrivet.rivet import Point, PointCloud


def find_offset(sl, pt):
Expand Down Expand Up @@ -120,7 +120,7 @@ def matching_distance(module1, module2, grid_size, normalize, fixed_bounds=None)
# the line, and also the normalization, which changes both the effective
# weight and the effective bottleneck distance.

slope = lines[:, 0]
slope = np.array(lines)[:, 0]
w = calculate_weight(slope, normalize, delta_x, delta_y)

# moreover, normalization changes the length of a line segment along the line (slope,offset),
Expand Down Expand Up @@ -159,6 +159,7 @@ def generate_lines(grid_size, upper_left, lower_right):
for j in range(grid_size):
offset = LR_offset + j * (UL_offset - LR_offset) / (grid_size - 1)
lines.append((slope, float(offset)))
assert lines
return lines


Expand Down Expand Up @@ -189,7 +190,7 @@ def calculate_weight(slopes, normalize=False, delta_x=None, delta_y=None):
mn = m * delta_x / delta_y

# so the associated weight in the normalized case is given by
q = max(mn, 1 / mn)
q = np.max(np.vstack([mn, 1 / mn]), axis=0)
w = 1 / np.sqrt(1 + q ** 2)

# of course, this code can be made more compact, but hopefully this
Expand Down
2 changes: 1 addition & 1 deletion atlatl/rank.py → pyrivet/rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

from atlatl import rivet, matching_distance
from pyrivet import rivet, matching_distance


def find_parameters(slopes, offsets, points):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion run-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
set -ev
set -o pipefail

flake8 --config setup.cfg atlatl
flake8 --config setup.cfg pyrivet
rst-lint *.rst | { grep -v "is clean.$" || true; }
6 changes: 3 additions & 3 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

set -ev

pip freeze | grep -qi /atlatl || {
echo "You must install atlatl in editable mode using \"pip install -e\""`
`" before calling "$(basename "$0")
pip freeze | grep -qi pyrivet || {
echo "You must install pyrivet in editable mode using \"pip install -e\"
before calling "$(basename "$0")
exit 1
}

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def finalize_options(self):


setup(
name='atlatl',
name='pyrivet',
use_scm_version=True,
setup_requires=[
# 'cython',
Expand All @@ -120,7 +120,7 @@ def finalize_options(self):
],
author='Princeton Neuroscience Institute and Intel Corporation',
author_email='bryn.keller@intel.com',
url='https://github.com/IntelPNI/atlatl',
url='https://github.com/IntelPNI/pyrivet',
description='Algebraic Topology Loves All These Libraries',
license='Apache 2',
keywords='topology, algebraic topology, topological data analysis',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import sys

from atlatl import rivet, hera, barcode, matching_distance
from pyrivet import rivet, hera, barcode, matching_distance
import numpy as np
from atlatl.dimension_distance import SplitMat, Dimension, DimensionQueryResult
from pyrivet.dimension_distance import SplitMat, Dimension, DimensionQueryResult


def test_splitmat():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import sys

from atlatl import rivet, hera, barcode, matching_distance, rank
from pyrivet import rivet, hera, barcode, matching_distance, rank

inf = float('inf')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Borrowed from https://github.com/IntelPNI/brainiak-extras
from atlatl import rivet, hera, barcode
from pyrivet import rivet, hera, barcode

inf = float('inf')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from atlatl import rivet, rank
from pyrivet import rivet, rank
import math

prism_3 = rivet.Bifiltration("x_label", "y_label", [
Expand Down

0 comments on commit a66de57

Please sign in to comment.