Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ jobs:
python-version: 3.9
cache: 'pip' # optional, adds caching for faster builds

- name: Install dependencies
- name: Install UncertainSCI
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r requirements.txt
pip install --editable .["dev"]

- name: Lint with flake8
run: |
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@ jobs:
- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
pip install -r requirements.txt

- name: Install UncertainSCI
run: |
pip install --editable ./
python -m pip install --upgrade pip
pip install --editable .["dev"]

- name: Run tests and compute coverage
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/**/generated/

# PyBuilder
target/
Expand Down
9 changes: 6 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ build:
os: ubuntu-22.04
tools:
python: "3.10"
apt_packages:
- pandoc

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand All @@ -23,6 +25,7 @@ formats: all
# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: requirements.txt
- requirements: docs/requirements.txt
- path: .
- method: pip
path: .
extra_requirements:
- docs
115 changes: 0 additions & 115 deletions INSTALL.md

This file was deleted.

4 changes: 3 additions & 1 deletion UncertainSCI/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@

"""
A modern Python-based mathematical uncertainty toolkit.
"""
58 changes: 34 additions & 24 deletions UncertainSCI/distributions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
"""
Classes and tools to define probability distributions.

For PCE (:ref:`pce`), these distributions are evolved through a forward model defining
the stochastic variation of model parameters.

Tensorizations within a distribution are possible across these families by
instantiating the distribution appropriately. Tensorizations across distributions
is also possible but requires individual instantiation of each distribution, followed
by a constructor call to the :class:`TensorialDistribution` class.

For example, a three-dimensional random variable :math:`Y = (Y_1, Y_2, Y_3)` can have
independent components, with the distribution of :math:`Y_1` normal, :math:`Y_2` beta,
and :math:`Y_3` exponential.
"""

import numpy as np
import scipy as sp
from scipy import sparse as sprs
Expand Down Expand Up @@ -630,23 +646,19 @@ class BetaDistribution(ProbabilityDistribution):
\\mu, \\sigma`.

Parameters:
alpha (float or iterable of floats, optional): Shape parameter
associated to right-hand boundary. Defaults to 1.
beta (float or iterable of floats, optional): Shape parameter
associated to left-hand boundary. Defaults to 1.
mean (float or iterable of floats, optional): Mean of the distribution.
Defaults to None.
stdev (float or iterable of floats, optional): Standard deviation of
the distribution. Defaults to None.
dim (int, optional): Dimension of the distribution. Defaults to None.
domain (numpy.ndarray or similar, of size 2 x `dim`, optional): Compact
hypercube that is the support of the distribution. Defaults to None
alpha: Shape parameter associated to right-hand boundary. Defaults to 1.
beta: Shape parameter associated to left-hand boundary. Defaults to 1.
mean: Mean of the distribution. Defaults to None.
stdev: Standard deviation of the distribution. Defaults to None.
dim: Dimension of the distribution. Defaults to None.
domain: Compact hypercube of size 2 x ``dim`` that is the support of
the distribution. Defaults to None.

Attributes:
dim (int): Dimension of the distribution.
alpha (float or np.ndarray): Shape parameter(s) alpha.
beta (float or np.ndarray): Shape parameter(s) beta.
polys (:class:`JacobiPolynomials` or list thereof):
dim: Dimension of the distribution.
alpha: Shape parameter(s) alpha.
beta: Shape parameter(s) beta.
polys: Jacobi polynomial family or list thereof.
"""
def __init__(self, alpha=None, beta=None, mean=None, stdev=None,
dim=None, domain=None, bounds=None):
Expand Down Expand Up @@ -992,17 +1004,15 @@ class UniformDistribution(BetaDistribution):
\\mu, \\sigma`.

Parameters:
mean (float or iterable of floats, optional): Mean of the distribution.
Defaults to None.
stdev (float or iterable of floats, optional): Standard deviation of
the distribution. Defaults to None.
dim (int, optional): Dimension of the distribution. Defaults to None.
domain (numpy.ndarray or similar, of size 2 x `dim`, optional): Compact
hypercube that is the support of the distribution. Defaults to None
mean: Mean of the distribution. Defaults to None.
stdev: Standard deviation of the distribution. Defaults to None.
dim: Dimension of the distribution. Defaults to None.
domain: Compact hypercube of size 2 x ``dim`` that is the support of
the distribution. Defaults to None.

Attributes:
dim (int): Dimension of the distribution.
polys (:class:`JacobiPolynomials` or list thereof):
dim: Dimension of the distribution.
polys: Jacobi polynomial family or list thereof.
"""

def __init__(self, mean=None, stdev=None, dim=None, domain=None, bounds=None):
Expand Down
6 changes: 2 additions & 4 deletions UncertainSCI/families.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Contains routines that specialize opoly1d things for classical orthogonal polynomial families
- jacobi polys
- hermite poly
- laguerre polys
Routines that specialize :mod:`UncertainSCI.opoly1d` for classical families of
orthogonal polynomials.
"""
import numpy as np

Expand Down
9 changes: 4 additions & 5 deletions UncertainSCI/indexing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Module containing indexing tools and families.
"""

from itertools import combinations

import numpy as np
Expand Down Expand Up @@ -463,8 +467,3 @@ def get_indices(self):
return super().get_indices()
else:
return hyperbolic_cross_indices(self.dim, self.order)


if __name__ == "__main__":

pass
Loading
Loading