An open API service providing repository metadata for many open source software ecosystems.

GitHub / python-graphblas / python-graphblas

Python library for GraphBLAS: high-performance sparse linear algebra for scalable graph analytics

JSON API: http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-graphblas%2Fpython-graphblas
PURL: pkg:github/python-graphblas/python-graphblas

Stars: 139
Forks: 15
Open issues: 68

License: apache-2.0
Language: Jupyter Notebook
Size: 3.74 MB
Dependencies parsed at: Pending

Created at: about 6 years ago
Updated at: 19 days ago
Pushed at: 22 days ago
Last synced at: 3 days ago

Commit Stats

Commits: 768
Authors: 11
Mean commits per author: 69.82
Development Distribution Score: 0.163
More commit stats: https://commits.ecosyste.ms/hosts/GitHub/repositories/python-graphblas/python-graphblas

Topics: complex-networks, graph-algorithms, graph-analysis, graph-datastructures, graph-theory, graphblas, linear-algebra, numba, pydata, python, python-wrapper, sparse, sparse-data, sparse-matrix, suitesparse

Releases
2022.5.0

2022.5.0

Deprecations

  • require_monoid= keyword in ewise_add has been deprecated (#236)
    • New behavior is like require_monoid=False and will no longer raise

Improvements

  • Add IndexUnaryOp and gb.indexunary namespace (#229)
    • Apply works with both IndexUnaryOp and SelectOp
  • Add UDF support for IndexUnaryOp and SelectOp (#233)
  • Add x.get method to Scalar, Vector, and Matrix objects, with optional default value (#241)
    • These return a Python scalar of the element at the location, or default value if element is missing
  • Make aggregators callable (#242)
    • agg.sum(A) same as A.reduce_scalar(agg.sum)
    • agg.max(A, rowwise=True) same as A.reduce_rowwise(agg.max)
  • Add mask.new(), which can also merge two masks efficiently (#240)
    • The result is True wherever the mask(s) would have been applied, and empty otherwise
    • complement=True returns the complement
  • Allow A << 1 to create dense (iso-valued) matrices (this used to raise) (#243)
  • Add “index” and “value” strings to Vector repr (#226)
  • Add cbrt from SuiteSparse:GraphBLAS 7.1.0 to compute principal cube root (#244)
    • For example, cbrt(-8) == -2, and the result is a float
    • Also, add numpy ufuncs cbrt, float_power, and positive to the numpy namespaces (#237)
  • op.from_string now includes aggregators (last priority) (#235)
    • e.g., op.from_string("count") now works
  • Allow record dtypes to be created via dicts, such as {'x': int, 'y': float} (#227)
  • Allow scalars with record dtypes to be created from dicts (#228)
    • e.g., Scalar.from_value({'x': 1, 'y': True}, dtype=udt)
  • Added scripts/ folder in repo to help developers/contributors perform useful tasks (#231)
over 3 years ago
Download
2022.4.2

2022.4.2

  • Improvements to operators and user-defined functions (UDFs):
    • Allow Python functions to be passed as BinaryOp or UnaryOp, which will be automatically jitted
    • Add register_new and register_anonymous functions to e.g. gb.binary and gb.semiring namespaces
    • Add binary.binom to compute binomial coefficients exactly
  • Improvements to dtypes and user-defined types (UDTs):
    • Auto-register UDTs, which means non-builtin NumPy dtypes may be passed as the dtype
    • Improved default names of UDTs
    • Improved dtype inference for first, second, and pair binary operators
      • For example, first uses the dtype of the first argument, and pair defaults to INT64
  • Add .reposition(...) to Matrix and Value objects, which “shift” or reposition elements
  • Broadcasting Vector to Matrix (such as plus(A & v)) has better repr and is more efficient with masks
  • Add sort=True keyword to .to_vector(...) method on vectors and matrices
  • Deprecate mask.mask and rename to mask.parent
  • Added git pre-commit hooks to make it easier for contributors
over 3 years ago
Download
2022.4.1

2022.4.1

Renamed project to Python-graphblas and package to graphblas (#204)

  • $ conda install python-graphblas
  • $ pip install python-graphblas
  • >>> import graphblas as gb

Deprecations (#205)

  • Deprecate how we create empty objects:
    • Scalar.new(dtype) -> Scalar(dtype)
    • Vector.new(dtype) -> Vector(dtype)
    • Matrix.new(dtype) -> Matrix(dtype)
    • Also, dtype argument is now optional (default FP64)

Features

  • Support select! (#207)
    • gb.select.tril(A)
    • A.select("diag", 1)
    • gb.select.row(A < 3)
    • More to come; this is part 1 of the plan
  • Support user-defined types! (#177)
    • gb.dtypes.register_new(name, dtype) (and register_anonymous)
    • Any NumPy dtype that Numba can handle in no-python mode is valid
      • For example, record dtypes and subarray dtypes
    • Many operations such as eq, first, positioni, and agg.count that you expect to work, do.
  • Auto-broadcast vectors with diag and outer product (#203)
    • plus(A & v) -> any_plus(A @ v.diag())
    • and infix, such as A + v and v - A (using normal infix rules)
  • Support ewise-union in infix (#203)
    • plus(x | y, left_default=1, right_default=2)
  • Add x.ss.iter{keys,values,items} (#201)
    • This exposes fast SuiteSparse:GraphBLAS iteration
    • The object should not be mutated during iteration

Bug fixes

  • Fixed segfault from using complex scalars and complex monoids (#164, #210)
  • Misc
over 3 years ago
Download
2022.4.0

2022.4.0

Deprecation cycle! (#190)

  • Removed:
    • matrix.reduce_rows (use matrix.reduce_rowwise instead)
    • matrix.reduce_columns (use matrix.reduce_columnwise instead)
    • matrix.ss.scan_rows (use matrix.ss.scan_rowwise instead)
    • matrix.ss.scan_columns (use matrix.ss.scan_columnwise instead)
    • grblas.backends removed
  • Deprecate:
    • vector.ss.diag(A) (renamed to vector.ss.build_diag(A); use A.diag instead)
    • matrix.ss.diag(v) (renamed to matrix.ss.build_diag(v); use v.diag instead)

Other changes

  • Autocompute scalar expressions in x.update(expr) if valid (#192)
  • Improve tab-completion of operator namespaces (#191)
  • Add missing semirings that were the commutation of existing semirings (#191)
    • This added semirings with rpow, rtruediv, rfloordiv, and abssecond binary operators.
  • Update v += expr to do v(plus) << expr instead of v << plus(v | expr) when expr is not scalar-like (#193)
  • Add x.ss.iso_value to Vector and Matrix objects (#194)
  • Improved gb.io.from_networkx (#195)
    • Expose arguments to networkx.to_scipy_sparse_array
    • Use Matrix.ss.import_csr for faster importing of data when using “suitesparse” backend
    • Determine whether the matrix is iso-valued when using “suitesparse” backend
over 3 years ago
Download
2022.3.1

2022.3.1

  • Add gb.agg.from_string
  • Make diag a mainline feature (still available under .ss namespace)
  • Fix some failing tests
over 3 years ago
Download
2022.3.0

2022.3.0

Lot’s of changes this release!

  • Switch versioning to use Calendar versioning (calver)
  • Support (and test on) Python 3.10
  • Update to SuiteSparse:GraphBLAS 6.2.X
  • Breaking change: reductions to scalar on empty collections now result in empty scalars by default (#162)
    • This affects my_vector.reduce and my_matrix.reduce_scalar
    • To get old behavior where the monoid identity is returned, do e.g. v.reduce(allow_empty=False).
  • Add support for GrB_Scalar objects (#163)
    • A Scalar object in grblas may be a C scalar or GrB_Scalar (the default).
    • Use is_cscalar=True upon creating the Scalar to get a C scalar
    • Scalars may now be passed to gb.ss.concat as length-1 vectors or shape (1, 1) matrices
    • Scalars now have c.is_cscalar and c.is_grbscalar attributes
  • Add ewise_union method (#159)
    • This is like ewise_add with a Binary Operator and user-provided defaults for the left and right values.
    • Subtraction infix x - y on Matrices or Vectors now use ewise_union with default values of 0.
  • Add .ss.compactify to Vector and Matrix objects (144)
    • For example, this can shift all (or N) values contiguously to the left.
    • Supported operations: first, last, smallest, largest, random.
  • Add .is_positional attribute to operators (#161)
    • For example, unary.positioni, binary.firsti, and semiring.any_secondj are “positional”
  • Autocompute A[idx] as extract (#166)
    • Also, add better reprs for indexed expressions
  • Support deleting many items using slice or indexing notation (#163)
    • For example, del A[[1, 2], :3]
  • Support negative indices (#143)
  • Allow resolved indices to be converted back to Python indices (#142)
  • Add __sizeof__ method to Matrix, Vector, and Scalar objects to get memory usage ($145)
  • Added a code of conduct (#167)
over 3 years ago
Download
1.3.15.1

1.3.15.1

Fix failing import in Python 3.10

almost 4 years ago
Download
1.3.15

1.3.15

  • Update to SuiteSparse:GraphBLAS 6.1.3
  • Add format such as "csr" to object reprs
  • Much faster import time!
  • All grblas objects may now be pickled/serialized
  • grblas.ss.concat can now concatenate Vectors:
    • gb.ss.concat([v, v]) # Vector, size=2*N
    • gb.ss.concat([[v], [v]]) # Matrix, nrows=2*N, ncols=1
    • gb.ss.concat([[v, v]]) # Matrix, nrows=N, ncols=2
  • Add Vector.ss.split to split a Vector into sub-Vectors
  • Add .ndim attribute to Scalar, Vector, and Matrix objects and expressions
almost 4 years ago
Download
1.3.14

1.3.14

  • Support infix between non-scalar (i.e., Matrix and Vector) objects! Here are the rules:
    • monoids with identity 0 use ewise_add: +,^, and |.
    • A - B will use GxB_eWiseUnion with 0 as the defaults (not yet supported!)
    • others use ewise_mult
  • Use numpy rules for unifying types, including when scalars are used.
  • Allow ss.concat to use expressions, such as ss.concat([[A, A.T, A + 1]])
  • Fix: removed op.div, added op.truediv, and made sure op namespace matches other operator namespaces
about 4 years ago
Download
1.3.13

1.3.13

Deprecations:

  • Changed e.g. reduce_rows to reduce_rowwise and deprecate the former

Updates:

  • Added x.ss.selectk(how, k) methods for vectors and matrices
    • how can be "random", "first", "last". Vector also supports "largest" and "smallest"
  • Allow operators to be given as strings, such as A.mxm(B, 'min.+[float]')
    • Also added from_string functions such as gb.binary.from_string('+')
  • x | y, x & y, x ^ y, and ~x infix is only value-y for bool dtypes
    • x | y and x ^ y uses ewise_add, x & y uses ewise_mult
  • Add op.commutes_to and op.is_commutative to binaryops, monoids, and semirings
  • Support slices from SuiteSparse (can now perform huge slices on huge objects!)
  • Recorder now logs exceptional C calls and their errors
  • Improved get_semiring(monoid, binaryop) to better handle ops from numpy namespaces.
  • Make dtype= an optional positional argument (like NumPy does), not keyword-only
  • Map numpy ops in e.g. gb.binary.numpy to GraphBLAS ops (by default)

Fixes:

  • Fixed truediv on complex dtypes
  • Fixed displaying of nan in reprs
  • Fixed repr of large iso-valued objects
  • Fixed types of land, lor, and lxor binary operators (not bool only)
about 4 years ago
Download