Skip to content

Commit 14aa706

Browse files
authored
Merge pull request #12 from ulf1/dev
Fixes
2 parents 1a1a959 + 3b5b455 commit 14aa706

File tree

9 files changed

+43
-13
lines changed

9 files changed

+43
-13
lines changed

.github/workflows/syntax-and-unit-tests.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,23 @@ jobs:
77

88
runs-on: ubuntu-18.04
99

10+
strategy:
11+
matrix:
12+
python-version: ['3.6', '3.7', '3.8', '3.x']
13+
14+
name: Python ${{ matrix.python-version }} Tests
15+
1016
steps:
1117
- uses: actions/checkout@v1
12-
- name: Set up Python 3.6
18+
- name: Setup python
1319
uses: actions/setup-python@v1
1420
with:
15-
python-version: 3.6
21+
python-version: ${{ matrix.python-version }}
22+
architecture: x64
1623
- name: Install dependencies
1724
run: |
1825
python -m pip install --upgrade pip
19-
pip3 install -r requirements-dev.txt
26+
pip install -r requirements-dev.txt
2027
- name: Lint with flake8
2128
run: |
2229
flake8 --ignore=F401 --exclude=$(grep -v '^#' .gitignore | xargs | sed -e 's/ /,/g')

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,4 @@ venv.bak/
108108
.vscode
109109
profile/data*
110110
.theia
111+
README.rst

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 0.4.2 / 2020-04-23
2+
3+
* Test multiple python versions
4+
* Installation problems: zip_true set to False because file import required
5+
16
# 0.4.0 / 2020-12-18
27

38
* License changed to Apache-2

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
include README.md
2+
include README.rst
23
recursive-include test *.py

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[![PyPI version](https://badge.fury.io/py/sparsity-pattern.svg)](https://badge.fury.io/py/sparsity-pattern)
22
[![DOI](https://zenodo.org/badge/245850728.svg)](https://zenodo.org/badge/latestdoi/245850728)
3-
3+
[![sparsity-pattern](https://snyk.io/advisor/python/sparsity-pattern/badge.svg)](https://snyk.io/advisor/python/sparsity-pattern)
4+
[![Total alerts](https://img.shields.io/lgtm/alerts/g/ulf1/sparsity-pattern.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ulf1/sparsity-pattern/alerts/)
5+
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/ulf1/sparsity-pattern.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ulf1/sparsity-pattern/context:python)
6+
[![deepcode](https://www.deepcode.ai/api/gh/badge?key=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwbGF0Zm9ybTEiOiJnaCIsIm93bmVyMSI6InVsZjEiLCJyZXBvMSI6InNwYXJzaXR5LXBhdHRlcm4iLCJpbmNsdWRlTGludCI6ZmFsc2UsImF1dGhvcklkIjoyOTQ1MiwiaWF0IjoxNjE5NTQwNDY4fQ.84-ii4Nz_CiGiojJTDIenWenL4vwVLBB9sapz9soHyA)](https://www.deepcode.ai/app/gh/ulf1/sparsity-pattern/_/dashboard?utm_content=gh%2Fulf1%2Fsparsity-pattern)
47

58
# sparsity-pattern
69
Generate different types of sparsity pattern for sparse matrices.
@@ -91,7 +94,14 @@ pip3 install -r requirements-demo.txt
9194
* Jupyter for the examples: `jupyter lab`
9295
* Check syntax: `flake8 --ignore=F401 --exclude=$(grep -v '^#' .gitignore | xargs | sed -e 's/ /,/g')`
9396
* Run Unit Tests: `pytest`
94-
* Upload to PyPi with twine: `python setup.py sdist && twine upload -r pypi dist/*`
97+
98+
Publish
99+
100+
```sh
101+
pandoc README.md --from markdown --to rst -s -o README.rst
102+
python setup.py sdist
103+
twine upload -r pypi dist/*
104+
```
95105

96106
### Clean up
97107

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# syntax check, unit test, profiling
2+
setuptools>=56.0.0
23
flake8>=3.8.4
34
pytest>=6.2.1
45
twine==3.3.0

setup.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
from setuptools import setup
2-
import pypandoc
2+
import os
3+
4+
5+
def read(fname):
6+
with open(os.path.join(os.path.dirname(__file__), fname)) as fp:
7+
s = fp.read()
8+
return s
39

410

511
def get_version(path):
@@ -17,13 +23,12 @@ def get_version(path):
1723
description=(
1824
"Generate different types of sparsity pattern for sparse matrices."
1925
),
20-
long_description=pypandoc.convert('README.md', 'rst'),
26+
long_description=read('README.rst'),
2127
url='http://github.com/ulf1/sparsity-pattern',
2228
author='Ulf Hamster',
2329
author_email='554c46@gmail.com',
2430
license='Apache License 2.0',
2531
packages=['sparsity_pattern'],
26-
install_requires=[
27-
'setuptools>=40.0.0'],
32+
# install_requires=[],
2833
python_requires='>=3.6',
2934
zip_safe=True)

sparsity_pattern/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.4.1'
1+
__version__ = '0.4.2'
22

33
from .generators import (
44
get, diag, dense_quadratic, dense_pythonic, nodiag_quadratic,

sparsity_pattern/generators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ def get(sp: str, *args, **kwargs) -> List[List[int]]:
3535
idx = sparsity_pattern.get('triu', n=5, k=-1)
3636
"""
3737
if sp in ("diag"):
38-
arr = diag(*args, **kwargs)
38+
arr = diag(*args)
3939
elif sp in ("dense"):
4040
if (len(args) + len(kwargs)) == 1:
41-
arr = dense_quadratic(*args, **kwargs)
41+
arr = dense_quadratic(*args)
4242
else:
4343
arr = dense_pythonic(*args, **kwargs)
4444
elif sp in ("nodiag"):
4545
if (len(args) + len(kwargs)) == 1:
46-
arr = nodiag_quadratic(*args, **kwargs)
46+
arr = nodiag_quadratic(*args)
4747
else:
4848
arr = nodiag_pythonic(*args, **kwargs)
4949
elif sp in ("block"):

0 commit comments

Comments
 (0)