Releases: tillbiskup/aspecd
Version 0.12.0
Released 2024-12-22
Note: This version comes with a new version of the recipe format: 0.3. Existing recipes are updated automatically on import.
New features
-
I/O
- Importer logs warning if importing did not populate data array in dataset.
-
Plotting
- Attribute
climin :class:aspecd.plotting.SurfaceProperties - Parameter
thresholdfor determining the levels of a contour plot in class :class:aspecd.plotting.SinglePlotter2D - Attributes
number_of_colorsandfirst_colorin :class:aspecd.plotting.MultiPlot1DProperties: Fixed number of elements from colormap, to have same colour succession in plots with different number of curves if a colormap is specified, and potential offset in colormap if starting with white/a light colour. - Attributes
normandnorm_parametersin :class:aspecd.plotting.SurfaceProperties.
- Attribute
-
Plot annotations
- Parameter
unitsin :class:aspecd.annotation.Text, :class:aspecd.annotation.Marker, :class:aspecd.annotation.VerticalLine, :class:aspecd.annotation.HorizontalLine, :class:aspecd.annotation.VerticalSpan, and :class:aspecd.annotation.HorizontalSpanallowing to position using axes rather than data coordinates.
- Parameter
-
Processing
- :class:
aspecd.processing.SliceRearrangementfor rearranging slices of a dataset along one dimension. - :class:
aspecd.processing.DatasetAlgebraoperates on a list of datasets, allowing to add/subtract multiple datasets from a given dataset. - :class:
aspecd.processing.Denoising1DSVDfor denoising 1D datasets using singular value decomposition.
- :class:
-
Tasks
- Functions
addandmultiplyfor properties of tasks in recipes. - New default setting
number_of_colorson recipe level: Fixed number of elements from colormap, to have same colour succession in plots with different number of curves if a colormap is specified. - Tasks can be marked as to be skipped, using the
skipkeyword on the top level of the task definition in a recipe.
- Functions
Changes
-
Recipe structure changed slightly: The
settingsdictionary has a new sub-dictionarycolors, and thedefault_colormapkey moved there, together with the new keysnumber_of_colorsandfirst_color.- New recipe format version: 0.3.
- Existing recipes are updated automatically on import.
-
Figure properties (see :class:
aspecd.plotting.FigureProperties) are applied to the figure before the actual plotting is done, as some plotters need to know the (final) figure size or else. -
Axes properties (see :class:
aspecd.plotting.AxesProperties) are applied to the axes before the actual plotting is done, as some plotters need to know the (final) axes limits or else.
Fixes
- Plotter with colorbar work with recipes (no longer recursion in
to_dict()) - :class:
aspecd.processing.SliceRemovalhandles lists properly - :class:
aspecd.processing.SliceRemovalremoves value(s) from corresponding axis - :class:
aspecd.processing.Averaginghandles inverted axes (e.g., ppm scale) correctly regardless how ranges are given - :class:
aspecd.plotting.MultiPlot1DPropertieshandles explicit colours of individual drawings correctly.
Updated requirements
- bibrecord >= 0.2
Version 0.11.0
Released 2024-10-17
New features
-
Plotting
aspecd.plotting.PatchPropertiesfor properties of patches, as used foraspecd.annotation.VerticalSpanandaspecd.annotation.HorizontalSpan.aspecd.plotting.AnnotationPropertiesandaspecd.plotting.AnnotationTextPropertiesfor properties of text annotations with lines, as used foraspecd.annotation.TextWithLine.aspecd.plotting.AxesPropertieshas new attributesframe_on,xlabelposition, andylabelposition.aspecd.plotting.Spinesandaspecd.plotting.SpinePropertiesfor controlling spine properties of axes.aspecd.plotting.MarkerPropertiesfor properties of markers, as used foraspecd.annotation.Marker.
-
Plot annotations
aspecd.annotation.VerticalSpanfor adding vertical spans (rectangles) to plot(ter)saspecd.annotation.HorizontalSpanfor adding horizontal spans (rectangles) to plot(ter)saspecd.annotation.TextWithLinefor adding text with additional linesaspecd.annotation.Markerfor adding markers to plot(ter)saspecd.annotation.FillBetweenfor colouring the surface below a curve.
-
Analysis
aspecd.analysis.PeakFindingcan return both, peak positions and intensities, as pairs, ready to be used inaspecd.annotation.TextWithLineannotations.aspecd.analysis.CentreOfMassfor calculating the centre of mass for ND datasets.
-
IO
aspecd.io.TxtImporterhas an additional parameteraxisspecifying which column to use for axis values when reading 2D data. (#6)
Changes
-
Plotting: Default figure size in
aspecd.plotting.FigurePropertiesset toNoneto allow setting from matplotlibrc to take effect.Without adjustments, this may change the size (and aspect ratio) of your figures from 6x4 inches to 6.4x4.8 inches.
Fixes
- CompositePlotter operates on copies of plotters.
- Plot task writes correct filename for each plotter if results is used.
- PlotannotationTask saves properties to recipe history.
- PlotannotationTask can be applied to plotter and stored for later use as result at the same time.
- Text plot annotation with scalar y position set to zero works.
Version 0.10.1
Released 2024-08-13
Fixes
- CompositePlotter shares axes correctly
Version 0.10.0
Released 2024-08-10
New features
-
Plotting
- Set individual properties for each of the lines of a
aspecd.plotting.SinglePlotter2DStacked - Conveniently set identical properties for all lines of
aspecd.plotting.SinglePlotter2DStackedandaspecd.plotting.MultiPlotter1D aspecd.plotting.TextProertiesaspecd.plotting.DrawingPropertieshas attributezorder.aspecd.plotting.SubplotGridSpecsfor properties of the subplot grid of a CompositePlotter.aspecd.plotting.CompositePlotterallows to share x and y axes.
- Set individual properties for each of the lines of a
-
Plot annotations
aspecd.annotations.Textfor text annotations to plot(ter)s
-
Tasks
aspecd.tasks.SingleplotTaskallows to set as many results as datasets, to allow for adding an individual plotter (for one of the datasets) to aaspecd.tasks.CompositeplotTask. (#3)
-
Models
aspecd.model.Voigtianfor creating Voigt profiles frequently used in spectroscopy to describe line shapes.
Fixes
-
Tasks
aspecd.tasks.MultiplotTaskpreserves order of datasets the task is applied to, regardless whether the datasets are originally imported or result from prior tasks (viaresultproperty). (#2)aspecd.tasks.Recipe.get_datasetspreserves order of datasets, regardless whether the datasets are originally imported or result from prior tasks (viaresultproperty).aspecd.tasks.Chef.cookcloses open figures.
-
Plotting
CompositePlotterdoes not add additional drawings any more to the plotters used. (#5)
Version 0.9.3
Released 2024-07-22
Fixes
- Correct method for area normalization: take number of points into account.
- Adjust stacking in
SinglePlotter2DStackedfor data with larger minima than maxima. - Templates for LaTeX dataset report: escape
_and#in dataset label. - Axis labels can be removed by setting one or both of
xlabelandylabeltoNone(ornullin YAML/recipe).
Version 0.9.2
Released 2024-03-24
Fixes
- Revert changes in :class:
aspecd.utils.ToDictMixinfrom version 0.9.1, as it caused problems with Matplotlib. - Updates on contour plots to work with Matplotlib 3.8
- Updates to prevent deprecation warning for NumPy 1.25
- :class:
aspecd.processing.RangeExtractionextracts correct range for axis values.
Version 0.9.1
Released 2024-01-15
Fixes
aspecd.utils.ToDictMixindoes no longer modify the__dict__or__odict__property of a class directly, what may have resulted in unexpected behaviour, but operates on a (deep)copy.
Changes
- Use Black for automatic code formatting
Version 0.9.0
Released 2024-01-13
New features
-
Processing steps
aspecd.processing.CommonRangeExtractionworks for ND datasets with arbitrary dimension N
-
Plotting
-
Legend title can be set from recipes
-
New attribute
aspecd.plotting.AxesProperties.invertfor inverting axes. Helpful, e.g., for plotting FTIR data without having to resort to explicitly provide descending axis limits. -
Setting font size of axes labels via
label_fontsizeproperty. -
Colorbar for 2D plotter
-
Annotations for plots
-
-
Device data
-
New property
aspecd.dataset.Dataset.device_datafor storing additional/secondary (monitoring) data. -
New class
aspecd.dataset.DeviceDatafor device data. -
New class
aspecd.analysis.DeviceDataExtractionfor extracting device data from a dataset as a separate dataset. This allows to proceed with the extracted datasets as with any other dataset. -
New class
aspecd.plotting.MultiDeviceDataPlotter1Dfor plotting multiple device data of a single dataset. -
New parameter
device_datainaspecd.plotting.Plotterfor plotting device data rather than primary data of a dataset/datasets
-
-
Logging
- New function
aspecd.utils.get_loggerto get a logger object for a given module with the logger within the hierarchy of the ASpecD root logger. Important for packages derived from the ASpecD framework in order to get their log messages being captured, e.g. during recipe-driven data analysis.
- New function
Changes
-
Plotters can now handle device data instead of the primary data of a dataset (see above). This means, however, that instead of accessing
self.dataset.data(orself.datasets[#].data), plotters need to accessself.data.data(orself.data[#].data) instead.Authors of derived packages should update their plotters accordingly. See the hints for developers on device data in the plotting module.
-
Serving recipes logs messages from all ASpecD modules, not only from the
aspecd.tasksmodule. -
aspecd.io.DatasetImporterFactorylogs warning if no concrete importer could be found for a given dataset, as this will usually result in (sometimes hard to detect) downstream problems. -
aspecd.io.DatasetExporteradds a history record toaspecd.dataset.Dataset.tasks. -
aspecd.plotting.SinglePlotter1Dandaspecd.plotting.MultiPlotter1Dissue warning with log plotters and negative values. -
aspecd.annotation.DatasetAnnotationhas been renamed fromAnnotationto reflect the fact that there are now plot annotations as well.
Documentation
- New example: Plotting FTIR spectra normalised to spectral feature
- Section with general tips and tricks for styling plotters.
Fixes
aspecd.utils.ToDictMixin.to_dictdoes not traverse settings for properties to exclude and include.- Workaround for
matplotlib.figure.Figure.savefignot correctly handling figure DPI settings.
Version 0.8.3
Released 2023-09-08
Fixes
- Exporter tasks (
aspecd.tasks.ExportTask) automatically save datasets with default name if no target is provided. - Correct setting of contour plot properties with newer versions of Matplotlib
Changes
aspecd.processing.Interpolationchanged interpolation method for 2D data from deprecatedscipy.interpolate.interp2dtoscipy.interpolate.RegularGridInterpolator
New features
aspecd.processing.Interpolationworks for ND datasets with arbitrary dimension Naspecd.tasks.Recipewith new settingautosave_datasets(default:True)
Version 0.8.2
Released 2023-08-24
Fixes
- Handling of too long filenames when saving plots: the filename is replaced by its MD5 hash.
New features
- New setting
default_colormapin recipes. - Property
colormapinaspecd.plotting.SinglePlot2DProperties, allowing for consistently setting (default) colormaps for 2D surface plots within a recipe.