Skip to content

Commit

Permalink
test removing numba dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
atmorling committed May 15, 2024
1 parent 11e8bf6 commit 373faca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
19 changes: 1 addition & 18 deletions ecoscope/analysis/UD/etd_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import typing
from dataclasses import dataclass

import numba as nb
import numpy as np
import scipy
import sklearn
from scipy.optimize import minimize
from scipy.stats import weibull_min
Expand All @@ -14,19 +12,6 @@
from ecoscope.io import raster


@nb.cfunc("double(intc, CPointer(double))")
def __etd__(_, a):
s = a[0]
k = a[1]
el = a[2]
m = a[3]

return np.exp(-((s / el) ** k)) * s ** (k - 2) / np.sqrt(s**2 - m**2)


_etd = scipy.LowLevelCallable(__etd__.ctypes)


class WeibullPDF:
@staticmethod
def fit(data, floc=0):
Expand Down Expand Up @@ -182,9 +167,7 @@ def calculate_etd_range(
scale = weibull_pdf.scale

x = np.arange(0.001, maxspeed, 0.001)
y = (4 * shape * scale ** (-shape) / np.pi) * np.array(
[scipy.integrate.quad(_etd, m, maxspeed, args=(shape, scale, m))[0] for m in x]
)
y = 4 * shape * scale ** (-shape) / np.pi

raster_ndarray = np.zeros(num_rows * num_columns, dtype=np.float64)

Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"mapclassify",
"matplotlib",
"networkx",
"numba",
"plotly",
"pyarrow",
"pyproj",
Expand Down

0 comments on commit 373faca

Please sign in to comment.