From 41e9b1693de317dee0f04f8b273b500bcf25afd4 Mon Sep 17 00:00:00 2001 From: mhubii Date: Tue, 12 Mar 2024 14:03:10 +0000 Subject: [PATCH 1/4] Black formatter action Signed-off-by: mhubii --- .github/workflows/black.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/black.yml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 0000000..9065b5e --- /dev/null +++ b/.github/workflows/black.yml @@ -0,0 +1,10 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: psf/black@stable From 2cb341194cebbd3e40b70d6177d0927830a8ac56 Mon Sep 17 00:00:00 2001 From: mhubii Date: Tue, 12 Mar 2024 14:08:37 +0000 Subject: [PATCH 2/4] Code style and license tags Signed-off-by: mhubii --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c91f618..bd40e58 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Sparsity-preserving gradient utility tools for PyTorch +![License](https://img.shields.io/github/license/cai4cai/torchsparsegradutils) ![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg) + A collection of utility functions to work with PyTorch sparse tensors. This is work-in-progress, here be dragons. Currenly available features with backprop include: From b0e5b064c652fb75a5c5530f6462e270a961d4ad Mon Sep 17 00:00:00 2001 From: mhubii Date: Tue, 12 Mar 2024 14:14:39 +0000 Subject: [PATCH 3/4] format files https://github.com/cai4cai/torchsparsegradutils/pull/54, remove unused imports --- torchsparsegradutils/utils/lsmr.py | 1 + torchsparsegradutils/utils/random_sparse.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/torchsparsegradutils/utils/lsmr.py b/torchsparsegradutils/utils/lsmr.py index 979e2b9..1434138 100644 --- a/torchsparsegradutils/utils/lsmr.py +++ b/torchsparsegradutils/utils/lsmr.py @@ -4,6 +4,7 @@ Copyright (C) 2010 David Fong and Michael Saunders """ + import torch diff --git a/torchsparsegradutils/utils/random_sparse.py b/torchsparsegradutils/utils/random_sparse.py index eddcb96..5f3aaaa 100644 --- a/torchsparsegradutils/utils/random_sparse.py +++ b/torchsparsegradutils/utils/random_sparse.py @@ -11,7 +11,7 @@ TODO: This code needs reformatting into just rand_sparse and rand_sparse_tri TODO: Add support for non-strict triangular matrices """ -import warnings + import torch import random from torchsparsegradutils.utils.utils import convert_coo_to_csr_indices_values From 000ef323e27f0e1eb03402bebc1e5940dade94a2 Mon Sep 17 00:00:00 2001 From: mhubii Date: Tue, 12 Mar 2024 16:58:11 +0000 Subject: [PATCH 4/4] add Python test badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd40e58..60e6915 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Sparsity-preserving gradient utility tools for PyTorch -![License](https://img.shields.io/github/license/cai4cai/torchsparsegradutils) ![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg) +[![Python tests](https://github.com/cai4cai/torchsparsegradutils/actions/workflows/python-package.yml/badge.svg)](https://github.com/cai4cai/torchsparsegradutils/actions/workflows/python-package.yml) ![License](https://img.shields.io/github/license/cai4cai/torchsparsegradutils) ![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg) A collection of utility functions to work with PyTorch sparse tensors. This is work-in-progress, here be dragons.