Skip to content

Commit

Permalink
Merge pull request #167 from geometric-intelligence/fix_pyproject
Browse files Browse the repository at this point in the history
Fix pyproject
  • Loading branch information
franciscoeacosta authored Aug 1, 2024
2 parents e57d6bf + 78e85d0 commit 5f1d3db
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions neurometry/curvature/datasets/gridcells.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import pandas as pd

os.environ["GEOMSTATS_BACKEND"] = "pytorch"
import geomstats.backend as gs # noqa: E402
import geomstats.backend as gs

import neurometry.curvature.datasets.structures as structures # noqa: E402
import neurometry.curvature.datasets.structures as structures


# TODO
Expand Down
18 changes: 9 additions & 9 deletions neurometry/curvature/datasets/synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import os

os.environ["GEOMSTATS_BACKEND"] = "pytorch"
import geomstats.backend as gs # noqa: E402
import numpy as np # noqa: E402
import pandas as pd # noqa: E402
import skimage # noqa: E402
import torch # noqa: E402
from geomstats.geometry.special_orthogonal import SpecialOrthogonal # noqa: E402
from torch.distributions.multivariate_normal import MultivariateNormal # noqa: E402

from neurometry.topology.persistent_homology import ( # noqa: E402
import geomstats.backend as gs
import numpy as np
import pandas as pd
import skimage
import torch
from geomstats.geometry.special_orthogonal import SpecialOrthogonal
from torch.distributions.multivariate_normal import MultivariateNormal

from neurometry.topology.persistent_homology import (
cohomological_circular_coordinates,
cohomological_toroidal_coordinates,
)
Expand Down
2 changes: 1 addition & 1 deletion neurometry/curvature/datasets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def load(config):
elif config.dataset_name == "three_place_cells_synthetic":
dataset, labels = load_three_place_cells()
print(f"Dataset shape: {dataset.shape}.")
if type(dataset) == np.ndarray:
if isinstance(dataset, np.ndarray):
dataset_torch = torch.from_numpy(dataset)
else:
dataset_torch = dataset
Expand Down
16 changes: 8 additions & 8 deletions neurometry/curvature/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import torch

os.environ["GEOMSTATS_BACKEND"] = "pytorch"
import geomstats.backend as gs # noqa: E402
from geomstats.geometry.base import ImmersedSet # noqa: E402
from geomstats.geometry.euclidean import Euclidean # noqa: E402
from geomstats.geometry.pullback_metric import PullbackMetric # noqa: E402
from geomstats.geometry.special_orthogonal import SpecialOrthogonal # noqa: E402
import geomstats.backend as gs
from geomstats.geometry.base import ImmersedSet
from geomstats.geometry.euclidean import Euclidean
from geomstats.geometry.pullback_metric import PullbackMetric
from geomstats.geometry.special_orthogonal import SpecialOrthogonal

from neurometry.curvature.datasets.synthetic import ( # noqa: E402
from neurometry.curvature.datasets.synthetic import (
get_s1_synthetic_immersion,
get_s2_synthetic_immersion,
get_t2_synthetic_immersion,
Expand Down Expand Up @@ -200,8 +200,8 @@ def _compute_curvature_error_s1(thetas, curv_norms_learned, curv_norms_true):
"""Compute "error" of learned curvature profile given true profile for S1."""
curv_norms_learned = np.array(curv_norms_learned)
curv_norms_true = np.array(curv_norms_true)
diff = np.trapz((curv_norms_learned - curv_norms_true) ** 2, thetas)
normalization = np.trapz(curv_norms_learned**2, thetas) + np.trapz(
diff = np.trapezoid((curv_norms_learned - curv_norms_true) ** 2, thetas)
normalization = np.trapezoid(curv_norms_learned**2, thetas) + np.trapezoid(
curv_norms_true**2, thetas
)

Expand Down
12 changes: 6 additions & 6 deletions neurometry/datasets/synthetic.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import os

os.environ["GEOMSTATS_BACKEND"] = "pytorch"
import geomstats.backend as gs # noqa: E402
import torch # noqa: E402
from geomstats.geometry.euclidean import Euclidean # noqa: E402
from geomstats.geometry.hypersphere import Hypersphere # noqa: E402
from geomstats.geometry.klein_bottle import KleinBottle # noqa: E402
from geomstats.geometry.product_manifold import ProductManifold # noqa: E402
import geomstats.backend as gs
import torch
from geomstats.geometry.euclidean import Euclidean
from geomstats.geometry.hypersphere import Hypersphere
from geomstats.geometry.klein_bottle import KleinBottle
from geomstats.geometry.product_manifold import ProductManifold


def synthetic_neural_manifold(
Expand Down
2 changes: 1 addition & 1 deletion neurometry/dimension/dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import neurometry.datasets.synthetic as synthetic

os.environ["GEOMSTATS_BACKEND"] = "pytorch"
import geomstats.backend as gs # noqa: E402
import geomstats.backend as gs


def skdim_dimension_estimation(
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ dependencies = [
"clu",
"labml-helpers",
"giotto-ph @ git+https://github.com/alibayeh/giotto-ph.git",
"pyflagser @ git+https://github.com/alibayeh/pyflagser.git",
"giotto-tda @ git+https://github.com/alibayeh/giotto-tda.git",
"pyflagser @ git+https://github.com/franciscoeacosta/pyflagser.git",
"giotto-tda @ git+https://github.com/franciscoeacosta/giotto-tda.git",
"geomstats @ git+https://github.com/geomstats/geomstats.git",
"torchlens @ git+https://github.com/johnmarktaylor91/torchlens.git",
"netrep @ git+https://github.com/ahwillia/netrep.git",
Expand Down

0 comments on commit 5f1d3db

Please sign in to comment.