Skip to content

Commit b2f6cf8

Browse files
authored
Scripts (#16)
1 parent 3b935f5 commit b2f6cf8

17 files changed

+87
-72
lines changed

.github/workflows/python-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818

1919
runs-on: ${{ matrix.os }}
2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v5
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626
- name: Install dependencies
@@ -36,4 +36,4 @@ jobs:
3636
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3737
- name: Test with pytest
3838
run: |
39-
pytest
39+
pytest .

.github/workflows/pythonpublish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ jobs:
88
deploy:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
- name: Set up Python
13-
uses: actions/setup-python@v4
13+
uses: actions/setup-python@v5
1414
with:
1515
python-version: '3.x'
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install --upgrade pip
19-
pip install setuptools wheel twine build
19+
pip install twine build
2020
- name: Build and publish
2121
env:
2222
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
*.png
2+
*.csv
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[cod]
@@ -149,10 +152,8 @@ octave-workspace
149152
# Local History for Visual Studio Code
150153
.history/
151154

152-
153155
## Sublime text
154156

155-
156157
# Cache files for Sublime Text
157158
*.tmlanguage.cache
158159
*.tmPreferences.cache

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [v0.2.2]
4+
5+
- Moved the scripts to a proper entrypoint instead of an added file
6+
- This changes nothing in the way each script is called but just makes it more robust on Windows
7+
38
## [v0.2.1] - 2023-06-01
49

510
- Support for csv files input and output

datasets/af_left_AFD_realigned.png

-492 Bytes
Loading

datasets/pvals_realigned.png

-535 Bytes
Loading

datasets/pvals_unaligned.png

66.7 KB
Loading

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
language = 'en'
2525

2626
# The full version, including alpha/beta/rc tags
27-
release = 'v0.2.1'
27+
release = 'v0.2.2'
2828

2929
# If your documentation needs a minimal Sphinx version, state it here.
3030
#

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
sphinx >= 5.3.0
22
sphinx_rtd_theme >= 1.1.1
33
readthedocs-sphinx-search >= 0.3.2
4-
sphinx-rtd-theme
54
sphinx-autoapi
65
myst-parser

dpr/register.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def align_bundles(bundles, percent=15, padding=0., order=1, eps=1e-5, mode='full
106106
shifts[outliers] = 0.
107107
shifts[:, outliers] = 0.
108108

109-
warn('Possible outliers found {}'.format(outliers))
109+
warn(f'Possible outliers found {outliers}')
110110

111111
# use the custom shift patterns
112112
ys = apply_shift(bundles, shifts[original_templater])
@@ -123,7 +123,7 @@ def resample_bundles_to_same(bundles, num_points=None):
123123
bundles = bundles[None, :]
124124

125125
if bundles.ndim != 2:
126-
error = 'bundles needs to be a 2D array, but is {}D'.format(bundles.ndim)
126+
error = f'bundles needs to be a 2D array, but is {bundles.ndim}D'
127127
raise ValueError(error)
128128

129129
if num_points is None:
@@ -176,7 +176,7 @@ def flip_fibers(bundles, coordinates, padding=np.nan, template=None):
176176
'''
177177

178178
if coordinates[0].shape[1] != 3:
179-
raise ValueError('coordinates should be Nx3 but is {}'.format(coordinates[0].shape))
179+
raise ValueError(f'coordinates should be Nx3 but is {coordinates[0].shape}')
180180

181181
new_bundles = np.zeros_like(bundles)
182182

@@ -201,7 +201,7 @@ def flip_fibers(bundles, coordinates, padding=np.nan, template=None):
201201
def truncate(bundles, mode='shortest', trimval=np.nan, axis=0):
202202

203203
if bundles.ndim > 2:
204-
error = 'Number of dimension must be lower than 2, but was {}'.format(bundles.ndim)
204+
error = f'Number of dimension must be lower than 2, but was {bundles.ndim}'
205205
raise ValueError(error)
206206

207207
if mode == 'shortest':
@@ -211,11 +211,11 @@ def truncate(bundles, mode='shortest', trimval=np.nan, axis=0):
211211
elif isinstance(mode, int):
212212

213213
if mode > 100 or mode < 1:
214-
raise ValueError('mode must be between 1 and 100 {}'.format(mode))
214+
raise ValueError(f'mode must be between 1 and 100 {mode}')
215215

216216
threshold = np.floor(mode * bundles.shape[0] / 100)
217217
else:
218-
raise ValueError('Unrecognized truncation mode {}'.format(mode))
218+
raise ValueError(f'Unrecognized truncation mode {mode}')
219219

220220
if np.isnan(trimval):
221221
indexes = np.isfinite(bundles).sum(axis=axis) >= threshold
@@ -246,7 +246,7 @@ def filter_pairs(allpairs, mode):
246246
elif mode == 'everything':
247247
func = lambda *_: True # this always return True
248248
else:
249-
error = 'String mismatch, mode was {} of type {}'.format(mode, type(mode))
249+
error = f'String mismatch, mode was {mode} of type {type(mode)}'
250250
raise ValueError(error)
251251

252252
output = []

0 commit comments

Comments
 (0)