Skip to content

Upgrading astropy 5 to 6

Breaking5.3.4 → 6.1.7Breaking37Security1Platform2Deprecated18New41Changed38Fixed123Other2

Fetching 13 releases from GitHub…12 / 13
BreakingUpgrade verdict

37 breaking changes and 2 platform requirement changes and a security fix.

  • You can no longer create a Longitude from a string ending in N or S, or a Latitude from one ending in E or W, since those suffixes suggest the other type.
  • Cylindrical differentials now copy their input by default, matching other differential subclasses.
  • The parallel ASCII reader option is gone; the serial parser is always used.
  • Two old configuration helpers are gone; they should no longer be used.
Top 5 of 58 that need code or config changes

Python requirement changed in 6.1.0rc1: >=3.9 → >=3.10.

Adds astropy-iers-data >=0.2024.10.28.0.34.7.

Installs 5 packages in all (was 4).

Moves numpy 1.26.4 → 2.5.4. Your build may pick other versions.

Breaking37
Longitude and Latitude can no longer be initialized with strings ending in N/S or E/W respectively.
LongitudeLatitude
Changes the default copy argument in CylindricalDifferential.__init__ from False to True.
CylindricalDifferential.__init__copyBaseDifferential
Removes the parallel fast-reader parser for ASCII files and the parallel key in the fast_reader argument.
fast_readerparallel
Removes deprecated ConfigurationMissingWarning class and update_default_config function with no replacements.
ConfigurationMissingWarningupdate_default_config
Adds base KernelError class and removes DiscretizationError class; a ValueError is raised instead.
KernelErrorDiscretizationErrorValueError
Removes deprecated angle parsing and formatting utilities from angle_utilities; use angle_formats instead.
angle_utilitiesangle_formats
Initializing Angle or Longitude from a tuple is no longer supported.
AngleLongitude
Low-level coordinate-frame transform_to() no longer accepts frame classes, only frame instances; SkyCoord.transform_to() is unaffected.
transform_to()SkyCoord
Removes support for importing private constants and functions from astropy.cosmology.flrw.
astropy.cosmology.flrw
Removes deprecated Cosmology Parameter argument fmt.
Parameterfmt
Removes deprecated vectorize_if_needed and inf_like from cosmology.utils.
vectorize_if_neededinf_likecosmology.utils
Removes deprecated import paths from astropy.cosmology.core.
astropy.cosmology.core
Removes deprecated get_cosmology_from_string class method in default_cosmology; use get instead.
default_cosmology.get_cosmology_from_stringdefault_cosmology.get
Removes special handling of TCTYP TCUNI TCRPX TCRVL TCDLT TRPOS FITS keywords.
TCTYPTCUNITCRPXTCRVLTCDLTTRPOS
Removes deprecated astropy.io.misc.asdf subpackage; use the asdf-astropy package instead.
astropy.io.misc.asdfasdf-astropy
Removes deprecated pedantic option from votable parse() and its configuration setting; use verify instead.
astropy.io.votable.table.parse()pedanticverify
Renames astropy.io.votable.tree.Table to TableElement to avoid sharing the name with astropy.table.Table.
astropy.io.votable.tree.Tableastropy.io.votable.tree.TableElementastropy.table.Table
Removes support for version='1.0' in VOTableFile__init__(), which now raises ValueError instead of DeprecationWarning.
VOTableFile__init__()
Removes the AliasDict class from modeling.utils.
AliasDictmodeling.utils
Removes deprecated _model_to_fit_params and _fitter_to_model_params from fitting.py.
_model_to_fit_params_fitter_to_model_paramsfitting.py
BoxLeastSquares, BoxLeastSquaresResults and LombScargle are no longer available from astropy.stats, only from astropy.timeseries.
BoxLeastSquaresBoxLeastSquaresResultsLombScargleastropy.statsastropy.timeseries
Removes the deprecated midpoint_epoch argument from the fold function; use epoch_time instead.
foldmidpoint_epochepoch_time
Under numpy 2.0, Quantity and subclasses no longer support .ptp(), .newbyteorder() or .itemset().
QuantityAngleMaskedQuantity.ptp()Quantity.newbyteorder()Quantity.itemset()np.ptp()
Removes deprecated littleh unit, with_H0 equivalency, brightness_temperature argument swapping and PhysicalType str methods.
littlehwith_H0brightness_temperaturePhysicalTypecosmology.units
Removes deprecated OrderedDescriptor, OrderedDescriptorContainer and set_locale from astropy.utils.misc.
OrderedDescriptorOrderedDescriptorContainerset_localeastropy.utils.misc
Removes the deprecated version_path argument from the minversion function.
minversionversion_path
WCSAxes.draw() no longer accepts any keyword arguments.
astropy.visualization.wcsaxes.WCSAxes.draw()
Removes the deprecated accuracy argument from WCS.all_world2pix; use tolerance instead.
WCS.all_world2pixaccuracytolerance
NoConvergence no longer accepts arbitrary keyword arguments.
NoConvergence
Cosmology and its subclasses are now frozen dataclass objects.
Cosmology
Makes the verbose argument of z_at_value keyword-only.
z_at_valueverbose
Invalid kernel arithmetic operations now raise KernelArithmeticError instead of a bare Exception.
KernelArithmeticError
discretize_model now raises ValueError if mode='oversample' and factor does not have an integer value.
discretize_model
Removes deprecated astropy.io.ascii.tests.common.raises test helper; use pytest.raises instead.
astropy.io.ascii.tests.common.raisespytest.raises
Creating a model instance with parameters of incompatible shapes now raises ValueError rather than IncompatibleShapeError.
ValueErrorIncompatibleShapeError
Removes deprecated deprecation, warning, and exception handling functionality from astropy.tests.helper.
astropy.tests.helper
Changes the TimeDelta init signature to match Time, with keyword-only arguments after the format and scale parameters.
TimeDeltaTime
Security1
Updates bundled WCSLIB to 8.2.2, fixing character buffer overflows in wcshdo() comment strings and generic coordinate formatting.
wcshdo()
Platform2
Bumps the minimal optional matplotlib requirement to 3.5.0, the oldest version supporting Python 3.10.
matplotlib
Updates the minimum supported Python version to 3.10.
Deprecated18
Deprecates show_in_notebook, recommending dedicated Jupyter ecosystem tools for interactive notebook plots.
show_in_notebook
Deprecates show_in_browser pending community feedback.
show_in_browser
Deprecates TableColumns.setdefault() and TableColumns.update() because they can corrupt the attached Table.
TableColumns.setdefault()TableColumns.update()Table.setdefault()Table.update()
Deprecates Time.ptp in favor of np.ptp following removal of np.ndarray.ptp in NumPy v2.
Time.ptpnp.ptpnp.ndarray.ptp
Deprecates importing ErfaError and ErfaWarning from astropy.utils.exceptions; import them from erfa instead.
ErfaErrorErfaWarningastropy.utils.exceptions
Deprecates introspection.isinstancemethod() and introspection.find_mod_objs().
introspection.isinstancemethod()introspection.find_mod_objs()
Deprecates astropy.utils.console.terminal_size in favor of shutil.get_terminal_size.
astropy.utils.console.terminal_sizeshutil.get_terminal_size
Deprecates indent() in favor of textwrap.indent() from the Python standard library.
indent()textwrap.indent()
Renames min_cut and max_cut keywords in simple_norm and fits2bitmap to vmin and vmax; old names are deprecated.
simple_normfits2bitmapmin_cutmax_cutvminvmax
Deprecates the private module astropy.cosmology.utils.
astropy.cosmology.utils
Deprecates several astropy.io.ascii arguments, renaming or scheduling removal of Reader, Inputter, Outputter, Writer.
astropy.io.ascii.read()astropy.io.ascii.get_reader()astropy.io.ascii.write()astropy.io.ascii.get_writer()ReaderInputterOutputterWriter
Deprecates _ExtensionHDU and _NonstandardExtHDU in favor of ExtensionHDU and NonstandardExtHDU.
_ExtensionHDU_NonstandardExtHDUExtensionHDUNonstandardExtHDU
Renames and deprecates TableHDU.update to TableHDU.update_header for consistency with ImageHDU.
TableHDU.updateTableHDU.update_headerImageHDU
Deprecates fnunpickle and fnpickle because they are unused within astropy.
fnunpicklefnpickle
Deprecates astropy.tests.command.FixRemoteDataOption and astropy.tests.command.AstropyTest after sunsetting astropy-helpers.
astropy.tests.command.FixRemoteDataOptionastropy.tests.command.AstropyTestastropy-helpers
Deprecates is_path_hidden() and walk_skip_hidden().
is_path_hidden()walk_skip_hidden()
Deprecates the bboxes, ticklabels_bbox and tick_out_size arguments to TickLabels.draw(), which now have no effect.
astropy.visualization.wcaxes.ticklabels.TickLabels.draw()bboxesticklabels_bboxtick_out_size
Deprecates the exp attribute in LogStretch, InvertedLogStretch, PowerDistStretch and InvertedPowerDistStretch, and power in PowerStretch; use a instead.
LogStretchInvertedLogStretchPowerDistStretchInvertedPowerDistStretchPowerStretchexppowera