Mlreflect

Latest version: v0.21.1

Safety actively analyzes 624578 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.21.1

Fixed

- Fixed a bug in `MultilayerReflectivity()` of the `data_generation.reflectivity` module where the
wrong square root solution of the `np.sqrt()` function was chosen when calculating wave vectors below the critical
angle.

Added

- Added a basic test `test_builtin_reflectivity.py`.
- Added the GitHub workflow `.github/workflows/publish-to-pypi.yml`. It publishes a new version of *mlreflect* to
PyPI automatically whenever a tagged commit is pushed. The tag has to follow the version pattern 'x.y.z'.

0.21.0

Added

- Added the option in the `CurveFitter` and `SpecFitter` classes to resample the curve scaling at prediction to find
the one with the lowest MSE (analogous to the q shift resampling). The option can be turned on by passing the
`optimize_scaling=True` keyword to the fit methods.

0.20.2

Added

- Added readme description to `setup.py` for PyPI.

0.20.0

Added

- Added more docstrings
- Added `simulate_reflectivity` flag for the `CurveFitter.fit_curve()` method that allows the skipping of
reflectivity simulation if prediction speed is of importance.
- Added `**kwargs` as an argument for the `TrainedModel` class that is passed directly to the method which loads the
Keras method to allow the loading of custom objects.

Changed

- Replaced `scipy.optimize.minimize` with `scipy.optimize.curve_fit` because it's faster for least mean squares
minimization
- Changed docs to be compatible with Read the Docs. Now the docs can be found online (https://mlreflect.readthedocs.
io/en/latest/).
- Updated tests.
- Refactored reflectivity interpolation to be all in one place
- Changed license from GPL-3 to MIT

Fixed

- Fixed bug in minimizer interpolation

0.19.0

Added

- Added new optimization method where the _q_ interpolation is sampled with small shifts in _q_ (around +-0.003 1/A).
This option is turned on with the keyword `optimize_q=True` and generally improves the prediction.
- The relative fitting bounds for the LMS fit (when `polish=True`) can now be chosen for each of the three
prediction parameters (thickness, roughness, SLD) via the keyword `fraction_bounds`.
- Added log mean squared error to the `FitResult` object and the plot of the prediction.
- Added a lot more docstrings

Changed

- The output of the `CurveFitter.fit_curve()` method has been changed from a tuple (containing reflectivity and
parameters) to a dictionary (now also including the best q shift if `optimize_q=True`).
- The scan number index of the `SpecParser.scan_info` dictionary was changed from `str` to `int` for consistency.
- Updated example notebooks
- Changed example SPEC file
- Updated documentation

0.18.0

Added

- Added support for *.fio* files in the form of a `FioParser`, `FioLoader` and `FioFitter`. The code has been
refactored so that some functionality that is shared with the respective SPEC equivalents is inherited from a base
class.
- Added a new subpackage `xrrloader.p08tools` that contains tools developed by Florian Bertram from DESY, Germany.
These tools help in reading the '.fio' files and reprocessing the corresponding 2D detector images.
- Added basic Sphinx docs to the project.

Changed

- Updated some affected tests.
- Updated several docstrings to use syntax markdown for docs.
- Unified the version number from `setup.py` and `mlreflect.__init__` to `mlreflect.version`.

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.