Releases: kmnhan/erlabpy
v3.1.1
v3.1.0
v3.1.0 (2024-11-28)
✨ Features
-
interactive.imagetool: overhaul manager UI (a2ce551)
Replaced widget-based implemenation with a model/view architecture. As a consequence, the displayed interface looks like a list. The user can now click a selected item to rename it, and drag items to reorder them. Each item now has a dedicated right-click menu.
-
interactive.imagetool.manager: improve file opening (da3425f)
Implements opening multiple files at once through the open menu of the manager. Also, add support for opening data files by dragging them into the manager window.
-
interactive.imagetool: add save and load functionality for workspace (a5d38af)
Enables users to save multiple ImageTool windows to a single file using the manager.
-
interactive.imagetool: show dialog when data is being loaded (5577249)
-
interactive.imagetool: change manager icon (3e20e63)
-
interactive.imagetool.manager: add menubar to manager (59326a1)
-
io.plugins: add summary generation to maestro loader (aa6f5d2)
-
plotting: add fine-grained control over color limit normalization (46c962f)
-
interactive.imagetool: open ktool from imagetool (d2cb8a7)
-
interactive.imagetool: add equal aspect ratio checkbox to right-click menu (d4db0cf)
-
interactive.imagetool: add crop menu (639749f)
-
interactive.utils: add qobject that handles mutually exclusive selection comboboxes (33b5f6b)
-
interactive.imagetool: add rename button to manager (56ac884)
-
interactive.imagetool: add open in new window option to right-click menu of each plot (8742659)
-
accessors.general: added
qshow.params
accessors for fit results (2592e5a)Calling
ds.qshow.params()
on a fit result dataset will now plot the coefficient value and errorbars as a function of fit coordinates. -
analysis.fit: add Fermi-Dirac distribution to MultiPeakFunction components (65a1e8c)
-
io.dataloader: add itool button to interactive summary (ba3aa15)
A button that can open the data directly in ImageTool has been added to the interactive summary. The button is displayed when the interactive summary is called while the ImageTool manager is running.
🐞 Bug Fixes
- io.plugins.lorea: fix file dialog method (4c74105)
- interactive.imagetool: resolve segfault on save current data (5699fa3)
- interactive.imagetool: retain axis order when opening dtool and goldtool (e14c9fc)
- io.plugins.merlin: fix match signature (5586cce)
- interactive.imagetool: cursor sync for non-uniform coords (4aa1425)
- io.plugins.maestro: fix wrong temperature attribute (6ed2a70)
- io.dataloader: allow dimensions without coordinates in output data (752facf)
- interactive: improve ktool compatibility with manager (4c775cf)
- interactive.imagetool: fix opening slice in new tool when manager is running (db8e0af)
- interactive.utils: fix opening with manager in tools (3726049)
- accessors.general: allow
qshow
for fit results from multivariable Datasets (f5b88e7) - interactive.imagetool: fix wrong decimals for rotation center (3fc3a50)
- accessors.general: fix component plotting for concatenated fit datasets with multiple models (7d2976d)
⚡️ Performance
-
interactive.imagetool: improve associated tool garbage collection (839dab0)
-
io: implement lazy loading for h5netcdf and nexusformat imports (3f219ae)
-
speed up initial import (d7f3b3c)
Accelerates initial import time by refactoring heavy imports to reside inside functions.
Importing the plotting module no longer automatically imports the colormap packages
cmocean
,cmasher
, andcolorcet
. The user must add manual import statements. -
analysis.interpolate: cache jitted interpolation functions (34521ef)
-
interactive.imagetool: optimize memory usage by reducing circular references (a675e1a)
🛠 Code Refactor
-
interactive.imagetool: make it easier to show and hide windows in manager (aefc560)
-
interactive.imagetool: use
QSharedMemory
instead ofmultiprocessing
(234c19f) -
plotting.general: use matplotlib api instead of xarray plot for 1D (9e38b2c)
-
io.dataloader: improve warning messages and error handling (1ebfa72)
-
interactive: move IconButton to interactive utils and add IconActionButton (e78190f)
-
interactive.imagetool: use HDF5 files instead of pickle to cache tools (be66297)
-
move
AxesConfiguration
fromerlab.analysis.kspace
toerlab.constants
(3593d41) -
plotting: streamline igor CT loading (e1e8baa)
-
io: update type hints for file handling functions to use Iterable (e3caf83)
-
io: streamline file identification logic and add user warnings for multiple file scenarios (05b7e6c)
-
io: replace several
os.path
calls with pathlib (bdfdd22) -
dataloader: make some methods private (31cf008)
This makes all dataloader methods and attributes that are not meant to be overriden private. Affected methods and properties are
combine_multiple
,generate_summary
, andname_map_reversed
. -
accessors.kspace: cleanup namespace (7af0d66)
Withdraws some internal properties and methods from public API.
-
directly import
_THIS_ARRAY
from xarray core (3bd72ec) -
interactive.imagetool: improve dialog code structure (5a16686)
-
interactive.imagetool: move dialogs into new dedicated module (a90a735)
-
interactive.imagetool: improve error messages for invalid data (a715ba1)
[main d94b1b7] bump: version 3.0.0 → 3.1.0
2 files changed, 2 insertions(+), 2 deletions(-)
v3.0.0
v3.0.0 (2024-11-06)
Breaking Changes
-
Deprecated module
erlab.io.utilities
is removed. Useerlab.io.utils
instead. (e189722) -
Deprecated module
erlab.interactive.utilities
is removed. Useerlab.interactive.utils
instead. (af2c81c) -
Deprecated module
erlab.characterization
is removed. Useerlab.io.characterization
instead. (8d770bf) -
Deprecated module
erlab.analysis.utils
is removed. Useerlab.analysis.transform.shift
anderlab.analysis.gold.correct_with_edge
. (0b2ca44) -
Deprecated alias
slice_along_path
inerlab.analysis
is removed. Call fromerlab.analysis.interpolate
instead. (305832b) -
Deprecated aliases
correct_with_edge
andquick_resolution
inerlab.analysis
are removed. Call fromerlab.analysis.gold
instead. (075eaf8) -
Removed deprecated aliases
load_igor_ibw
andload_igor_pxp
. Usexarray.open_dataarray
andxarray.open_dataset
instead. (7f07ad2) -
The default attribute name for the sample temperature is changed to
sample_temp
fromtemp_sample
. This will unfortunately break a lot of code that relies on the keytemp_sample
, but will be easy to refactor with find and replace. (32e1cd5) -
All dataloaders must now add a new keyword argument to
load_single
, but implementing it is not mandatory.Also, dataloaders that implements summary generation by overriding
generate_summary
must now switch to the new method.See the summary generation section in the updated user guide.
Furthermore, the
isummarize
method is no longer public; code that uses this method should usesummarize
instead.The
usecache
argument to thesummarize
method is no longer available, and the cache will be updated whenever it is outdated. (0f5dab4)
Features
-
io.igor: enable loading experiment files to DataTree (1835be0)
Added methods to the backend to allow using
xarray.open_datatree
andxarray.open_groups
with Igor packed experiment files. Closes #29 -
add
qinfo
accessor (eb3a742)Adds a
qinfo
accessor that prints a table summarizing the data in a human readable format. Closes #27 -
interactive.kspace: pass lattice parameters and colormap info to
ktool
(6830af3)Added the ability to pass lattice vectors and colormaps to
ktool
. -
interactive.kspace: add circle ROI to ktool (304e1a5)
Added a button to the visualization tab which creates a circle ROI. The position and radius can be edited by right-clicking on the roi.
-
interactive.colors: add zero center button to right-click colorbar (c037de1)
-
interactive.imagetool: add
.ibw
and.pxt
files to load menu (73c3afe) -
io.dataloader: allow passing rcParams to interactive summary plot (a348366)
-
io.dataloader: implement automatic summary generation (0f5dab4)
It is now much easier to implement a summary generation mechanism. This commit also adds a new keyword argument to
load_single
that can greatly speed up summary generation. -
io.dataloader: support callable objects in
additional_attrs
(e209499)
Bug Fixes
- interactive.imagetool: fix copy cursor value for numpy 2 (dc19c82)
- io.dataloader: retain selected dimension in interactive summary (9d54f8b)
- accessors.general: keep associated coords in
qsel
when averaging (03a7b4a) - io.dataloader: ignore old summary files (bda95fc)
- io.plugins.kriss: fix KRISS ibw file match pattern (7ced571)
- analysis.gold: retain attributes in
quick_resolution
(504acdc) - do not require qt libs on initial import (118ead6)
Code Refactor
-
io.igor: change wave dimension name handling (3e0586a)
Waves with both dim and unit labels provided were given a dim label formatted like
dim(unit)
. This update changes this so that the dim label is justdim
, and the unit is inserted to coordinate attrs. -
io: remove deprecated module (e189722)
-
interactive: remove deprecated module (af2c81c)
-
remove deprecated module
erlab.characterization
(8d770bf) -
analysis: remove deprecated module (0b2ca44)
-
analysis: remove deprecated alias (305832b)
-
analysis: remove deprecated aliases (075eaf8)
-
interactive.imagetool.manager: add prefix to temporary directories for better identification (e56163b)
-
io.plugins: implement DA30 file identification patterns in superclass (f6dfc44)
-
io: remove deprecated aliases (7f07ad2)
-
change temperature attribute name (32e1cd5)
Changes
temp_sample
tosample_temp
for all data loaders and analysis code. -
utils.formatting: change formatting for numpy arrays (95d9f0b)
For arrays with 2 or more dimensions upon squeezing, only the minimum and maximum values are shown. Also, arrays with only two entries are displayed as a list.
-
io.dataloader: disable parallel loading by default (fed2428)
Parallel loading is now disabled by default since the overhead is larger than the performance gain in most cases.
-
change some warnings to emit from user level (e81f2b1)
-
io.dataloader: cache summary only if directory is writable (85bcb80)
-
io.plugins: improve warning message when a plugin fails to load (9ee0b90)
-
io: update datatree to use public api (6c27e07)
Also bumps the minimum supported xarray version to 2024.10.0.
-
io.dataloader: make
RegistryBase
private (df7079e) -
io.dataloader: rename loader registry attribute
default_data_dir
tocurrent_data_dir
(d87eba7)The attribute
default_data_dir
has been renamed tocurrent_data_dir
so that it is consistent withcurrent_loader
. Accessing the old name is now deprecated.Also, the
current_loader
andcurrent_data_dir
can now be assigned directly with a syntax likeerlab.io.loaders.current_loader = "merlin"
.
Performance
- io.plugins.da30: faster summary generation for DA30 zip files (22b77bf)
- io.igor: suppress
igor2
logging (5cd3a8c) - analysis.interpolate: extend acceleration ([84daa88](84daa8866ec4223555568f441b601...
v2.12.0
v2.12.0 (2024-10-22)
Features
-
interactive.imagetool: add normalization option to View menu (53e2cf2)
-
io.dataloader: allow passing additional arguments to
load_single
(1652c20) -
io.plugins: add support for two new beamlines, closes #61 (368263e)
Added plugins with preliminary support for Diamond I05 and ALBA BL20 LOREA.
-
io: add
nexusutils
module for working with NeXus files (2532941)This commit adds a new submodule
io.nexusutils
that contains utilities for converting NeXus data to xarray data structures.
Bug Fixes
- erlab.io.plugins.merlin: resolve typo in file dialog methods (39caa99)
- erlab.accessors.general: make
qsel
accessor work along dimensions with no coordinates (7f0d259) - interactive.imagetool: avoid errors on termination (9fd044b)
Code Refactor
- io: return path-like objects instead of strings in
get_files
(2eb9166)
[main 4b366a0] bump: version 2.11.2 → 2.12.0
2 files changed, 24 insertions(+), 1 deletion(-)
v2.11.2
v2.11.1
v2.11.0
v2.11.0 (2024-10-13)
Features
-
io.dataloader: add new argument that can control combining (bdec5ff)
Adds a new parameter
combine
toio.load
. IfFalse
, returns a list of post-processed files without attempting to concatenate or merge the data into a single object. IfTrue
, retains the current default behavior.
Bug Fixes
- imagetool: allow coords of any dtype coercible to float64 (4342ebc)
- io.dataloader: properly handle combining multi-axis scans (2cd22c7)
Code Refactor
- io.plugins: update type hints (54d0c5d)
- remove unused imports (f1e35de)
- interactive: add informative error message for missing pyqt (1347a02)
- io.plugins: add warning when plugin load fails (ed5b184)
[main 8e66420] bump: version 2.10.0 → 2.11.0
2 files changed, 21 insertions(+), 1 deletion(-)
v2.10.0
v2.10.0 (2024-10-08)
Features
-
io.plugins: add loader for beamline ID21 ESM at NSLS-II (c07e490)
This commit adds a new data loader for beamline ID21 ESM at NSLS-II, Brookhaven National Laboratory.
-
io.dataloader: add formatters (2ee9a4a)
A new attribute named
formatters
and a new methodget_formatted_attr_or_coord
has been added to loaders. This allows custom per-attribute pretty-printing behavior. -
io: add parallel argument to
load
(88cd924) -
io: add xarray backend for igor files (1fe5ca5)
.pxt
,.pxp
, and.ibw
files can now be opened with xarray methods such asxr.open_dataset
andxr.open_dataarray
. See the updated user guide for more information.
Bug Fixes
-
io.dataloader: properly reorder coordinates (3ebfb0f)
Coordinate order was broken for loaders which assign coordinates in inherited
post_process
. This is now fixed, and returned data will be consistently ordered with respect to the mapping, with the dimension coordinates coming first. -
erlab.io.plugins.maestro: temporary fix for xarray issue (c2d04a3)
-
io.plugins.da30: properly handle output types (6297aba)
The DA30 loader now tries to return a dataset from
.zip
files only when there are no coordinate conflicts. In the case of conflicts, the loader will return aDataTree
.Also, single region DA30
.pxt
files will now return aDataArray
consistent with the equivalent.ibw
file. -
interactive.fermiedge: allow transposed input to fermi edge fitting tool (dcae75e)
-
interactive.imagetool: retain attrs when exporting slice (1bed572)
When accessing the data of a single slice from the right-click menu of
ImageTool
, the attributes of the original data are now kept. This allows saved slices or data opened in other tools to retain their attributes. -
resolve gui script not working on windows with conda (62253d0)
-
io.dataloader: clear plot before loading in interactive summaries (21d6dea)
-
plotting.general: fix
plot_slices
compatibility with slice object as argument (5948a7b) -
io: disable memmapping when loading data (c39da1b)
Memmapping seemed to interfere loading multiple files when called through ipywidgets.
Code Refactor
-
io.utils: use pathlib in
get_files
(b7a0f5b) -
io.plugins.merlin: combine ImageTool file menu into single entry (6e28ac2)
-
io: add postprocessing and validation for
DataTree
objects (3fb3ff5) -
io: add warning when file is ambiguous (8daabb8)
-
io: remove renaming steps from
load_single
in multi-file loaders (542f4f2)Combining before renaming coords should be more straightforward
-
io: allow missing alpha coord (c9deed4)
Validation checks will not warn about missing detector angle, allowing XPS measurements.
-
io.dataloader: only allow real file or folder names as input (b9a59cc)
The previous behavior allowed passing
f_001.pxt
to loadf_001_S001.pxt
,f_001_S002.pxt
... but this was confusing since there is no file namedf_001.pxt
. This commit disallows such input. -
cleanup erplot namespace (007eedb)
-
io: implement metaclass (e787b1c)
Whenever the
identify()
method failed to find any files, subclasses had to explicitly raiseFileNotFoundError
. This resulted in a lot of boilerplate code and ambiguous error messages. Now, all subclasses can just returnNone
inidentify()
when no files are found. The appropriate error is automatically raised. -
io.igor: raise OSError on load fail (6c7a4c4)
-
move dataloader cell formatting implementation to utils module (0f2cb1c)
-
io: deprecate calling igor functions from top level namespace (bb8af7c)
Calling
erlab.io.load_wave
anderlab.io.load_experiment
is deprecated. When writing new code, usexarray.load_dataarray
andxarray.load_dataset
instead.
Performance
- interactive.imagetool: improve manager speed (891c4ee)
[main 04f06a0] bump: version 2.9.1 → 2.10.0
2 files changed, 6 insertions(+), 2 deletions(-)
v2.9.1
v2.9.0
v2.9.0 (2024-08-30)
Feat
-
interactive.imagetool: add rotation (fdeb8a9)
A rotation dialog has been added to the Edit menu. Rotation guidelines can be overlaid on the main image.
-
interactive.utils: add rotatable lines that can be rotated by dragging (31b55e5)
-
analysis.transform: add
rotate
function (83a2ad8)Added a new function that can rotate DataArray values using spline interpolation. Previous simple implementations are marked as deprecated.
-
utils.array: add new function
trim_na
(c628b5b)This function trims the edges of DataArrays where all values are NaN.
-
accessors.kspace: add method argument (204073e)
Momentum conversion through the
convert()
method of the kspace accessor now supports an additional keyword argumentmethod
that can be used to choose different interpolation methods supported byscipy.interpolate.RegularGridInterpolator
. Note that methods other than'linear'
will take much longer to execute. -
analysis.interpolate: add solver args (24be3b0)
FastInterpolator
now supportssolver
andsolver_args
keyword arguments introduced in scipy 1.13.0. -
interactive.colors: implement
BetterColorBarItem
limit editor (7dd1477)A new context menu in
BetterColorBarItem
's viewbox enables manually editing color limits. -
analysis.interpolate: implement slicing along a vector (cba8567)
A new function
slice_along_vector
has been added which enables interpolating through a line defined by a vector and a point. -
interactive.imagetool: add goldtool and dtool to menu (33d5e35)
The interactive tools goldtool and dtool are now directly accessible from the right-click menu of 2D images in ImageTool.
-
accessors.general: add option to
qsel.around
to disable averaging (5aaed85) -
plotting.general: add
NonUniformImage
functionality toplot_array
(86d8c1a)plot_array
can now plot data with unevenly spaced coordinates. It usesmatplotlib.image.NonUniformImage
with the default interpolation option set to 'nearest'. The resulting plot may be different fromxarray.DataArray.plot
which usespcolormesh
to generate image plots. -
interactive.imagetool: add copy limits to colorbar menu (29c37c4)
Right-clicking on the colorbar will now show a menu which contains a button that copies the current color limits to the clipboard. This is useful when manually adjusting color limits.
Fix
- interactive.imagetool: properly disconnect signals (dce236f)
- interactive.imagetool: fix autoscale when loading data (2c12f59)
- interactive.imagetool: scale spinbox decimals relative to coordinate step size (9a801a5)
- interactive.utils: update
BetterSpinBox
width on changing decimals (0a70884) - interactive: fix compatibility issue with PySide6 (da5f4af)
- interactive.imagetool: do not copy code when unnecessary (9131029)
- accessors.general: qshow now triggers hvplot properly for 1D data (8a84813)
- interactive.imagetool: make manager socket use default backlog (0ac7f0b)
- interactive.imagetool: ensure proper socket termination in manager (2cceb27)
Refactor
-
interactive.utils: improve code generation (78c403f)
-
analysis: move
shift
totransform
(08baf05)The
shift
function has been moved fromutils
totransform
. Calling from theutils
module is now deprecated. -
analysis: cleanup namespace (e3e641d)
Three functions that were directly accesible from the
erlab.analysis
namespace are now deprecated. Import them from their respective modules. -
remove deprecated module
analysis.utilities
(8b79ab5) -
analysis.image: add check for NaN in input (095554f)
Derivative functions now check for NaNs in input data and raise a warning.
The interactive derivative tool automatically fills NaNs in the input data with zeros and shows a warning message.
-
remove unpacking inside
np.r_
(6c27864) -
improve initial import time (f720973)
[main de5f096] bump: version 2.8.5 → 2.9.0
2 files changed, 24 insertions(+), 2 deletions(-)