Skip to content

Commit ae59fdc

Browse files
authored
Update README.md (#2)
Update README.md
1 parent 21a455f commit ae59fdc

File tree

6 files changed

+33
-7
lines changed

6 files changed

+33
-7
lines changed

.github/workflows/python-package.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,20 @@ jobs:
8080
python -m pip install --upgrade pip
8181
python -m pip install flake8 pytest
8282
python -m pip install .
83+
rm -rf ./build/
8384
if [ -f test_requirements.txt ]; then pip install -r test_requirements.txt; fi
8485
- name: Lint with flake8
8586
run: |
8687
# stop the build if there are Python syntax errors or undefined names
8788
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
8889
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
8990
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
90-
- name: Test with pytest
91-
run: |
92-
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:"$(pip show pylspack | grep 'Location:' | awk '{print $2}')/pylspack/" && python3 -m pytest -svvv test
9391
- name: Typing checks with mypy
9492
run: |
9593
mypy .
9694
- name: Style check with yapf
9795
run: |
9896
yapf --quiet --style "{based_on_style: pep8, blank_line_before_nested_class_or_def: true, indent_dictionary_value: true, dedent_closing_brackets: true, column_limit: 99}" --recursive .
97+
- name: Test with pytest
98+
run: |
99+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:"$(pip show pylspack | grep 'Location:' | awk '{print $2}')/pylspack/" && python3 -m pytest -svvv test

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ The basic matrix algorithms of this package are developed in C++, using OpenMP f
1616
As already noted, the implementation is designed for existing data structures of SciPy and Numpy and therefore the entire codebase is **only tested** and **should only be used** via the python wrappers.
1717
The C++ API **can** be used as a standalone package, but it has not been tested.
1818

19+
### Citation
20+
The corresponding publication https://doi.org/10.1137/20m1314471 can be cited as follows:
21+
```
22+
@article{Sobczyk2021,
23+
doi = {10.1137/20m1314471},
24+
url = {https://doi.org/10.1137/20m1314471},
25+
year = {2021},
26+
publisher = {Society for Industrial {\&} Applied Mathematics ({SIAM})},
27+
volume = {42},
28+
number = {3},
29+
pages = {1199--1228},
30+
author = {Aleksandros Sobczyk and Efstratios Gallopoulos},
31+
title = {Estimating Leverage Scores via Rank Revealing Methods and Randomization},
32+
journal = {{SIAM} Journal on Matrix Analysis and Applications}
33+
}
34+
```
35+
1936
## Usage
2037

2138
A simple usage example to compute the leverage scores of a sparse `csr_matrix` with the `ls_via_inv_gram` method.

pylspack/leverage_scores.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_rank_from_vector(S: np.ndarray, rcond: float) -> int:
3232
if not np.any(S):
3333
return 0 # if all elements are zero, the rank is zero
3434
if not np.all(S[:-1] >= S[1:]):
35-
raise ValueError(f'Given vector to determine the rank must be sorted.')
35+
raise ValueError('Given vector to determine the rank must be sorted.')
3636
if rcond < 0 or rcond >= 1:
3737
raise ValueError(f'Given value for rcond={rcond} is invalid. Must be 0 <= rcond < 1.')
3838

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def read_readme(fname):
4747

4848
setup(
4949
name='pylspack',
50-
version='1.0.0',
50+
version='1.0.1',
5151
description='Python package for leverage scores computations.',
5252
author='Sobczyk Aleksandros',
5353
author_email='[email protected]',

test/test_csrrk.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
)
99

1010
A_shapes = [(1, 1), (3, 1), (3, 3), (17, 5), (237, 174), (237, 237)]
11-
A_shapes.extend([np.random.randint(low=min_size, high=max_size, size=2) for k in range(10)])
11+
A_shapes.extend(
12+
[
13+
tuple(np.random.randint(low=min_size, high=max_size, size=2)) # type: ignore
14+
for k in range(10)
15+
]
16+
)
1217

1318

1419
def execute_and_check(alpha: float, A: csr_matrix, beta: float, C: np.ndarray):

test/utils.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
A_shapes_generic.extend([(8, 8), (64, 64), (128, 128)])
1111
B_shapes_generic.extend([(8, 8), (64, 64), (128, 128)])
1212
A_shapes_generic.extend(
13-
[np.random.randint(low=min_size, high=max_size, size=2) for k in range(10)]
13+
[
14+
tuple(np.random.randint(low=min_size, high=max_size, size=2)) # type: ignore
15+
for k in range(10)
16+
]
1417
)
1518
B_shapes_generic.extend(
1619
[

0 commit comments

Comments
 (0)