# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           python 1.0

name                py-opt_einsum
version             3.2.1
revision            0

license             MIT
maintainers         nomaintainer
platforms           darwin
supported_archs     noarch

description         A tensor contraction order optimizer.

long_description    Optimized einsum can significantly reduce the\
                    overall execution time of einsum-like expressions\
                    (e.g., np.einsum, dask.array.einsum, pytorch.einsum,\
                    tensorflow.einsum) by optimizing the expression's\
                    contraction order and dispatching many operations\
                    to canonical BLAS, cuBLAS, or other specialized\
                    routines. Optimized einsum is agnostic to the backend\
                    and can handle NumPy, Dask, PyTorch, Tensorflow, CuPy,\
                    Sparse, Theano, JAX, and Autograd arrays as well as\
                    potentially any library which conforms to a standard API.

homepage            https://github.com/dgasmith/opt_einsum

checksums           rmd160  7a3ab41ecc26559b0f01ecfbc93453e7c84ab3ef \
                    sha256  83b76a98d18ae6a5cc7a0d88955a7f74881f0e567a0f4c949d24c942753eb998 \
                    size    72186

python.versions     37 38 39

if {${name} ne ${subport}} {
    depends_build-append \
                    port:py${python.version}-setuptools

    depends_lib-append \
                    port:py${python.version}-numpy

    depends_test-append \
                    port:py${python.version}-pytest

    test.run        yes
    test.cmd        py.test-${python.branch}
    test.target
    test.env        PYTHONPATH=${worksrcpath}/build/lib

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} LICENSE README.md \
            ${destroot}${docdir}
    }

    livecheck.type  none
}
