# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased]

### Added

- Add `@doc` metadata when exporting non-standard fields in `NXdetector`, `NXsample`, and `NXtransformations`.
- **NXtomo**: add `use_abs_path_for_vds` parameter to the ``save`` function.

### Changed

- Test now uses `pynxtools` to check if the files are compliant with `NXtomo` application definition.
- Tutorial CI job now runs on Python 3.12 (instead of 3.14).
- `NXtomo.save` now writes explicit `@target` attributes for linked datasets (`data`, `image_key`, `image_key_control`, `rotation_angle`, and `incident_energy`) and ensures `beam@NX_class` is exported for compatibility.
- Detector pixel-index quantities are now exported without unit since they are dimensionless.
- Deprecate `NXtomo.energy` to the benefit of `instrument.beam.incident_energy`.

### Fixed

- `NXdetector._load` now resolves relative external links from the NX file directory, fixing reload of NXtomo files built from TIFF external datasets (`relative_link=True`).

## [3.0.4] - 2026-02-10

### Fixed

- `to_target_rel_path` now falls back to absolute paths when the source file and the NX target file do not share a common parent directory, avoiding invalid VirtualSource relative links across mount points.

## [3.0.3] - 2026-01-26

### Fixed

- VirtualSource: improve handling of link path and clean them when containing 'mounting' point path.

## [3.0.2] - 2026-01-10

### Fixed

- NXsource: check of input values for source ``type``, and ``probe``.
- NXsample: fix setting of ``transformations``.

## [3.0.1] - 2025-11-25

### Fixed

- Replaced ``pint.UnitRegistry()`` by ``pint.get_application_registry()``.
    - **Impact**: Reduces initialization time and improves performance.

## [3.0.0] - 2025-11-21

### Added

- Persist the NeXus coordinate system used by the application and expose it through the new `nxtomo.geometry.CoordinateSystem` enum.
- Introduce `DetXFlipTransformation` and update detector flip helpers to reflect the McStas axis convention.

### Changed

- Minimum supported Python version is now 3.10.
- Centralize pint quantity consistency checks when merging detectors, warning (or failing) on unit mismatches and inconsistent magnitudes.
- `NXtomo.concatenate` now skips missing components safely and restores parent links only when applicable, avoiding crashes for partial entries.
- Continuous integration and documentation were refreshed, including updated guidance on the ESRF coordinate system.

### Removed

- Drop the deprecated `node_name` constructor argument and `NXtomo.concatenate` parameter, along with legacy path shims.
- Remove the deprecated `UDDetTransformation` and `LRDetTransformation` classes in favour of explicit flip transformations.

### Fixed

- Correct axis swaps introduced by the McStas migration so detector flips are read and written with the expected orientation.
- Ensure pixel size comparisons and detector distance merges handle pint quantities consistently when combining detectors.
- Improve robustness to Virtual Source (VS) selection (when a VDS contains VS with partial dataset associated).
- Saving rotation angle: make sure rotation angle are saved in degree

## [2.0.1] - 2025-07-16

### Fixed

- Restore backward compatibility for gravity transformations saved with an `m/s2` unit string.
- Reattach the detector parent after loading so saving an existing file preserves the original hierarchy.

## [2.0.0] - 2025-07-03

### Added

- NXsample `propagation_distance`, `x_pixel_size`, and `y_pixel_size` fields.
- NXsource `distance` field.
- NXdetector `sequence_number` field.

### Changed

- Minimum supported Python version is now 3.9.
- Unit handling migrated to Pint.

## [1.4.0] - 2025-04-03

### Changed

- Rename `NXtomoDetectorDataSplitter` to `NXtomoSplitter`.
- Drop the NumPy < 2.0 restriction.

### Removed

- Deprecated `base_tilt` and `rocking` attributes.
- Legacy `setup.py`.

## [1.3.0] - 2024-11-29

### Changed

- `NXtomoDetectorDataSplitter.split` now prefers `tomo_n` over `nb_part` (!53).

## [1.2.0] - 2024-01-24

### Added

- Split the tutorial into dedicated guides for editing datasets and creating them from scratch.

### Changed

- Support silx 2.0 and adopt the PyData Sphinx theme.

## [1.1.0] - 2023-09-27

### Deprecated

- `NXtomo` constructor `node_name` parameter (calls now ignore it when provided).

### Changed

- `NXtomo.save` requires the `data_path` argument.

## [1.0.0] - 2023-08-07

### Added

- Initial release featuring the NXtomo application definition, NeXus object helpers (NXdetector, NXinstrument, NXmonitor, NXsample, NXsource, NXtransformations), and path utilities for tomography datasets.

[3.0.4]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v3.0.3...v3.0.4
[3.0.3]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v3.0.2...v3.0.3
[3.0.2]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v3.0.1...v3.0.2
[3.0.1]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v3.0.0...v3.0.1
[3.0.0]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v2.0.1...v3.0.0
[2.0.1]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v2.0.0...v2.0.1
[2.0.0]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v1.4.0...v2.0.0
[1.4.0]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v1.3.0...v1.4.0
[1.3.0]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v1.2.0...v1.3.0
[1.2.0]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v1.1.0...v1.2.0
[1.1.0]: https://gitlab.esrf.fr/tomotools/nxtomo/-/compare/v1.0.0...v1.1.0
[1.0.0]: https://gitlab.esrf.fr/tomotools/nxtomo/-/tree/v1.0.0
