Skip to main content

Show sparsity patterns of sparse matrices

Project description

betterspy

CircleCI codecov Code style: black PyPI pyversions PyPi Version GitHub stars

Show sparsity patterns of sparse matrices or write them to image files.

Example:

import betterspy

A = sparse.rand(20, 20, density=0.1)

# betterspy.plot()
# set attributes on gca()
# plt.show()
# or directly

betterspy.show(A)

betterspy.write_png(
    "out.png", A,
    # border_width=2,
    # border_color="red",
    # colormap="viridis"
    )
no colormap viridis

There is a command-line tool that can be used to show matrix-market files:

betterspy msc00726.mtx [out.png]

See betterspy -h for all options.

Installation

betterspy is available from the Python Package Index, so simply do

pip install betterspy

to install.

Testing

To run the betterspy unit tests, check out this repository and type

pytest

License

This software is published under the GPLv3 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

betterspy-0.1.3.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

betterspy-0.1.3-py3-none-any.whl (17.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page