Skip to content

Commit

Permalink
Merge pull request #221 from knaaptime/rmrvlib
Browse files Browse the repository at this point in the history
  • Loading branch information
knaaptime committed Aug 23, 2023
2 parents 1ddb9fa + a0e672a commit 57acfb8
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion .ci/310.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dependencies:
- seaborn
- tqdm
- urbanaccess
- rvlib
- numba
- pyproj >=3

Expand Down
3 changes: 1 addition & 2 deletions .ci/38.yml → .ci/311.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: test
channels:
- conda-forge
dependencies:
- python=3.8
- python=3.11
- deprecation
- geopandas>=0.9
- joblib
Expand All @@ -19,7 +19,6 @@ dependencies:
- seaborn
- tqdm
- urbanaccess
- rvlib
- numba
- pyproj >=3

Expand Down
1 change: 0 additions & 1 deletion .ci/39.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies:
- pytest-mpl
- pytest-cov
- twine
- rvlib

# docs
- ipywidgets
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
environment-file: [.ci/38.yml, .ci/39.yml, .ci/310.yml]
environment-file: [.ci/39.yml, .ci/310.yml, .ci/311.yml]
experimental: [false]
fail-fast: [false]

Expand Down
9 changes: 1 addition & 8 deletions segregation/singlegroup/density_corrected_dissim.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,14 @@
import numpy as np
import pandas as pd
from scipy.optimize import minimize
from warnings import warn
from scipy.stats import norm

from .._base import SingleGroupIndex, SpatialImplicitIndex


# Constructing function that returns $n(\hat{\theta}_j)$
def _return_optimal_theta(theta_j):
def fold_norm(x):
try:
from rvlib import Normal
norm = Normal(0, 1)

except ImportError:
warn("Unable to import `rvlib`. Falling back to slower scipy sampler")
from scipy.stats import norm

y = (-1) * (norm.pdf(x - theta_j) + norm.pdf(x + theta_j))
return y
Expand Down

0 comments on commit 57acfb8

Please sign in to comment.