Configuration Transition¶
This document describes the changes in the configuration system in
astropy
0.4 and how to update code in order to use it.
For Users¶
The Config File¶
If you have not edited the configuration file in
~/.astropy/config/astropy.cfg
, there is nothing for you to do.
The first time you import astropy
0.4, it will automatically be
replaced with the configuration file template for astropy
0.4.
If you have edited the configuration file, it will be left untouched.
However, the template for astropy
0.4 will be installed as
~/.astropy/config/astropy.0.4.cfg
. You can manually compare your
changes to this file to determine what customizations should be
brought over.
Saving¶
Saving configuration items from Python has been completely removed. Instead, the configuration file must be edited directly.
Renames¶
The location of the configuration parameters have been simplified, so
they always appear in a high-level sub-package of astropy
, rather than in
low-level file names (which were really an implementation detail that
should not have been exposed to the user). On the Python side,
configuration items always are referenced through a conf
object at
the root of a sub-package.
Some configuration items that affect the results of science calculations have been removed as configuration parameters altogether and converted to science state objects that must be changed from Python code.
The following table lists all of the moves (in alphabetical order by
original configuration file location). The old names will continue to
work both from Python and the configuration file for the astropy
0.4
release cycle, and will be removed altogether in astropy
0.5.
Old config file location |
Old Python location |
New config file location |
New Python location |
---|---|---|---|
|
|
unchanged |
|
|
|
|
|
|
|
removed |
|
|
|
removed |
|
|
|
removed |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
|
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
unchanged |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|