Skip to content

Commit 08bda59

Browse files
committed
lint
1 parent d1a8a5b commit 08bda59

29 files changed

Lines changed: 106 additions & 272 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Python Package
1+
name: PiPy
22

33
on:
44
release:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linter And Tests
1+
name: tests
22

33
on: [push, pull_request]
44

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ venv.bak/
9797
# Rope project settings
9898
.ropeproject
9999

100+
101+
102+
103+
100104
# mkdocs documentation
101105
/site
102106

@@ -107,5 +111,5 @@ venv.bak/
107111
.idea/
108112
.vscode/
109113

110-
111-
114+
# ruff
115+
.ruff_cache/

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# ✴ Transformational Measures 📏
22

33

4-
![](https://img.shields.io/pypi/v/tmeasures) | ![](https://img.shields.io/codecov/c/github/facundoq/tmeasures) | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/facundoq/tmeasures/pipy_uv.yml) | [![Tests](https://github.com/facundoq/tmeasures/actions/workflows/lint_test.yml/badge.svg)](https://github.com/facundoq/tmeasures/actions/workflows/lint_test.yml)
4+
![](https://img.shields.io/pypi/v/tmeasures)
5+
| ![](https://img.shields.io/codecov/c/github/facundoq/tmeasures)
6+
| [![Tests](https://github.com/facundoq/tmeasures/actions/workflows/lint_test.yml/badge.svg)](https://github.com/facundoq/tmeasures/actions/workflows/lint_test.yml)
57

68

79
The Transformational Measures (`tmeasures`) library allows neural network designers to evaluate the invariance, equivariance and other properties of their models with respect to a set of transformations. Support for Pytorch.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ executor.type = "uv"
131131

132132
[tool.poe.tasks]
133133
test = "uv run pytest"
134+
cov-test = "uv run pytest --cov=tmeasures --cov-report=xml"
134135
lint = "uvx ruff check --fix tmeasures "
135136
format = "uvx ruff format tmeasures"
136137
build = "uv build"

readme.rst

Lines changed: 0 additions & 117 deletions
This file was deleted.

setup.py.old

Lines changed: 0 additions & 70 deletions
This file was deleted.

tmeasures/np/activations_iterator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
class ActivationsIterator(abc.ABC):
1111
"""
12-
..
1312
Iterate over the ST matrix of activations of a network, varying the samples and transformations.
1413
The iteration is in both orders:
1514
1) transformations_first: column indexes first, then row indices indices

tmeasures/np/goodfellow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def __init__(self, id:int, name:str, threshold:float,sign:int):
6262
def eval(self,q:Queue,inner_q:Queue):
6363
running_mean = RunningMeanWelford()
6464
# activation_sum=0
65-
n=0
6665
for transformation in self.queue_as_generator(q):
6766
for activations in self.queue_as_generator(inner_q):
6867
if self.sign != 1:

tmeasures/np/goodfellow_prob.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def eval(self,activations_iterator: ActivationsIterator,verbose=False)->MeasureR
3939
for transformation, samples_activations_iterator in tqdm(activations_iterator.transformations_first(),disable=not verbose):
4040
for x, batch_activations in samples_activations_iterator:
4141
for j, activations in enumerate(batch_activations):
42-
if self.sign != 1: activations *= self.sign
42+
if self.sign != 1:
43+
activations *= self.sign
4344
running_means[j].update_all(activations)
4445

4546
stds = [running_mean.std() for running_mean in running_means]

0 commit comments

Comments
 (0)