Upgrading astropy 7 to 8
Breaking7.2.3 → 8.0.2Breaking12Security1Deprecated6New21Changed18Fixed45Other1
SecurityFixes an XML External Entity (XXE) vulnerability in SAMP XML-RPC communication by disabling external entity resolution.#19231 ↗
BreakingUpgrade verdict
12 breaking changes and a security fix.
In plain terms
- 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.
Must act Top 5 of 19 that need code or config changes
What you must change
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.cosmologyCache 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_configThe Ob0=None parameter value for cosmology classes is no longer supported; use Ob0=0 instead.
Ob0Removes the private astropy.table.np_utils module; TableMergeError should be imported from astropy.table.
astropy.table.np_utilsTableMergeErrorastropy.table.operationsastropy.utils.metadataRemoves deprecated functions is_path_hidden and walk_skip_hidden from astropy.utils.misc.
is_path_hiddenwalk_skip_hiddenastropy.utils.miscRemoves deprecated min_cut and max_cut keywords from simple_norm and fits2bitmap; use vmin and vmax instead.
simple_normfits2bitmapmin_cutmax_cutvminvmaxConfNamespace.help now raises an exception when called under Python optimized mode (-OO).
ConfNamespace.helpGalactocentric and LSR velocity attributes now use CartesianRepresentation; convert to Quantity via .xyz instead of .d_xyz.
GalactocentricLSRgalcen_v_sunv_baryCartesianRepresentationCartesianDifferentialRedshift arguments z, z1 and z2 in cosmology methods are now positional-only, completing deprecations from v7.0 and v7.1.
zz1z2The help methods of Table.read and Table.write now raise an exception under Python optimized mode (-OO).
Table.readTable.writeDataOrigin updated to IVOA version 1.2, renaming ivoid and editor to ivoid_data and journal.
DataOriginivoideditorivoid_datajournalRemoves the astropy.tests.command module deprecated in v6.0 as part of the test runner removal.
astropy.tests.commandSecurity1
Fixes an XML External Entity (XXE) vulnerability in SAMP XML-RPC communication by disabling external entity resolution.
Deprecations to plan for
Deprecated6
Deprecates angular_diameter_distance_z1z2 in favor of passing two redshifts to angular_diameter_distance.
angular_diameter_distance_z1z2angular_diameter_distanceDeprecates chararray-specific methods for FITS string columns, since io.fits will return normal arrays in future; use np.strings instead.
np.char.chararrayrstripdecodenp.stringsDeprecates the entire astropy.samp module in favor of pyvo.samp.
astropy.samppyvo.sampDeprecates setting the Column.dtype attribute; use column.view(dtype=new_dtype) instead.
Column.dtypecolumn.viewOfficially deprecates astropy.test, TestRunnerBase and TestRunner, affecting downstream packagename.test generated with TestRunner.
astropy.testastropy.tests.runner.TestRunnerBaseastropy.tests.runner.TestRunnerDeprecates the astropy.utils.iers.IERS.time_now property; use astropy.time.Time.now() instead.
astropy.utils.iers.IERS.time_nowastropy.time.Time.now()