Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • computer-vision/kwarray
  • ben.boeckel/kwarray
  • jon.crall/kwarray
3 results
Show changes
Commits on Source (16)
# Autogenerated by ~/code/xcookie/xcookie/builders/gitlab_ci.py
include:
- local: .gitlab/rules.yml
stages:
# TEMPLATES
- lint
- build
- test
- gpgsign
- test
- deploy
.common_template: &common_template
tags:
......@@ -28,7 +26,17 @@ stages:
cache:
paths:
- .cache/pip
.build_template: &build_template
.build_sdist_template: &build_sdist_template
<<: *common_template
stage: build
script:
- python -m pip install setuptools>=0.8 wheel build twine
- python -m build --sdist --outdir dist
- python -m twine check ./dist/kwarray*.tar.gz
artifacts:
paths:
- ./dist/kwarray*.tar.gz
.build_wheel_template: &build_wheel_template
<<: *common_template
stage: build
before_script:
......@@ -66,10 +74,16 @@ stages:
- echo "Installing helpers"
- pip install setuptools>=0.8 setuptools_scm wheel build -U
- pip install tomli pkginfo
- export WHEEL_FPATH=$(python -c "import pathlib;
print(str(sorted(pathlib.Path('dist').glob('kwarray*.whl'))[-1]).replace(chr(92),
chr(47)))")
- export MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)")
- "export WHEEL_FPATH=$(python -c \"if 1:\n import pathlib\n dist_dpath =
pathlib.Path('dist')\n candidates = list(dist_dpath.glob('kwarray*.whl'))\n\
\ candidates += list(dist_dpath.glob('kwarray*.tar.gz'))\n fpath = sorted(candidates)[-1]\n\
\ print(str(fpath).replace(chr(92), chr(47)))\n\")"
- "export MOD_VERSION=$(python -c \"if 1:\n from pkginfo import Wheel, SDist\n\
\ fpath = '$WHEEL_FPATH'\n cls = Wheel if fpath.endswith('.whl') else SDist\n\
\ print(cls(fpath).version)\n\")"
- echo "WHEEL_FPATH=$WHEEL_FPATH"
- echo "INSTALL_EXTRAS=$INSTALL_EXTRAS"
- echo "MOD_VERSION=$MOD_VERSION"
- pip install --prefer-binary "kwarray[$INSTALL_EXTRAS]==$MOD_VERSION" -f dist
- echo "Install finished."
- echo "Creating test sandbox directory"
......@@ -115,10 +129,16 @@ stages:
- echo "Installing helpers"
- pip install setuptools>=0.8 setuptools_scm wheel build -U
- pip install tomli pkginfo
- export WHEEL_FPATH=$(python -c "import pathlib;
print(str(sorted(pathlib.Path('dist').glob('kwarray*.whl'))[-1]).replace(chr(92),
chr(47)))")
- export MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)")
- "export WHEEL_FPATH=$(python -c \"if 1:\n import pathlib\n dist_dpath =
pathlib.Path('dist')\n candidates = list(dist_dpath.glob('kwarray*.whl'))\n\
\ candidates += list(dist_dpath.glob('kwarray*.tar.gz'))\n fpath = sorted(candidates)[-1]\n\
\ print(str(fpath).replace(chr(92), chr(47)))\n\")"
- "export MOD_VERSION=$(python -c \"if 1:\n from pkginfo import Wheel, SDist\n\
\ fpath = '$WHEEL_FPATH'\n cls = Wheel if fpath.endswith('.whl') else SDist\n\
\ print(cls(fpath).version)\n\")"
- echo "WHEEL_FPATH=$WHEEL_FPATH"
- echo "INSTALL_EXTRAS=$INSTALL_EXTRAS"
- echo "MOD_VERSION=$MOD_VERSION"
- pip install --prefer-binary "kwarray[$INSTALL_EXTRAS]==$MOD_VERSION" -f dist
- echo "Install finished."
- echo "Creating test sandbox directory"
......@@ -164,10 +184,16 @@ stages:
- echo "Installing helpers"
- pip install setuptools>=0.8 setuptools_scm wheel build -U
- pip install tomli pkginfo
- export WHEEL_FPATH=$(python -c "import pathlib;
print(str(sorted(pathlib.Path('dist').glob('kwarray*.whl'))[-1]).replace(chr(92),
chr(47)))")
- export MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)")
- "export WHEEL_FPATH=$(python -c \"if 1:\n import pathlib\n dist_dpath =
pathlib.Path('dist')\n candidates = list(dist_dpath.glob('kwarray*.whl'))\n\
\ candidates += list(dist_dpath.glob('kwarray*.tar.gz'))\n fpath = sorted(candidates)[-1]\n\
\ print(str(fpath).replace(chr(92), chr(47)))\n\")"
- "export MOD_VERSION=$(python -c \"if 1:\n from pkginfo import Wheel, SDist\n\
\ fpath = '$WHEEL_FPATH'\n cls = Wheel if fpath.endswith('.whl') else SDist\n\
\ print(cls(fpath).version)\n\")"
- echo "WHEEL_FPATH=$WHEEL_FPATH"
- echo "INSTALL_EXTRAS=$INSTALL_EXTRAS"
- echo "MOD_VERSION=$MOD_VERSION"
- pip install --prefer-binary "kwarray[$INSTALL_EXTRAS]==$MOD_VERSION" -f dist
- echo "Install finished."
- echo "Creating test sandbox directory"
......@@ -213,10 +239,16 @@ stages:
- echo "Installing helpers"
- pip install setuptools>=0.8 setuptools_scm wheel build -U
- pip install tomli pkginfo
- export WHEEL_FPATH=$(python -c "import pathlib;
print(str(sorted(pathlib.Path('dist').glob('kwarray*.whl'))[-1]).replace(chr(92),
chr(47)))")
- export MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)")
- "export WHEEL_FPATH=$(python -c \"if 1:\n import pathlib\n dist_dpath =
pathlib.Path('dist')\n candidates = list(dist_dpath.glob('kwarray*.whl'))\n\
\ candidates += list(dist_dpath.glob('kwarray*.tar.gz'))\n fpath = sorted(candidates)[-1]\n\
\ print(str(fpath).replace(chr(92), chr(47)))\n\")"
- "export MOD_VERSION=$(python -c \"if 1:\n from pkginfo import Wheel, SDist\n\
\ fpath = '$WHEEL_FPATH'\n cls = Wheel if fpath.endswith('.whl') else SDist\n\
\ print(cls(fpath).version)\n\")"
- echo "WHEEL_FPATH=$WHEEL_FPATH"
- echo "INSTALL_EXTRAS=$INSTALL_EXTRAS"
- echo "MOD_VERSION=$MOD_VERSION"
- pip install --prefer-binary "kwarray[$INSTALL_EXTRAS]==$MOD_VERSION" -f dist
- echo "Install finished."
- echo "Creating test sandbox directory"
......@@ -241,54 +273,16 @@ stages:
- |-
python -m pytest --verbose -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --durations=100 --cov="$MOD_NAME" "$MOD_DPATH" ../tests
- echo "pytest command finished, moving the coverage file to the repo root"
build/cp36-linux-x86_64:
<<: *build_template
image: python:3.6
test/minimal-loose/cp36-linux-x86_64:
<<: *test_minimal-loose_template
image: python:3.6
needs:
- build/cp36-linux-x86_64
test/full-loose/cp36-linux-x86_64:
<<: *test_full-loose_template
image: python:3.6
needs:
- build/cp36-linux-x86_64
test/minimal-strict/cp36-linux-x86_64:
<<: *test_minimal-strict_template
image: python:3.6
needs:
- build/cp36-linux-x86_64
test/full-strict/cp36-linux-x86_64:
<<: *test_full-strict_template
image: python:3.6
needs:
- build/cp36-linux-x86_64
build/cp37-linux-x86_64:
<<: *build_template
image: python:3.7
test/minimal-loose/cp37-linux-x86_64:
build/sdist:
<<: *build_sdist_template
image: python:3.11
test/sdist/minimal-loose/cp311-linux-x86_64:
<<: *test_minimal-loose_template
image: python:3.7
needs:
- build/cp37-linux-x86_64
test/full-loose/cp37-linux-x86_64:
<<: *test_full-loose_template
image: python:3.7
needs:
- build/cp37-linux-x86_64
test/minimal-strict/cp37-linux-x86_64:
<<: *test_minimal-strict_template
image: python:3.7
needs:
- build/cp37-linux-x86_64
test/full-strict/cp37-linux-x86_64:
<<: *test_full-strict_template
image: python:3.7
image: python:3.11
needs:
- build/cp37-linux-x86_64
- build/sdist
build/cp38-linux-x86_64:
<<: *build_template
<<: *build_wheel_template
image: python:3.8
test/minimal-loose/cp38-linux-x86_64:
<<: *test_minimal-loose_template
......@@ -311,7 +305,7 @@ test/full-strict/cp38-linux-x86_64:
needs:
- build/cp38-linux-x86_64
build/cp39-linux-x86_64:
<<: *build_template
<<: *build_wheel_template
image: python:3.9
test/minimal-loose/cp39-linux-x86_64:
<<: *test_minimal-loose_template
......@@ -334,7 +328,7 @@ test/full-strict/cp39-linux-x86_64:
needs:
- build/cp39-linux-x86_64
build/cp310-linux-x86_64:
<<: *build_template
<<: *build_wheel_template
image: python:3.10
test/minimal-loose/cp310-linux-x86_64:
<<: *test_minimal-loose_template
......@@ -357,7 +351,7 @@ test/full-strict/cp310-linux-x86_64:
needs:
- build/cp310-linux-x86_64
build/cp311-linux-x86_64:
<<: *build_template
<<: *build_wheel_template
image: python:3.11
test/minimal-loose/cp311-linux-x86_64:
<<: *test_minimal-loose_template
......@@ -380,7 +374,7 @@ test/full-strict/cp311-linux-x86_64:
needs:
- build/cp311-linux-x86_64
build/cp312-linux-x86_64:
<<: *build_template
<<: *build_wheel_template
image: python:3.12
test/minimal-loose/cp312-linux-x86_64:
<<: *test_minimal-loose_template
......@@ -419,6 +413,7 @@ gpgsign/wheels:
artifacts:
paths:
- dist/*.asc
- dist/*.tar.gz
- dist/*.whl
- dist/*.ots
only:
......@@ -429,21 +424,6 @@ gpgsign/wheels:
- master
- main
- release
needs:
- job: build/cp36-linux-x86_64
artifacts: true
- job: build/cp37-linux-x86_64
artifacts: true
- job: build/cp38-linux-x86_64
artifacts: true
- job: build/cp39-linux-x86_64
artifacts: true
- job: build/cp310-linux-x86_64
artifacts: true
- job: build/cp311-linux-x86_64
artifacts: true
- job: build/cp312-linux-x86_64
artifacts: true
script:
- ls dist
- export GPG_EXECUTABLE=gpg
......@@ -466,7 +446,7 @@ gpgsign/wheels:
- GPG_SIGN_CMD="$GPG_EXECUTABLE --batch --yes --detach-sign --armor --local-user
$GPG_KEYID"
- |-
WHEEL_PATHS=(dist/*.whl)
WHEEL_PATHS=(dist/*.whl dist/*.tar.gz)
WHEEL_PATHS_STR=$(printf '"%s" ' "${WHEEL_PATHS[@]}")
echo "$WHEEL_PATHS_STR"
for WHEEL_PATH in "${WHEEL_PATHS[@]}"
......@@ -479,7 +459,20 @@ gpgsign/wheels:
done
- ls dist
- python -m pip install opentimestamps-client
- ots stamp dist/*.whl dist/*.asc
- ots stamp dist/*.tar.gz dist/*.whl dist/*.asc
needs:
- job: build/sdist
artifacts: true
- job: build/cp38-linux-x86_64
artifacts: true
- job: build/cp39-linux-x86_64
artifacts: true
- job: build/cp310-linux-x86_64
artifacts: true
- job: build/cp311-linux-x86_64
artifacts: true
- job: build/cp312-linux-x86_64
artifacts: true
deploy/wheels:
<<: *common_template
image: python:3.11
......@@ -491,7 +484,7 @@ deploy/wheels:
- pip install pyopenssl ndg-httpsclient pyasn1 requests[security] twine -U
- ls dist
- |-
WHEEL_PATHS=(dist/*.whl)
WHEEL_PATHS=(dist/*.whl dist/*.tar.gz)
WHEEL_PATHS_STR=$(printf '"%s" ' "${WHEEL_PATHS[@]}")
source dev/secrets_configuration.sh
TWINE_PASSWORD=${!VARNAME_TWINE_PASSWORD}
......@@ -500,7 +493,7 @@ deploy/wheels:
for WHEEL_PATH in "${WHEEL_PATHS[@]}"
do
twine check $WHEEL_PATH.asc $WHEEL_PATH
twine upload --username $TWINE_USERNAME --password $TWINE_PASSWORD $WHEEL_PATH.asc $WHEEL_PATH || echo "upload already exists"
twine upload --username $TWINE_USERNAME --password $TWINE_PASSWORD $WHEEL_PATH || echo "upload already exists"
done
- |-
# Have the server git-tag the release and push the tags
......
......@@ -4,10 +4,17 @@ This changelog follows the specifications detailed in: [Keep a Changelog](https:
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), although we have not yet reached a `1.0.0` release.
## Version 0.6.20 - Unreleased
## Version 0.7.0 - Unreleased
### Removed
* Removed support for Python 3.6 and 3.7
## Version 0.6.19 - Released 2024-08-14
### Fixed
* Now correctly respect the shape arguments in `kwarray.distributions.Mixture.sample`
* Binomial was previously broken and now returns correct values from sample.
## Version 0.6.19 - Released 2024-06-19
### Added
......
include requirements/*.txt
\ No newline at end of file
U2FsdGVkX1+H0wriugy6KIL8ChVaZINoBkwWU+9muLRTIGHY9mmq2su1dZWty5ga
6Axar+6JXnLt2qiI26a0SinJNap6RZZ0sRq2Z6u3GzgwZxj6JwP9tsMbn0b/1jvG
cFEqMT0gvRb3AAEgcXGQMkOlpAFZ2FTQTCTbLOOYomm6LVnzk42XLc50f+n0HwVz
bIlSh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7Ef
N3kALARv6SCCkedGYVXLMA9goALwhk9y/l6WypqAj633Vc+Sis5XqXeebKWS6NR0
uTFfRJJgcArB7KskehXY78na2Ss9U9XBoK9s4hYG2qg1TrAgKYqS7rpJJPHRvHga
jJdCAcYQaZYvfA96YnVN9unGeWHnwg6yoV8F+8CRjpmYM3i4GxLFwJ0OSpq/Z9BS
JqlgsiSAKYEpQE2AbvKPeA==
U2FsdGVkX1+xaPk9cuqrqEJYuqdm3Qg8BzuJbhPg42ZymMGcRSHHNFzXTinEzTS1
OpcovfpMnnqUhezui04r0DrtRLAzg948kqmk4IUS7kGoZSmblSpjqQInPi8zCKey
i6oalPczYN1flGAGkLVeoRZkj7Nslk0Q0iyiROD2YmRb5h4O35XOqVpi945Z9ZSx
cHiC14TlrrQidaPLH6sNxiTcG3R31SP+uSY8E2s/GNFd8u9wismwq2ccBfeFQRLM
dRP4TcnBK9dXMqJ1QGso9WPJ01gKxXz+SqGuGVq/OAjyXXePVfMCgWqsqpjHrqij
0YfGaeSAvBF+EdTCug2lP4KTyfHNHR2tlPM/q+xMCP2CGY0DWO1sWTEQUEed9T+h
dHDviwpvf9X1ypXaWkB6Jwey4dRnho63c3F5QcuxcIE=
......@@ -17,7 +17,7 @@ Notes:
# need to edit the conf.py
cd ~/code/kwarray/docs
sphinx-apidoc --private --separate -f -o ~/code/kwarray/docs/source/auto ~/code/kwarray/kwarray
sphinx-apidoc --private --separate --force --output-dir ~/code/kwarray/docs/source/auto ~/code/kwarray/kwarray
# Note: the module should importable before running this
# (e.g. install it in developer mode or munge the PYTHONPATH)
......@@ -37,17 +37,17 @@ Notes:
### For gitlab
The user will need to enable the repo on their readthedocs account:
https://readthedocs.org/dashboard/import/manual/?
To enable the read-the-docs go to https://readthedocs.org/dashboard/ and login
Make sure you have a .readthedocs.yml file
The user will need to enable the repo on their readthedocs account:
https://readthedocs.org/dashboard/import/manual/?
Click import project: (for github you can select, but gitlab you need to import manually)
Enter the following information:
Set the Repository NAME: kwarray
Set the Repository URL: https://gitlab.kitware.com/computer-vision/kwarray
Make sure you have a .readthedocs.yml file
For gitlab you also need to setup an integrations. Navigate to:
https://readthedocs.org/dashboard/kwarray/integrations/create/
......
......@@ -25,7 +25,7 @@ __explicit__ = [
'ArrayAPI', 'dtype_info',
]
__version__ = '0.6.20'
__version__ = '0.7.0'
from kwarray.arrayapi import ArrayAPI, dtype_info
# Everything after this point is autogenerated
......
......@@ -65,6 +65,11 @@ import sys
import ubelt as ub
from functools import partial
try:
from functools import cache
except ImportError:
from ubelt import memoize as cache
try:
from packaging.version import parse as Version
except ImportError:
......@@ -150,7 +155,7 @@ Numeric = Union[Number, ArrayLike, Tensor]
"""
class _ImplRegistry(object):
class _ImplRegistry:
def __init__(self):
self.registered = {
'torch': {},
......@@ -217,6 +222,17 @@ class _ImplRegistry(object):
"""
Checks to make sure all methods are implemented in both
torch and numpy implementations as well as exposed in the ArrayAPI.
This is intended for developer use.
CommandLine:
REGEN=1 xdoctest -m kwarray.arrayapi _ImplRegistry._ensure_datamethods_names_are_registered
Example:
>>> # xdoctest: +REQUIRES(env:REGEN)
>>> import kwarray
>>> self = kwarray.arrayapi._REGISTERY
>>> self._ensure_datamethods_names_are_registered()
"""
# Check that we didn't forget to add anything
# api_names = {
......@@ -288,7 +304,7 @@ _numpymethod = partial(_REGISTERY._implmethod, impl='numpy')
_apimethod = _REGISTERY._apimethod
class TorchImpls(object):
class TorchImpls:
"""
Torch backend for the ArrayAPI API
"""
......@@ -1158,7 +1174,7 @@ class TorchImpls(object):
return torch.softmax(data, dim=axis)
class NumpyImpls(object):
class NumpyImpls:
"""
Numpy backend for the ArrayAPI API
"""
......@@ -1658,6 +1674,9 @@ class ArrayAPI:
array_equal = _apimethod('array_equal')
isclose = _apimethod('isclose', func_type='data_func')
allclose = _apimethod('allclose', func_type='data_func')
log2 = _apimethod('log2', func_type='data_func')
log = _apimethod('log', func_type='data_func')
copy = _apimethod('copy', func_type='data_func')
......@@ -1682,7 +1701,7 @@ TorchNumpyCompat = ArrayAPI # backwards compat
# _REGISTERY._ensure_datamethods_names_are_registered()
@ub.memoize
@cache
def _torch_dtype_lut():
try:
import torch
......
......@@ -28,7 +28,6 @@ import fractions # NOQA
from kwarray.util_random import ensure_rng
inf = float('inf')
# __all__ = [
class Value(ub.NiceRepr):
......@@ -589,7 +588,7 @@ class Distribution(Parameterized, _RBinOpMixin):
random coercable
CommandLine:
xdoctest -m /home/joncrall/code/kwarray/kwarray/distributions.py Distribution.random --show
xdoctest -m kwarray.distributions Distribution.random --show
Example:
>>> # xdoctest: +REQUIRES(module:scipy)
......@@ -679,10 +678,12 @@ class Distribution(Parameterized, _RBinOpMixin):
Example:
>>> from kwarray.distributions import Normal # NOQA
>>> self = Normal()
>>> # xdoctest: +REQUIRES(module:kwplot)
>>> # xdoctest: +REQUIRES(--show)
>>> import kwplot
>>> kwplot.autompl()
>>> self.plot(n=1000)
>>> kwplot.show_if_requested()
"""
import seaborn as sns
if isinstance(n, str):
......@@ -802,19 +803,24 @@ class Mixture(MixedDistribution):
>>> # Given two normal distributions,
>>> from kwarray.distributions import Normal # NOQA
>>> from kwarray.distributions import * # NOQA
>>> n1 = Normal(mean=11, std=3)
>>> n2 = Normal(mean=53, std=5)
>>> n1 = Normal(mean=11, std=3, rng=0)
>>> n2 = Normal(mean=53, std=5, rng=0)
>>> composed = (n1 * 0.3) + (n2 * 0.7)
>>> mixture = Mixture([n1, n2], [0.3, 0.7])
>>> mixture = Mixture([n1, n2], [0.3, 0.7], rng=0)
>>> sample_scalar = mixture.sample()
>>> sample_vector = mixture.sample(2)
>>> sample_matrix = mixture.sample(2, 3)
>>> assert sample_scalar.shape == tuple()
>>> assert sample_vector.shape == (2,)
>>> assert sample_matrix.shape == (2, 3)
>>> # xdoctest: +REQUIRES(--show)
>>> import kwplot
>>> kwplot.autompl()
>>> kwplot.figure(fnum=1, pnum=(2, 2, 1))
>>> ax = kwplot.figure(pnum=(2, 1, 1), title='n1 & n2').gca()
>>> n = 10000
>>> plotkw = dict(stat='density', kde=1, bins=1000)
>>> #plotkw = dict(stat='density', kde=1, bins=1000)
>>> plotkw = dict(stat='count', kde=1, bins=1000)
>>> #plotkw = dict(stat='frequency', kde=1, bins='auto')
>>> n1.plot(n, ax=ax, **plotkw)
>>> n2.plot(n, ax=ax, **plotkw)
>>> ax=kwplot.figure(pnum=(2, 2, 3), title='composed').gca()
......@@ -841,7 +847,7 @@ class Mixture(MixedDistribution):
# Choose which distributions are picked for each sample
idxs = self._idx_choice.sample(*shape)
idx_to_nsamples = ub.dict_hist(idxs.ravel())
out = np.zeros(*shape)
out = np.zeros(shape)
for idx, n in idx_to_nsamples.items():
# Sample the from the distribution we picked
mask = (idx == idxs)
......@@ -919,6 +925,7 @@ class Composed(MixedDistribution):
>>> kwplot.autompl()
>>> kwplot.figure(fnum=1, doclf=True)
>>> self.plot(1000, bins=100)
>>> kwplot.show_if_requested()
Example:
>>> # Binary operations result in composed distributions
......@@ -935,6 +942,7 @@ class Composed(MixedDistribution):
>>> kwplot.autompl()
>>> kwplot.figure(fnum=1, doclf=True)
>>> self.plot(5000, bins=100)
>>> kwplot.show_if_requested()
"""
__params__ = ub.odict([
......@@ -1005,6 +1013,7 @@ class Uniform(ContinuousDistribution):
"""
from scipy.stats import uniform
rv = uniform(self.low, self.high)
rv.random_state = self.rng
return rv
@classmethod
......@@ -1038,6 +1047,7 @@ class Exponential(ContinuousDistribution):
>>> kwplot.autompl()
>>> kwplot.figure(fnum=1, doclf=True)
>>> self.plot(500, bins=25)
>>> kwplot.show_if_requested()
Args:
scale (int) : no help given. Defaults to 1.
......@@ -1059,6 +1069,7 @@ class Exponential(ContinuousDistribution):
"""
from scipy.stats import expon
rv = expon(self.scale)
rv.random_state = self.rng
return rv
......@@ -1134,6 +1145,7 @@ class Normal(ContinuousDistribution):
>>> kwplot.autompl()
>>> kwplot.figure(fnum=1, doclf=True)
>>> self.plot(500, bins=25)
>>> kwplot.show_if_requested()
"""
__params__ = ub.odict([
('mean', Value(0.0)),
......@@ -1143,6 +1155,7 @@ class Normal(ContinuousDistribution):
def __scipy__(self):
from scipy.stats import norm
rv = norm(self.mean, self.std)
rv.random_state = self.rng
return rv
def sample(self, *shape):
......@@ -1175,7 +1188,7 @@ class TruncNormal(ContinuousDistribution):
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.truncnorm.html
CommandLine:
xdoctest -m /home/joncrall/code/kwarray/kwarray/distributions.py TruncNormal
xdoctest -m kwarray.distributions TruncNormal
Example:
>>> # xdoctest: +REQUIRES(module:scipy)
......@@ -1218,6 +1231,7 @@ class TruncNormal(ContinuousDistribution):
self.a = (self.low - self.mean) / self.std
self.b = (self.high - self.mean) / self.std
self.rv = truncnorm(a=self.a, b=self.b, loc=self.mean, scale=self.std)
self.rv.random_state = self.rng
@classmethod
def random(cls, rng=None):
......@@ -1260,6 +1274,7 @@ class Bernoulli(DiscreteDistribution):
"""
from scipy.stats import bernoulli
rv = bernoulli(self.p)
rv.random_state = self.rng
return rv
@classmethod
......@@ -1281,7 +1296,16 @@ class Binomial(DiscreteDistribution):
probability of success p and a probability of failure 1 - p.
References:
https://en.wikipedia.org/wiki/Binomial_distribution
.. [BinomDistr] https://en.wikipedia.org/wiki/Binomial_distribution
Example:
>>> # xdoctest: +REQUIRES(module:scipy)
>>> from kwarray.distributions import * # NOQA
>>> self = Binomial(p=0.1, n=100, rng=0)
>>> self.sample()
10
>>> self.sample(10)
array([12, 11, 10, 9, 11, 9, 14, 16, 9, 12])
Example:
>>> # xdoctest: +REQUIRES(module:scipy)
......@@ -1298,10 +1322,14 @@ class Binomial(DiscreteDistribution):
def __scipy__(self):
from scipy.stats import binom
rv = binom(self.n, self.p)
# References:
# https://stackoverflow.com/questions/16016959/scipy-stats-seed
rv.random_state = self.rng
return rv
def sample(self, *shape):
return self.rng.rand(*shape) > self.p
rv = self.__scipy__()
return rv.rvs(size=shape, random_state=self.rng)
# class Multinomial(Distribution):
......@@ -1461,6 +1489,7 @@ class PDF(Distribution):
>>> kwplot.autompl()
>>> kwplot.figure(fnum=1, doclf=True)
>>> self.plot(5000, bins=50)
>>> kwplot.show_if_requested()
"""
def __init__(self, x, p, rng=None):
import scipy.interpolate as interpolate
......
......@@ -171,7 +171,10 @@ def standard_normal32(size, mean=0, std=1, rng=np.random):
# The integer and float dtype must have the same number of bits
dtype = np.float32
int_dtype = np.uint32
MAX_INT = np.core.getlimits.iinfo(int_dtype).max
try:
MAX_INT = np.iinfo(int_dtype).max
except AttributeError:
MAX_INT = np.core.getlimits.iinfo(int_dtype).max
# Preallocate output
out = np.empty(size, dtype=dtype)
......@@ -311,7 +314,10 @@ def uniform32(low=0.0, high=1.0, size=None, rng=np.random):
# The cuttoff size seems to be (42 * 42).
dtype = np.float32
int_dtype = np.uint32
MAX_INT = np.core.getlimits.iinfo(int_dtype).max
try:
MAX_INT = np.iinfo(int_dtype).max
except AttributeError:
MAX_INT = np.core.getlimits.iinfo(int_dtype).max
# Generate uniform-01 random numbers that we will transform
out = rng.randint(0, MAX_INT - 1, size=size, dtype=int_dtype).astype(dtype)
if low == 0 and high == 1.0:
......
......@@ -79,6 +79,7 @@ def one_hot_embedding(labels, num_classes, dim=1):
"""
torch = sys.modules.get('torch', None)
if torch is not None and torch.is_tensor(labels):
# TODO: dtype
in_dims = labels.ndimension()
if dim < 0:
dim = in_dims - dim + 1
......
......@@ -16,7 +16,7 @@ repo_name = "kwarray"
rel_mod_parent_dpath = "."
#ci_cpython_versions = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
os = [ "osx", "all", "win", "linux",]
min_python = 3.6
min_python = 3.8
max_python = 3.12
version = "{mod_dpath}/__init__.py::__version__"
author = "Kitware Inc., Jon Crall"
......
......@@ -7,7 +7,5 @@ numpy>=1.23.2 ; python_version < '3.12' and python_version >= '3.11' # Pyt
numpy>=1.21.6 ; python_version < '3.11' and python_version >= '3.10' # Python 3.10
numpy>=1.19.3 ; python_version < '3.10' and python_version >= '3.9' # Python 3.9
numpy>=1.19.3 ; python_version < '3.9' and python_version >= '3.8' # Python 3.8
numpy>=1.19.3,<2.0 ; python_version < '3.8' and python_version >= '3.7' # Python 3.7
numpy>=1.19.3,<2.0 ; python_version < '3.7' and python_version >= '3.6' # Python 3.6
packaging>=21.3
pytest >= 6.2.5 ; python_version < '4.0' and python_version >= '3.11' # Python 3.11+
pytest >= 6.2.5 ; python_version < '3.11' and python_version >= '3.10' # Python 3.10
pytest >= 4.6.0 ; python_version < '3.10.0' and python_version >= '3.7.0' # Python 3.7-3.9
pytest >= 4.6.0 ; python_version < '3.7.0' and python_version >= '3.6.0' # Python 3.6
pytest >= 4.6.0, <= 6.1.2 ; python_version < '3.6.0' and python_version >= '3.5.0' # Python 3.5
pytest >= 4.6.0, <= 4.6.11 ; python_version < '3.5.0' and python_version >= '3.4.0' # Python 3.4
pytest >= 4.6.0, <= 4.6.11 ; python_version < '2.8.0' and python_version >= '2.7.0' # Python 2.7
coverage>=5.2.1 ; python_version >= '3.6' # Python 3.6+
coverage>=4.4.0 ; python_version < '3.6' and python_version >= '2.7' # Python 2.7
......
......@@ -211,6 +211,7 @@ if __name__ == "__main__":
"tests": parse_requirements("requirements/tests.txt", versions="loose"),
"optional": parse_requirements("requirements/optional.txt", versions="loose"),
"docs": parse_requirements("requirements/docs.txt", versions="loose"),
"linting": parse_requirements("requirements/linting.txt", versions="loose"),
"all-strict": parse_requirements("requirements.txt", versions="strict"),
"runtime-strict": parse_requirements(
"requirements/runtime.txt", versions="strict"
......@@ -220,6 +221,9 @@ if __name__ == "__main__":
"requirements/optional.txt", versions="strict"
),
"docs-strict": parse_requirements("requirements/docs.txt", versions="strict"),
"linting-strict": parse_requirements(
"requirements/linting.txt", versions="strict"
),
}
setupkw["name"] = NAME
setupkw["version"] = VERSION
......@@ -231,7 +235,7 @@ if __name__ == "__main__":
setupkw["long_description_content_type"] = "text/x-rst"
setupkw["license"] = "Apache 2"
setupkw["packages"] = find_packages(".")
setupkw["python_requires"] = ">=3.6"
setupkw["python_requires"] = ">=3.8"
setupkw["classifiers"] = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
......@@ -241,8 +245,6 @@ if __name__ == "__main__":
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
......
......@@ -120,6 +120,8 @@ def test_numpy_torch_compat():
'clip',
'array_equal',
'isclose',
'allclose',
}
if arrayapi._TORCH_LT_1_7_0:
......@@ -152,6 +154,7 @@ def test_numpy_torch_compat():
flag = True
if isinstance(np_result1, tuple):
for a, b in ub.iter_window(results, 2):
# flag &= ub.IndexableWalker(a, list_cls=(np.ndarray, torch.Tensor, tuple, list)).allclose(b)
flag &= indexable_allclose(a, b)
else:
results = [ArrayAPI.numpy(r) for r in results]
......@@ -160,3 +163,11 @@ def test_numpy_torch_compat():
if not flag:
errors.append(row)
if __name__ == '__main__':
"""
CommandLine:
python ~/code/kwarray/tests/test_arrayapi.py
"""
test_numpy_torch_compat()
......@@ -46,7 +46,7 @@ def test_stitcher_grid():
}
results = []
gauss_weights = kwimage.gaussian_patch(window_dims)
gauss_weights = kwimage.normalize(gauss_weights)
gauss_weights = kwarray.normalize(gauss_weights)
for params in ub.named_product(basis):
if params['weighted'] == 'none':
weights = None
......