Install & Compatibility
Where this runs
tested against v0.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 2.748s · 232.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 8.3s · import 2.688s · 224MB
231MB installed
● package 231MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
gammainc
✓ from autograd_gamma import gammainc
gammaincln
✓ from autograd_gamma import gammaincln
betainc
✓ from autograd_gamma import betainc
✗ from autograd_gamma import beta_inc
Common misspelling, functions use 'inc' suffix directly.
This example demonstrates how to use `autograd-gamma` functions within the `autograd` framework to compute gradients. It uses `autograd.numpy` for array operations, which is crucial for automatic differentiation with `autograd`.
import autograd.numpy as np
from autograd import grad
from autograd_gamma import gammainc
# Define a function using autograd-gamma's gammainc
def calculate_value(x):
# For autograd, inputs to gammainc should be autograd.numpy arrays
# The 'a' parameter (first argument) is the shape parameter, 'x' is the integral upper limit
return gammainc(2.0, x) # Example: incomplete gamma function for a=2.0
# Compute the gradient of the function with respect to x
gradient_function = grad(calculate_value)
# Test with a value (must be an autograd.numpy array for gradient)
x_val = np.array(0.5)
value = calculate_value(x_val)
gradient = gradient_function(x_val)
print(f"Function value gammainc(2.0, {x_val}) = {value}")
print(f"Gradient d/dx gammainc(2.0, x) at x={x_val} = {gradient}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'autograd_gamma'
The 'autograd-gamma' package is not installed in the Python environment.
fixInstall the package using pip: 'pip install autograd-gamma'.
ImportError: cannot import name 'gammainc' from 'autograd_gamma'
The function 'gammainc' is not available in the 'autograd_gamma' module.
fixEnsure you are using the correct function names as provided by the 'autograd_gamma' library.
AttributeError: module 'autograd_gamma' has no attribute 'gammainc'
Attempting to access a function that does not exist in the 'autograd_gamma' module.
fixVerify the available functions in 'autograd_gamma' and use the correct function names.
TypeError: 'module' object is not callable
Trying to call the 'autograd_gamma' module as a function.
fixImport and use specific functions from 'autograd_gamma' instead of calling the module directly.
ModuleNotFoundError: No module named 'autograd-gamma'
The `autograd-gamma` library is not installed in the Python environment or the environment where the code is being run.
fixInstall the library using pip: `pip install autograd-gamma`
Upgrade
Version history
0.5.0latest on PyPI · released Oct 15, 2020
Audit
Dependencies
autogradrequiredCore dependency for automatic differentiation capabilities.
numpyrequiredFundamental library for numerical operations; autograd-gamma functions typically operate on numpy arrays, specifically autograd.numpy arrays.