-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed 4PL and 5PL model Jacobians, simplified dropna, and improved Ca…
…lCurve.
- Loading branch information
1 parent
8616bcd
commit 74222c3
Showing
14 changed files
with
4,488 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from . import mosaic | ||
from .cal_curve import * | ||
from .core import * | ||
from .model import * | ||
from .read import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import sys | ||
from collections.abc import Callable | ||
|
||
_MODULES_CHECK: dict[str, bool] = { | ||
"jax": "jax" in sys.modules, | ||
"numba": True, | ||
} | ||
|
||
if _MODULES_CHECK["jax"]: | ||
import jax.numpy as np | ||
from jax import jit | ||
from jax.scipy.special import gammaln | ||
|
||
def gmean(a, axis: int = 0, dtype=None, weights=None): | ||
"""Geometric mean.""" | ||
return np.exp(np.average(np.log(a), axis=axis, weights=weights)) | ||
|
||
import warnings | ||
|
||
warnings.warn("JAX backend is experimental and may not work as expected.") # type: ignore | ||
else: | ||
import numpy as np | ||
from scipy.special import gammaln | ||
from scipy.stats import gmean | ||
|
||
try: | ||
from numba import jit # type: ignore | ||
except ImportError: | ||
_MODULES_CHECK["numba"] = False | ||
|
||
def jit(fun: Callable) -> Callable: | ||
"""Dummy jit decorator for when numba/jax not installed.""" | ||
return fun |
Oops, something went wrong.