Upgrading astropy 5 to 6
Breaking5.3.4 → 6.1.7Breaking37Security1Platform2Deprecated18New41Changed38Fixed123Other2
Fetching 13 releases from GitHub…12 / 13
SecurityUpdates bundled WCSLIB to 8.2.2, fixing character buffer overflows in wcshdo() comment strings and generic coordinate formatting.#15795 ↗
BreakingUpgrade verdict
37 breaking changes and 2 platform requirement changes and a security fix.
In plain terms
- 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.
Must act 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.
What you must change
Breaking37
Longitude and Latitude can no longer be initialized with strings ending in N/S or E/W respectively.
LongitudeLatitudeChanges the default copy argument in CylindricalDifferential.__init__ from False to True.
CylindricalDifferential.__init__copyBaseDifferentialRemoves the parallel fast-reader parser for ASCII files and the parallel key in the fast_reader argument.
fast_readerparallelRemoves deprecated ConfigurationMissingWarning class and update_default_config function with no replacements.
ConfigurationMissingWarningupdate_default_configAdds base KernelError class and removes DiscretizationError class; a ValueError is raised instead.
KernelErrorDiscretizationErrorValueErrorRemoves deprecated angle parsing and formatting utilities from angle_utilities; use angle_formats instead.
angle_utilitiesangle_formatsInitializing Angle or Longitude from a tuple is no longer supported.
AngleLongitudeLow-level coordinate-frame transform_to() no longer accepts frame classes, only frame instances; SkyCoord.transform_to() is unaffected.
transform_to()SkyCoordRemoves support for importing private constants and functions from astropy.cosmology.flrw.
astropy.cosmology.flrwRemoves deprecated Cosmology Parameter argument fmt.
ParameterfmtRemoves deprecated vectorize_if_needed and inf_like from cosmology.utils.
vectorize_if_neededinf_likecosmology.utilsRemoves deprecated import paths from astropy.cosmology.core.
astropy.cosmology.coreRemoves deprecated get_cosmology_from_string class method in default_cosmology; use get instead.
default_cosmology.get_cosmology_from_stringdefault_cosmology.getRemoves special handling of TCTYP TCUNI TCRPX TCRVL TCDLT TRPOS FITS keywords.
TCTYPTCUNITCRPXTCRVLTCDLTTRPOSRemoves deprecated astropy.io.misc.asdf subpackage; use the asdf-astropy package instead.
astropy.io.misc.asdfasdf-astropyRemoves deprecated pedantic option from votable parse() and its configuration setting; use verify instead.
astropy.io.votable.table.parse()pedanticverifyRenames 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.TableRemoves 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.utilsRemoves deprecated _model_to_fit_params and _fitter_to_model_params from fitting.py.
_model_to_fit_params_fitter_to_model_paramsfitting.pyBoxLeastSquares, BoxLeastSquaresResults and LombScargle are no longer available from astropy.stats, only from astropy.timeseries.
BoxLeastSquaresBoxLeastSquaresResultsLombScargleastropy.statsastropy.timeseriesRemoves the deprecated midpoint_epoch argument from the fold function; use epoch_time instead.
foldmidpoint_epochepoch_timeUnder 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.unitsRemoves deprecated OrderedDescriptor, OrderedDescriptorContainer and set_locale from astropy.utils.misc.
OrderedDescriptorOrderedDescriptorContainerset_localeastropy.utils.miscRemoves the deprecated version_path argument from the minversion function.
minversionversion_pathWCSAxes.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_world2pixaccuracytoleranceNoConvergence no longer accepts arbitrary keyword arguments.
NoConvergenceCosmology and its subclasses are now frozen dataclass objects.
CosmologyMakes the verbose argument of z_at_value keyword-only.
z_at_valueverboseInvalid kernel arithmetic operations now raise KernelArithmeticError instead of a bare Exception.
KernelArithmeticErrordiscretize_model now raises ValueError if mode='oversample' and factor does not have an integer value.
discretize_modelRemoves deprecated astropy.io.ascii.tests.common.raises test helper; use pytest.raises instead.
astropy.io.ascii.tests.common.raisespytest.raisesCreating a model instance with parameters of incompatible shapes now raises ValueError rather than IncompatibleShapeError.
ValueErrorIncompatibleShapeErrorRemoves deprecated deprecation, warning, and exception handling functionality from astropy.tests.helper.
astropy.tests.helperChanges the TimeDelta init signature to match Time, with keyword-only arguments after the format and scale parameters.
TimeDeltaTimeSecurity1
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.
matplotlibUpdates the minimum supported Python version to 3.10.
Deprecations to plan for
Deprecated18
Deprecates show_in_notebook, recommending dedicated Jupyter ecosystem tools for interactive notebook plots.
show_in_notebookDeprecates show_in_browser pending community feedback.
show_in_browserDeprecates 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.ptpDeprecates importing ErfaError and ErfaWarning from astropy.utils.exceptions; import them from erfa instead.
ErfaErrorErfaWarningastropy.utils.exceptionsDeprecates 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_sizeDeprecates 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_cutvminvmaxDeprecates the private module astropy.cosmology.utils.
astropy.cosmology.utilsDeprecates 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()ReaderInputterOutputterWriterDeprecates _ExtensionHDU and _NonstandardExtHDU in favor of ExtensionHDU and NonstandardExtHDU.
_ExtensionHDU_NonstandardExtHDUExtensionHDUNonstandardExtHDURenames and deprecates TableHDU.update to TableHDU.update_header for consistency with ImageHDU.
TableHDU.updateTableHDU.update_headerImageHDUDeprecates fnunpickle and fnpickle because they are unused within astropy.
fnunpicklefnpickleDeprecates astropy.tests.command.FixRemoteDataOption and astropy.tests.command.AstropyTest after sunsetting astropy-helpers.
astropy.tests.command.FixRemoteDataOptionastropy.tests.command.AstropyTestastropy-helpersDeprecates 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_sizeDeprecates the exp attribute in LogStretch, InvertedLogStretch, PowerDistStretch and InvertedPowerDistStretch, and power in PowerStretch; use a instead.
LogStretchInvertedLogStretchPowerDistStretchInvertedPowerDistStretchPowerStretchexppowera