From 373faca2266722f749cf53fa9fec2a9710c0376d Mon Sep 17 00:00:00 2001 From: Alex Morling Date: Wed, 15 May 2024 16:42:35 +0200 Subject: [PATCH] test removing numba dependency --- ecoscope/analysis/UD/etd_range.py | 19 +------------------ setup.py | 1 - 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/ecoscope/analysis/UD/etd_range.py b/ecoscope/analysis/UD/etd_range.py index dbed7e29..c04d486f 100644 --- a/ecoscope/analysis/UD/etd_range.py +++ b/ecoscope/analysis/UD/etd_range.py @@ -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 @@ -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): @@ -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) diff --git a/setup.py b/setup.py index d0ee7fad..363044af 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,6 @@ "mapclassify", "matplotlib", "networkx", - "numba", "plotly", "pyarrow", "pyproj",