Skip to main content

Get SuiteSparse matrices into Python

Project description

suitesparseget

suitesparseget makes it easy to get matrices from the SuiteSparse Matrix Collection into Python. It provides a simple interface to download and access matrices from the collection, which is a widely used resource for testing and benchmarking numerical algorithms.

It is a modern version of ssgetpy, which allows downloading of matrix files, but does not provide a method to import them into Python.

suitesparseget uses the pandas library to manage the index of matrices, which allows easier manipulation and filtering of the data than ssgetpy.

An example in examples/ssget_example.py utilizes my C++Sparse library to make spy plots of the matrices.

The repo is a work in progress, so check back soon for more features and examples!

Usage

import suitesparseget as ssg

df = ssg.get_index()  # get the index of matrices
print(df.head())  # print the first few rows of the index

# Get a problem from the index
problem = ssg.get_problem(index=df, name='arc130')
print(problem)

Configuration

You can configure the download directory for matrices by creating a suitesparseget.toml file. On import, suitesparseget will look for this file in:

  1. the current working directory
  2. the user's home directory
  3. the default data directory (~/.suitesparseget). The first file found will be used. If no configuration file is found, data will be downloaded to the default data directory (~/.suitesparseget).

The configuration file can contain the following sections:

[paths]
data_directory = '.suitesparseget'

The path can either be absolute, or relative to the user's home directory.

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

suitesparsegetpy-0.1.1.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

suitesparsegetpy-0.1.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file suitesparsegetpy-0.1.1.tar.gz.

File metadata

  • Download URL: suitesparsegetpy-0.1.1.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for suitesparsegetpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1a9d5efc3ba3d483ec30a453157e222a4c203646c25414660e1992f642840c61
MD5 8c602964a2f84da91a1f479d62cee82e
BLAKE2b-256 d2535f9567c406385014a2d9924f1895b417c2d19b2073ca48745d219b07b668

See more details on using hashes here.

File details

Details for the file suitesparsegetpy-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for suitesparsegetpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55f627acfb0f68540b4858d1fe8fc109925c0f7bae6f2296eeb3428d2cfbc200
MD5 7e3a40c8b1b30d7df8a1b3a850db5243
BLAKE2b-256 10cb81139f70b3550543eaed32b3669992b7b30b194700c0bd82c598a2148be0

See more details on using hashes here.

Supported by

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