Skip to content

Commit

Permalink
Merge pull request #15 from RI-imaging/unwrap_depr_seed_update
Browse files Browse the repository at this point in the history
Change `seed` to `rng` for `unwrap_phase` function
  • Loading branch information
PinkShnack authored Oct 16, 2023
2 parents 4937f6e + d18b2e5 commit 8a395b9
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.x'
- name: Install fftw3 libs (Linux)
if: runner.os == 'Linux'
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.9.2
- ci: python build version changed to latest minor version
- ref: update unwrap arg name from seed to rng
0.9.1
- setup: bump qpretrieve from 0.2.6 to 0.2.8
0.9.0
Expand Down
4 changes: 2 additions & 2 deletions qpimage/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ def _get_amp_pha(self, data, which_data, bg_data=None, proc_phase=True):
pham = pha.copy()
pham[nanmask] = 0
pham = np.ma.masked_array(pham, mask=nanmask)
pha = unwrap_phase(pham, seed=47)
pha = unwrap_phase(pham, rng=47)
pha[nanmask] = np.nan
else:
pha = unwrap_phase(pha, seed=47)
pha = unwrap_phase(pha, rng=47)
# remove 2PI offsets that might be present in the border phase
border = np.concatenate((pha[0, :],
pha[-1, :],
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"nrefocus[FFTW]>=0.4.3", # Refocus class
"numpy>=1.9.0",
"qpretrieve[FFTW]>=0.2.8",
"scikit-image>=0.11.0",
"scikit-image>=0.21.0",
"scipy>=0.18.0",
],
python_requires='>=3.6, <4',
python_requires='>=3.8, <4',
keywords=["digital holographic microscopy",
"optics",
"quantitative phase imaging",
Expand Down
4 changes: 3 additions & 1 deletion tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ def test_series_hdf5_hardlink_bg():

def test_series_meta():
h5file = pathlib.Path(__file__).parent / "data" / "bg_tilt.h5"
with pytest.raises((OSError, RuntimeError)):
# We have no write intent on the file, so we cannot modify
# the metadata.
with pytest.raises((OSError, RuntimeError, KeyError)):
qpimage.QPImage(h5file=h5file,
meta_data={"wavelength": 333e-9},
h5mode="r")
Expand Down

0 comments on commit 8a395b9

Please sign in to comment.