Skip to content

Upgrading astropy 7 to 8

Breaking7.2.3 → 8.0.2Breaking12Security1Deprecated6New21Changed18Fixed45Other1

BreakingUpgrade verdict

12 breaking changes and a security fix.

  • Old import paths for cosmology modules no longer exist; import everything from astropy.cosmology instead.
  • Astropy now stores its cache and config in standard XDG locations, so files may move from ~/.astropy to ~/.cache and ~/.config.
  • Cosmology classes no longer accept None for the baryonic matter density parameter.
  • An internal table helper module was removed; the one still-used class now lives in astropy.table.
Top 5 of 19 that need code or config changes
Breaking12
Removes deprecated cosmology module-level shim files; import all cosmology classes and functions directly from astropy.cosmology.
astropy.cosmology.connectastropy.cosmology.coreastropy.cosmology.flrwastropy.cosmology.funcsastropy.cosmology.parameterastropy.cosmology
Cache and configuration directories now follow the XDG specification by default, changing default locations.
get_cache_dirget_cache_dir_pathget_config_dirget_config_dir_pathset_temp_cacheset_temp_config
The Ob0=None parameter value for cosmology classes is no longer supported; use Ob0=0 instead.
Ob0
Removes the private astropy.table.np_utils module; TableMergeError should be imported from astropy.table.
astropy.table.np_utilsTableMergeErrorastropy.table.operationsastropy.utils.metadata
Removes deprecated functions is_path_hidden and walk_skip_hidden from astropy.utils.misc.
is_path_hiddenwalk_skip_hiddenastropy.utils.misc
Removes deprecated min_cut and max_cut keywords from simple_norm and fits2bitmap; use vmin and vmax instead.
simple_normfits2bitmapmin_cutmax_cutvminvmax
ConfNamespace.help now raises an exception when called under Python optimized mode (-OO).
ConfNamespace.help
Galactocentric and LSR velocity attributes now use CartesianRepresentation; convert to Quantity via .xyz instead of .d_xyz.
GalactocentricLSRgalcen_v_sunv_baryCartesianRepresentationCartesianDifferential
Redshift arguments z, z1 and z2 in cosmology methods are now positional-only, completing deprecations from v7.0 and v7.1.
zz1z2
The help methods of Table.read and Table.write now raise an exception under Python optimized mode (-OO).
Table.readTable.write
DataOrigin updated to IVOA version 1.2, renaming ivoid and editor to ivoid_data and journal.
DataOriginivoideditorivoid_datajournal
Removes the astropy.tests.command module deprecated in v6.0 as part of the test runner removal.
astropy.tests.command
Security1
Fixes an XML External Entity (XXE) vulnerability in SAMP XML-RPC communication by disabling external entity resolution.
Deprecated6
Deprecates angular_diameter_distance_z1z2 in favor of passing two redshifts to angular_diameter_distance.
angular_diameter_distance_z1z2angular_diameter_distance
Deprecates chararray-specific methods for FITS string columns, since io.fits will return normal arrays in future; use np.strings instead.
np.char.chararrayrstripdecodenp.strings
Deprecates the entire astropy.samp module in favor of pyvo.samp.
astropy.samppyvo.samp
Deprecates setting the Column.dtype attribute; use column.view(dtype=new_dtype) instead.
Column.dtypecolumn.view
Officially deprecates astropy.test, TestRunnerBase and TestRunner, affecting downstream packagename.test generated with TestRunner.
astropy.testastropy.tests.runner.TestRunnerBaseastropy.tests.runner.TestRunner
Deprecates the astropy.utils.iers.IERS.time_now property; use astropy.time.Time.now() instead.
astropy.utils.iers.IERS.time_nowastropy.time.Time.now()