Skip to content

Commit

Permalink
Merge pull request #198 from European-XFEL/dev
Browse files Browse the repository at this point in the history
0.8.3 Release
  • Loading branch information
zhujun98 authored May 13, 2020
2 parents 448269c + ea3e7a9 commit 8b307d9
Show file tree
Hide file tree
Showing 176 changed files with 11,235 additions and 4,514 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ script:
# test parallel version
- python setup.py build_ext --with-tests
- python setup.py test -v
- python setup.py benchmark -v

# test series version
- export FOAM_WITH_TBB=0
- export FOAM_WITH_XSIMD=0
- export XTENSOR_WITH_TBB=0
- export XTENSOR_WITH_XSIMD=0
- export BUILD_SERIAL_FOAM=1
- python setup.py build_ext --with-tests
- python setup.py test -v
- python setup.py benchmark -v
48 changes: 34 additions & 14 deletions benchmarks/benchmark_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,54 @@
)


def benchmark_nan(f_cpp, f_py, shape):
data = np.random.randn(*shape)
data[::2, ::2] = np.nan
def benchmark_nan_without_axis(f_cpp, f_py, shape, dtype):
data = np.random.randn(*shape).astype(dtype) + 1. # shift to avoid very small mean
data[:, :3, ::3] = np.nan

t0 = time.perf_counter()
for i in range(100):
ret_cpp = f_cpp(data)
ret_cpp = f_cpp(data)
dt_cpp = time.perf_counter() - t0

t0 = time.perf_counter()
for i in range(100):
ret_py = f_py(data)
ret_py = f_py(data)
dt_py = time.perf_counter() - t0

assert ret_cpp == pytest.approx(ret_py)
assert ret_cpp == pytest.approx(ret_py, rel=1e-4)

print(f"\n{f_cpp.__name__} with {float} - \n"
print(f"\nwithout axis, dtype = {dtype} - \n"
f"dt (cpp): {dt_cpp:.4f}, "
f"dt (numpy): {dt_py:.4f}")


def benchmark_nan_keep_zero_axis(f_cpp, f_py, shape, dtype):
data = np.random.randn(*shape).astype(dtype=dtype) + 1. # shift to avoid very small mean
data[:, :3, ::3] = np.nan

t0 = time.perf_counter()
ret_cpp = f_cpp(data, axis=(-2, -1))
dt_cpp = time.perf_counter() - t0

t0 = time.perf_counter()
ret_py = f_py(data, axis=(-2, -1))
dt_py = time.perf_counter() - t0

assert ret_cpp == pytest.approx(ret_py, rel=1e-4)

print(f"\nkeep zero axis, dtype = {dtype} - \n"
f"dt (cpp): {dt_cpp:.4f}, "
f"dt (numpy): {dt_py:.4f}")


if __name__ == "__main__":
print("*" * 80)
print("Benchmark image processing")
print("Benchmark statistics functions")
print("*" * 80)

s = (1096, 1120)
s = (16, 1096, 1120)

for f_cpp, f_py in [(nanmean, np.nanmean),
(nansum, np.nansum)]:
benchmark_nan(f_cpp, f_py, s)
for f_cpp, f_py in [(nansum, np.nansum), (nanmean, np.nanmean)]:
print(f"\n----- {f_cpp.__name__} ------")
benchmark_nan_without_axis(f_cpp, f_py, s, np.float32)
benchmark_nan_without_axis(f_cpp, f_py, s, np.float64)
benchmark_nan_keep_zero_axis(f_cpp, f_py, s, np.float32)
benchmark_nan_keep_zero_axis(f_cpp, f_py, s, np.float64)
41 changes: 41 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
CHANGELOG
=========

0.8.3 (11 May 2020)
------------------------

- **Breaking change**
- In the terminal, "--n_modules 2" is required to run JungFrauPR with two modules. #41

- **Bug Fix**
- Change pixel size of ePix100 from 0.11 mm to 0.05 mm. #189

- **Improvement**
- Mask tile/ASIC edges by default. #192
- Improve geometry 1M and its unittest. #190
- Invert y axis for displayed image. #187
- Rename geometry to geometry_1m in C++. #186
- Improve tr-XAS analysis in special suite. #163 #183
- Improve correlating error message. #182
- Improve documentation for special suite. #177
- New reset interface in special suite. #170
- Regularize names of methods and attributes in special suite. #167
- Add new mode, start/end train ID control and progress bar, etc. in FileStreamer. #166
- Move definition of meta source from config to SourceCatalog. #165
- Use correlated queue in special suite. #164
- Improve shape comparing error message in C++. #160
- Improve mask image data implementation and interface. #157
- Move image assembler into image processor. # 155
- Refactor masking code. #149
- Implement generic binding for nansum and nanmean. #114

- **New Feature**
- Add axis calibration in Gotthard analysis. #179
- Implement generalized geometry for multi-module detectors. #175 #196
- Implement streaming JungFrauPR data from files. #174
- Implement Gotthard pump-probe analysis in special suite. #173 #178
- Add ROI histogram in CameraView in special suite. #172
- Add ROI control in special suite. #171
- Implement XAS-TIM-XMCD in special suite. #162
- Implement MultiCameraView in special suite. #147
- Implement XAS-TIM in special suite. #146
- Implement load and save mask in pixel coordinates. #132 #154 #185 #191 #197


0.8.2 (8 April 2020)
------------------------

Expand Down
46 changes: 23 additions & 23 deletions docs/config_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@ The first block of the config file looks like the following:
FXE_DET_LPD1M-1/DET/*CH0:xtdf:
- image.data
JungFrau:
PIPELINE:
FXE_XAD_JF1M/DET/RECEIVER-1:display:
- data.adc
FXE_XAD_JF1M/DET/RECEIVER-2:display:
- data.adc
XGM:
CONTROL:
SA1_XTD2_XGM/DOOCS/MAIN:
- pulseEnergy.photonFlux
- beamPosition.ixPos
- beamPosition.iyPos
PIPELINE:
SA1_XTD2_XGM/DOOCS/MAIN:output:
- data.intensitySa1TD
Motor:
CONTROL:
FXE_SMS_USR/MOTOR/UM01:
- actualPosition
FXE_SMS_USR/MOTOR/UM02:
- actualPosition
JungFrau:
PIPELINE:
FXE_XAD_JF1M/DET/RECEIVER-1:display:
- data.adc
FXE_XAD_JF1M/DET/RECEIVER-2:display:
- data.adc
XGM:
CONTROL:
SA1_XTD2_XGM/DOOCS/MAIN:
- pulseEnergy.photonFlux
- beamPosition.ixPos
- beamPosition.iyPos
PIPELINE:
SA1_XTD2_XGM/DOOCS/MAIN:output:
- data.intensitySa1TD
Motor:
CONTROL:
FXE_SMS_USR/MOTOR/UM01:
- actualPosition
FXE_SMS_USR/MOTOR/UM02:
- actualPosition
The next block of the config file looks like the following:
Expand Down
8 changes: 6 additions & 2 deletions docs/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ Release **EXtra-foam**
- Update the version number in `extra_foam/__init__.py`;
- Merge the above change into the `dev` branch;
- Merge the `dev` branch into the `master` branch;
- Tag the `master` branch.

- Tag the `master` branch;
- Create a new branch from the new `master` branch and update the version number in
`extra_foam/__init__.py`. For example, if the latest release version is "0.8.0",
the new version number should be "0.8.1dev", supposing the next release is 0.8.1.
Also, the name of the new branch should be "0.8.1dev";
- Merge the new branch into the `dev` branch;

Deployment on EuXFEL Anaconda Environment
"""""""""""""""""""""""""""""""""""""""""
Expand Down
Loading

0 comments on commit 8b307d9

Please sign in to comment.