# v0.29.x series

## v0.29.0 (7th October 2024)

In this major release, we add official support for polarized radiative
transfer simulation. Polarization is currently supported for the atmosphere
(molecular and aerosol components), stay tuned for updates on polarized surface
models. This feature is controlled by the mode switcher: just call
`eradiate.set_mode("mono_polarized")` or
`eradiate.set_mode("ckd_polarized")` when you start setting up your
simulation. After post-processing, the four Stokes vector components are added
to the output product.

We also heavily refactored the components that handle the spectral dimension.
We clarified the spectral discretization model and modified some interface
points to make things more explicit. We significantly improved spectral
component inspection (typically, the spectral grid and spectral response
functions). Have a look at our revamped
{doc}`spectral discretization guide </src/user_guide/spectral_discretization>`.

Finally, we updated our surface mesh generation component to also add texture
coordinates to the produced mesh. This allows to define surface textures, a key
feature when it comes to assembling 3D scenes.

```{warning}
When upgrading, pay attention to the following:

* When setting up an experiment, the parameter controlling the spectral
  quadrature point count configuration is changed from ``quad_spec`` to
  ``ckd_quad_config``. This parameter now accepts a {class}`.CKDQuadConfig`
  instance or a dictionary. You will have to update this if you were using this
  feature.

* Instrument spectral response functions are now specified using the
  {class}`.SpectralResponseFunction` type. The dictionary syntax remains
  unchanged. SRF objects can now be visualized in Jupyter notebooks.
```

### Removed

* ⚠️ The {class}`.SpectralSet` class and children are removed ({ghpr}`439`).
  Spectral discretization is now handled by the {class}`.SpectralGrid` class and
  its children.
* ⚠️ The {meth}`.Atmosphere.spectral_set` method is removed ({ghpr}`439`). The
  responsibility of deriving a spectral grid from a molecular absorption
  database is transferred to the {meth}`.SpectralGrid.from_absorption_database`
  constructor.
* ⚠️ The {class}`.MultiDeltaSpectrum` class is removed ({ghpr}`439`). Spectral
  response functions are now modelled using dedicated types
  ({class}`.SpectralResponseFunction` and children).
* ⚠️ Several SRF-related methods of the {class}`.Spectrum` family are removed
  ({ghpr}`439`). The corresponding functionality is transferred to the
  {class}`.SpectralResponseFunction` family.
* ⚠️ The {class}`.QuadSpec` class is removed ({ghpr}`439`). Its functionality is
  transferred to the {class}`.CKDQuadConfig` type.
* ⚠️ The {meth}`.AbstractHeterogeneousAtmosphere.eval_transmittance_accross_spectral_set`
  is removed and its functionality transferred to the
  {func}`.eval_transmittance_mono` and {func}`.eval_transmittance_ckd` helpers
  ({ghpr}`439`).

### Added

* The {func}`.mesh_from_dem` function optionally adds texture coordinates to the
  generated mesh ({ghpr}`435`).
* The {class}`.BufferMeshShape` class can now initialize texture coordinates as
  well ({ghpr}`435`).
* Added polarized mode, Rayleigh and tabulated phase functions ({ghpr}`438`,
  {ghpr}`445`).
* A new {class}`.SpectralGrid` type hierarchy is added ({ghpr}`439`). It handles
  the spectral discretization.
* A new {class}`.SpectralResponseFunction` type hierarchy is added
  ({ghpr}`439`). It models the spectral response function of instruments.
* 🖥️ A new {class}`.SubtypeDispatcher` type is added ({ghpr}`439`). This class
  is a very simple factory intended to dispatch subtypes of a parent type
  depending on the current active mode.
* 🖥️ A new {func}`.is_sorted` validator is added ({ghpr}`439`).

### Changed

* The CLI now displays standard stack traces instead of prettifying them with
  Rich ({ghpr}`434`). The previous behaviour is still available with the
  `--debug` CLI option.
* Improved error reporting when loading absorption databases with corrupt index
  files ({ghpr}`434`).
* 🖥️ Updated Mitsuba submodule to v0.3.0 ({ghpr}`444`).
* ⚠️ The `quad_spec` parameter of the {class}`.Experiment` constructors is
  replaced by the `ckd_quad_config` parameter ({ghpr}`439`).
* ⚠️ The {attr}`.Measure.srf` field is now a {class}`.SpectralResponseFunction`
  instance ({ghpr}`439`). The dictionary interface used in {class}`.Measure`
  constructors remains unchanged.
* ⚠️ The {mod}`eradiate.spectral` subpackage is reorganized ({ghpr}`439`).
  The main components are still exposed in {mod}`eradiate.spectral` directly.
* ⚠️ The background spectral grid, formerly exposed as
  {data}`.Experiment.default_spectral_set`, is now private and renamed
  `_background_spectral_grid` ({ghpr}`439`). It can still be configured by the
  `background_spectral_grid` parameter.
* 📖 Overhauled the
  {doc}`Spectral discretization guide </src/user_guide/spectral_discretization>`
  ({ghpr}`439`).
* 📖 Improved factory documentation ({ghpr}`441`).

### Internal changes

* 🖥️ Added an explicit CKD spectral quadrature calculation step to the
  initialization sequence of {class}`.Experiment` instances ({ghpr}`439`).
* 🖥️ Switched to [Pixi](https://pixi.sh/) for project management ({ghpr}`440`).
* 🖥️ Removed unused `rad_profile_factory` ({ghpr}`441`).
* ⚠️ 🖥️ Refactored *attrs*-based features ({ghpr}`437`).
* ⚠️ 🖥️ The {meth}`.Mode.check` method's signature is changed ({ghpr}`439`). It
  accepts now a combination of {class}`.ModeFlag` values.
* ⚠️ 🖥️ The {class}`.MultiGenerator` is moved to {mod}`eradiate.util.misc`
  ({ghpr}`439`).
* ⚠️ 🖥️ Refactored DEM handling infrastructure ({ghpr}`428`).

## v0.29.1 (25th October 2024)

This is a minor feature release. It updates the radiometric kernel to v0.3.1,
which adds the `selectbsdf` plugin, and introduces the *transitional expert
interface*, which allows to inject Mitsuba scene dictionary fragments manually
in an experiment.

This interface is called 'transitional' because, although its syntax and idioms
can be considered stable, it has not been fully propagated through the Eradiate
codebase yet. This upgrade is planned for the next major release.

### Added

* Introducing the *transitional expert interface* ({ghpr}`452`).

### Changed

* 🖥️ Updated Mitsuba submodule to v0.3.1.
* 🖥️ The {func}`.modes` function now returns a list of identifiers by default
  ({ghcommit}`6f9d50`).

### Fixed

* Fixed incorrect CKD absorption database index generation method ({ghpr}`454`).

## v0.29.2 (9th November 2024)

### Deprecated

* The {func}`eradiate.srf_tools.make_gaussian` function is deprecated. It will
  be removed in v0.31.0. Use {func}`eradiate.spectral.response.make_gaussian` as
  an alternative.

### Added

* Automatically flatten nested dictionaries used for initialization or
  assignments to {class}`.KernelDictTemplate` ({ghpr}`459`).
* Added `spectral_data` parameter to the {func}`.load_rami_scenario` function
  ({ghpr}`462`).

### Changed

* Transferred the Gaussian SRF dataset creation function {func}`.make_gaussian`
  to the {mod}`eradiate.spectral.response` subpackage ({ghpr}`458`).

### Fixed

* Fixed Gaussian SRF padding strategy ({ghpr}`458`).
* Fixed {func}`mi_traverse` name ID override for non-top-level nodes
  ({ghpr}`461`).
