Skip to content

Commit

Permalink
update radontea/_version.py with git_cast_file2repos.py
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 6, 2019
1 parent 6a3bc8a commit 9c0c933
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.4.4
- fix: correctly increment `count` in `_alg_fmp.py`
0.4.3
- fix: correctly compute `max_count` for 3D wrapper
0.4.2
Expand Down
9 changes: 6 additions & 3 deletions radontea/_alg_fmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def fourier_map(sinogram, angles, intp_method="cubic",
rintp = np.fft.fftshift(fx.reshape(-1))

if count is not None:
count.value += 1
with count.get_lock():
count.value += 1

# The code block yields the same result as griddata (below)
# interpolation coordinates
Expand Down Expand Up @@ -168,15 +169,17 @@ def fourier_map(sinogram, angles, intp_method="cubic",
method=intp_method)

if count is not None:
count.value += 1
with count.get_lock():
count.value += 1

# remove nans
Fcomp[np.where(np.isnan(Fcomp))] = 0

f = np.fft.fftshift(np.fft.ifft2(np.fft.ifftshift(Fcomp)))

if count is not None:
count.value += 1
with count.get_lock():
count.value += 1

return f.real

Expand Down
6 changes: 4 additions & 2 deletions radontea/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
Changelog
---------
2019-11-06.2
- use os.path.split instead of counting os.path.sep (Windows)
2019-11-06
- remove deprecated imp dependency (replace with parser)
- check whether this file is versioned and its location is correct
Expand All @@ -48,7 +50,7 @@
# `pragma: no cover` to ignore code coverage here.
if True: # pragma: no cover
import os
from os.path import abspath, basename, dirname, join
from os.path import abspath, basename, dirname, join, split
import subprocess
import sys
import time
Expand Down Expand Up @@ -100,7 +102,7 @@ def _minimal_ext_cmd(cmd):
# If it is under version control, it should be located
# one hierarchy down from the repository root (either
# __file__ is "docs/conf.py" or "package_name/_version.py".
if loc.count(os.path.sep) == 1:
if len(split(loc)) == 2:
try:
git_revision = _minimal_ext_cmd(['git', 'describe',
'--tags', 'HEAD'])
Expand Down

0 comments on commit 9c0c933

Please sign in to comment.