Skip to content

Releases: nexpy/nexusformat

Support for virtual datasets

02 Jan 19:36
33f1802
Compare
Choose a tag to compare
  • Adds a new NXvirtualfield class to implement HDF5 virtual datasets.
  • Checks for virtual fields when loading HDF5 files.
  • Adds a new nxconsolidate function and command-line script to consolidate NXdata groups from multiple files into one NXdata group containing a virtual dataset.
  • Adds a new nxdir script to print a NeXus file tree from the command line.
  • Adds support for qualitative color maps in the plot module, with alignment of integer values to the discrete color bands.
  • Converts package to use the latest recommendations for package distribution, such as creating a pyproject.toml file to configure the build backend, moving metadata and requirements from setup.py to setup.cfg, and using setuptools_scm for version management.
  • Improves PEP-8 compliance of code.

Miscellaneous improvements

08 Oct 13:18
229eb81
Compare
Choose a tag to compare
  • Allows the nxsignal and nxaxes values to be set by the field names as well as by NXfield objects.
  • Allows the assignment of NXlinks to nxsignal.
  • Improves reporting of invalid values when setting NXdata properties.
  • Corrects NXdata weights when summing data.
  • Enables plotting of size-1 arrays.
  • Fixes a bug in identifying projection limits of zero range.

Miscellaneous Improvements

16 Aug 19:51
bed18ec
Compare
Choose a tag to compare
  • Adds support for the NeXus definition of data weights defined by the property nxweights. A NXdata function, weighted_data returns the signal divided by the weights.
  • If the plot function is called with the keyword argument weights=True, the data are plotted with the weights applied to the signal.
  • If the plot function is called with the keyword argument aspect=equal, the axes are scaled by the value of the axis attribute scaling_factor if it is present. For example, this corrects the aspect ratio to be equal in absolute units when the axis values are in lattice units or reciprocal lattice units.
  • Adds the NXdata select function to return points from 1D NXdata groups that are divisible by a specified number, optionally combined with an offset value. The default returns the values at all integer axis values (i.e, divisor=1, offset=0).
  • Adds extra keyword options to the plot function (e.g., aspect, cmap, interpolation, bad) to enable plots to reproduce NeXpy options more faithfully.
  • Allows the 1D smoothing to be set as a multiple of the original axis steps to ensure that the smoothed interpolations include the original points.
  • Fixes a bug where a NXdata slab, whose signal is stored in an external file, is returned with the signal name changed to the field name in the external file.

Miscellaneous updates

28 Mar 14:20
dcd5168
Compare
Choose a tag to compare
  • Improves checks of file permissions when opening NeXus files.
  • Fixes an issue preventing plots containing NXfield links that are not saved to a file.
  • Ensures that the nxerrors property only returns a result if it matches the shape of the nxsignal property.
  • Checks for zero range in NXdata projection limits.
  • Returns the length in bytes of a scalar string, rather than the array size, with the len function.
  • Adds an nbytes function to NXfields.
  • Removes deprecated NumPy dtypes.
  • Removes change to the 'bad pixel' color when plotting. Changes to Matplotlib color maps are deprecated in Matplotlib v3.4.

Miscellaneous updates

06 Jan 18:04
7bffe81
Compare
Choose a tag to compare

This release is the first to require Python 3.

  • Speeds up the loading of NeXus files by limiting recursion of group reads to two levels in the hierarchy by default. Lower levels are automatically loaded when they are referenced. Fully recursive loading can be restored by calling the nxsetrecursive function.
  • Adds support for writing HDF5 soft links without the target attribute by adding the a boolean keyword argument, soft, when creating an NXlink. It is set to False by default.
  • Adds support for the interpretation attribute. If the NXdata signal field has the attribute set to 'rgb' or 'rgba', it is plotted as an image by default.
  • Changes the default text encoding to UTF-8, rather than using the system default. This is required by the NeXus standard.
  • Fixes a bug in the rename function preventing affected signal and axes attributes from being updated.
  • Fixes an issue with setting a NXfield dtype of kind 'S' without specifying its length caused by changes in h5py v3.

Miscellaneous enhancements and bug fixes

29 Jun 14:20
761b448
Compare
Choose a tag to compare
  • Makes smart indexing of NXfields consistent with NumPy arrays.
  • Improves handling of scalar values in NXfields derived from masked arrays.
  • Improves formatting of floating point values.
  • Improves floating point precision when computing axis values.
  • Catches import errors when the readline package is not installed.

Miscellaneous enhancements and bug fixes

20 Apr 14:08
933a177
Compare
Choose a tag to compare
  • Improves synchronization of fields or groups within a linked group. It is no longer possible to modify such items directly from the linked group.
  • Improves detection of data for default plots within NXsubentry groups.
  • Adds new NXgroup functions, get_default and set_default for setting and identifying default plots.
  • Adds new any and all functions to NXfields, to mirror the respective NumPy functions.
  • Adds new ndim and shape functions to NXdata to return the respective properties of the signal.
  • Fixes a bug that allowed attributes to be updated when a NeXus file is locked.
  • Fixes a bug when testing the existence of an externally linked path within a corrupted NeXus file.

Miscellaneous changes and bug fixes

04 Dec 19:57
c8cde88
Compare
Choose a tag to compare
  • Adds new NXfield query functions required by NeXpy.
  • Fixes a bug that allows attributes to be modified when a file is in read-only mode.
  • Improves initialization of external links when opening files.

Enhancements and Bug Fixes

05 Nov 03:08
5da4725
Compare
Choose a tag to compare
  • Adds optional file locking to protect NeXus files accessed by multiple processes.
  • Adds a context manager to open and close NeXus files before and after multiple read/write operations.
  • Allows the use of all h5py.Dataset keyword arguments when creating a NXfield, such as maxshape and fillvalue.
  • Adds a NXfield resize function to resize arrays in place within the bounds set by maxshape.
  • Modifies the NXgroup copy function to enable use of h5py.Group copy to copy between files. It accepts the same keyword arguments, for example to embed externally linked data in the copied file. Note that the copy function no longer returns a deep copy of the group, but using deepcopy directly provides the same functionality.
  • Allows h5py.File keyword arguments to be used in the nxload command.
  • Adds a SciPy interpolation function to the NXdata class to smooth one-dimensional data.
  • Adds autocompletion of NeXus group dictionaries as an IPython extension.
  • Adds nxduplicate command-line script for duplicating NeXus files with h5py keyword arguments.
  • Adds nexusformat command-line script to return the package version number.
  • The len function now returns the size of the first dimension, for compatibility with NumPy and h5py.
  • Stores modification times in NXFile instances to allow modifications by external processes to be detected.
  • Improves docstrings for all functions.
  • Adds a suite of pytest functions and implements Travis-CI checks on Github.
  • Fixes a bug when adding two NXentry groups.
  • Fixes a bug where attributes are added to more than one group.
  • Fixes a bug with determining valid plotting axes in files created by Mantid.
  • Improves error messages for missing external links.

Pyplot Bug Fix

10 Jun 03:21
e1e6689
Compare
Choose a tag to compare
  • Fixes a bug with plots using Pyplot.