Ndcube

Latest version: v2.3.1

Safety actively analyzes 722491 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

2.3.0

==================

Breaking Changes
----------------

- "dimensions" property on ~ndcube.NDCube` and `~ndcube.NDCubeSequence` have been deprecated and replaced by "shape" (`684 <https://github.com/sunpy/ndcube/pull/684>`__)


Removals
--------

- The ability to create an `.NDCollection` object with numerical keys is deprecated as it leads to ambiguous behavior when slicing the collection. (`778 <https://github.com/sunpy/ndcube/pull/778>`__)


New Features
------------

- Add Sliceable `~ndcube.meta.NDMeta` class for axis-associated metadata. (`455 <https://github.com/sunpy/ndcube/pull/455>`__)
- Added a new `~ndcube.NDCube.squeeze` method to `ndcube.NDCube`.
It will remove all axes of length 1. (`669 <https://github.com/sunpy/ndcube/pull/669>`__)
- Added `~ndcube.NDCube.quantity` attribute to `~ndcube.NDCube` to return the data array with in the cube with the physical units stored in the `~ndcube.NDCube.unit` attribute. (`677 <https://github.com/sunpy/ndcube/pull/677>`__)
- Enable `~ndcube.NDCube` to be raised to a power. (`678 <https://github.com/sunpy/ndcube/pull/678>`__)
- Added `ndcube.NDCube.shape` as a replacement for "dimensions". (`684 <https://github.com/sunpy/ndcube/pull/684>`__)
- Enable rtruediv on`~ndcube.NDCube` such that a user can now do 1/`~ndcube.NDCube`. (`685 <https://github.com/sunpy/ndcube/pull/685>`__)
- Add a ``keepdims=False`` kwarg to `~ndcube.NDCube.crop` and `~ndcube.NDCube.crop_by_values` setting to true keeps length-1 dimensions default behavior drops these dimensions. (`732 <https://github.com/sunpy/ndcube/pull/732>`__)
- When calling :meth:`ndcube.NDCubeBase.axis_world_coords` or :meth:`ndcube.NDCubeBase.axis_world_coords_values` with a
specific axis or axes specified, the methods now avoid doing calculations for any other uncorrelated axes, offering
significant speedups when those other axes are large. (`767 <https://github.com/sunpy/ndcube/pull/767>`__)
- Add support for passing ``-1`` as an element of the ``bin_shape`` argument to `.NDCube.rebin` which will not rebin along that dimension (sets the bin shape to equal the data shape). (`777 <https://github.com/sunpy/ndcube/pull/777>`__)
- It is now possible to set the ``NDCube.data`` property of a cube with an array of the same shape and unit as the current cube. (`795 <https://github.com/sunpy/ndcube/pull/795>`__)


Bug Fixes
---------

- :meth:`ndcube.NDCube.rebin` ``bin_shape`` argument now accepts a `astropy.units.Quantity` as input if the units are convertible to pixels. (`744 <https://github.com/sunpy/ndcube/pull/744>`__)
- Fix support for astropy 7.0, this involved a change to ``CompoundLowLevelWCS`` so that in handles ``pixel_bounds`` if only one component WCS sets a pixel bound. (`772 <https://github.com/sunpy/ndcube/pull/772>`__)
- Fixed a bug which caused ``NDCubeSequence.cube_like_dimensions`` to break. (`788 <https://github.com/sunpy/ndcube/pull/788>`__)
- Added an internal code to shortcut non-correlated axes avoiding the creation of a full coordinate grid, reducing memory use in specific circumstances. (`798 <https://github.com/sunpy/ndcube/pull/798>`__)


Documentation
-------------

- Added a gallery example (:ref:`sphx_glr_generated_gallery_creating_even_spaced_wavelength_visualisation.py`) showcasing how to create a visualisation of unevenly spaced wavelength data cube using AIA data. (`691 <https://github.com/sunpy/ndcube/pull/691>`__)
- Added a gallery example (:ref:`sphx_glr_generated_gallery_creating_a_gwcs_from_quantities.py`) showcasing how to create a GWCS from quantities. (`695 <https://github.com/sunpy/ndcube/pull/695>`__)


Internal Changes
----------------

- Move code creating a masked array for `ndcube.NDCube.rebin` to a private function which is then called by `ndcube.NDCube.rebin`. (`705 <https://github.com/sunpy/ndcube/pull/705>`__)
- Added explicit support for numpy 2.0. (`729 <https://github.com/sunpy/ndcube/pull/729>`__)

2.2.0

==================

Backwards Incompatible Changes
------------------------------

- `ndcube.NDCollection.aligned_axes` attribute is now property. (`607 <https://github.com/sunpy/ndcube/pull/607>`__)
- Dropped Python 3.8 support
- Increased minimum required for ``astropy`` to 5.0
- Increased minimum required for ``numpy`` to 1.21
- Increased minimum required for ``gwcs`` to 0.18. (`636 <https://github.com/sunpy/ndcube/pull/636>`__)

Features
--------

- Provides `~ndcube.wcs.tools.unwrap_wcs_to_fitswcs`, a function to create a `astropy.wcs.WCS` instance equivalent to a sliced and/or resampled WCS instance.
Only valid if the underlying implementation of the wrapped WCS instance is also an `astropy.wcs.WCS` instance. (`649 <https://github.com/sunpy/ndcube/pull/649>`__)

Bug Fixes
---------

- Fix docstring causing doc build problems for some users. (`600 <https://github.com/sunpy/ndcube/pull/600>`__)
- Fixes a bug where passing a string representation of a unit to `ndcube.NDCube.to` raised a `TypeError`. (`605 <https://github.com/sunpy/ndcube/pull/605>`__)
- Keywords for ``sequence_axis_coords`` and ``sequence_axis_unit`` were not passed to the ``SequenceAnimator`` constructor.
This is now fixed. (`607 <https://github.com/sunpy/ndcube/pull/607>`__)
- Adds ``None`` check on ``self.aligned_axes`` to ``NDCollection.copy()`` and ``NDCollection.pop()`` which raised a ``AttributeError`` (`646 <https://github.com/sunpy/ndcube/pull/646>`__)

Trivial/Internal Changes
------------------------

- Updated the error messages when missing either ``matplotlib`` or ``mpl_animators`` when creating a plot. (`651 <https://github.com/sunpy/ndcube/pull/651>`__)

2.1.0

===================

Backwards Incompatible Changes
------------------------------

- To support compatibility with reproject 0.9, the API of `.NDCube.reproject_to`
has been tweaked so that any keyword argument to the underlying reprojection
function can be passed through. This has the effect of being a breaking change
if you were specifying any arguments after ``shape_out=`` as positional rather
than keyword arguments. (Note that in a future release we will probably change
to require keyword arguments to ``reproject_to``. (`552 <https://github.com/sunpy/ndcube/pull/552>`__)


Features
--------

- Implement new property, `ndcube.ExtraCoords.is_empty` that returns ``True`` if the object has got extra coords. Otherwise return ``False``. (`450 <https://github.com/sunpy/ndcube/pull/450>`__)
- Add `ndcube.ExtraCoords.resample` method to resample extra coordinates by a certain factor in each array dimension. (`450 <https://github.com/sunpy/ndcube/pull/450>`__)
- Implement a new :meth:`ndcube.NDCube.rebin` method to combine integer numbers of pixels along each axis into larger pixels. (`450 <https://github.com/sunpy/ndcube/pull/450>`__)
- Add new methods to interpolate lookup table coordinates: ``ndcube.extra_coords.table_coord.QuantityTableCoordinate.interpolate``, ``ndcube.extra_coords.table_coord.SkyCoordTableCoordinate.interpolate``, ``ndcube.extra_coords.table_coord.TimeTableCoordinate.interpolate``, `ndcube.extra_coords.table_coord.MultipleTableCoordinate.interpolate` (`450 <https://github.com/sunpy/ndcube/pull/450>`__)
- Add `ndcube.NDCubeSequence.crop` and `ndcube.NDCubeSequence.crop_by_values` methods which crop the `~ndcube.NDCubeSequence` based on input world coordinate ranges. (`466 <https://github.com/sunpy/ndcube/pull/466>`__)
- Add basic arithmetic methods between `~ndcube.NDCube` objects and broadcastable arrays,
scalars, and `~astropy.units.Quantity` objects. Operations between two `~ndcube.NDCube` objects
are not supported. (`541 <https://github.com/sunpy/ndcube/pull/541>`__)
- Add `ndcube.NDCube.to` to convert cube to new unit. (`586 <https://github.com/sunpy/ndcube/pull/586>`__)
- Created `~ndcube.GlobalCoordsABC` and updated `~ndcube.ndcube.NDCubeABC`, and `~ndcube.ExtraCoordsABC` to reflect official NDCube 2 API definition in SEP. (`592 <https://github.com/sunpy/ndcube/pull/592>`__)


Bug Fixes
---------

- Fix bug 535 where `~ndcube.NDCollection` could not update when ``aligned_axes`` is `None` (`538 <https://github.com/sunpy/ndcube/pull/538>`__)
- Fix a bug where ``aligned_axis_physical_types`` caused ``__str__``
to error when ``aligned_axes`` was `None`. (`539 <https://github.com/sunpy/ndcube/pull/539>`__)
- Fix a bug where ``data_unit`` was not being correctly passed through to the underlying plotting
function when animating a cube. (`578 <https://github.com/sunpy/ndcube/pull/578>`__)


Improved Documentation
----------------------

- Add example to example gallery of how to create an NDCube from a FITS file. (`544 <https://github.com/sunpy/ndcube/pull/544>`__)

2.0.3

===================

Bug Fixes
---------

- Dynamically copy docstring and function signature from ``ndcube.NDCube.plotter.plot`` to :meth:`ndcube.NDCube.plot`. (`534 <https://github.com/sunpy/ndcube/pull/534>`__)
- Fixed a bug where the ``plot_axes`` key was not respected when passing ``axes`` to ``plot``
for 2D cubes. (`551 <https://github.com/sunpy/ndcube/pull/551>`__)
- Limit maximum reproject version to 0.9 due to API changes. ndcube 2.1 will support the
new reproject keyword arguments. (`564 <https://github.com/sunpy/ndcube/pull/564>`__)

2.0.2

===================

Bug Fixes
---------

- Fix a bug in the ``NDCube._as_mpl_axes`` implementation, allowing cubes with
compatible dimensions to be passed as the ``projection=`` keyword argument to
certain matplotlib functions again. (`509 <https://github.com/sunpy/ndcube/pull/509>`__)


Trivial/Internal Changes
------------------------

- Remove use of deprecated ``distutils`` module. (`520 <https://github.com/sunpy/ndcube/pull/520>`__)

2.0.1

==================

Bug Fixes
---------

- Enable `~ndcube.NDCollection` to accept aligned axes inputs in any integer type. (`495 <https://github.com/sunpy/ndcube/pull/495>`__)
- Patch to convert quantity objects passed to ``crop_by_coords`` to the units given in the ``wcs.world_axis_units``. (`497 <https://github.com/sunpy/ndcube/pull/497>`__)
- Fix a bug which prevented the ``axes_units=`` kwarg from working when using the
matplotlib animators. (`498 <https://github.com/sunpy/ndcube/pull/498>`__)
- Add support for length-1 lookup table coords within extra coords. (`499 <https://github.com/sunpy/ndcube/pull/499>`__)
- Bump the minimum version of astropy to 4.2 to correctly support capturing
dropped world dimensions into global coords when slicing the WCS. (`500 <https://github.com/sunpy/ndcube/pull/500>`__)

Page 1 of 2

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.