<commit_before>Configuration system Documentation
==================================

The astropy configuration system is designed to give users control of various
parameters used in astropy or affiliated packages without delving into the 
source code to make those changes.

.. todo::
    Move this portion of the documentation to a more appropriate place when a
    doc reorg happens

For Users
---------

To see the configuration options, look for your astropy configuration file.  
You can find it by doing::

    from astropy.config import get_config_dir
    
    print get_config_dir()

And you should see the location of your configuration directory. The standard 
scheme generally puts your configuration directory in ``$HOME/.astropy/config``,
but if you've set the environment variable `XDG_CONFIG_HOME` and the 
``$XDG_CONFIG_HOME/astropy`` directory exists, it will instead be there.

Once you've found the configuration file, open it with your favorite editor.
It should have all of the sections you might want, with descriptions and the 
type of the value that is accepted.  Feel free to edit this as you wish, and
any of these changes will be reflected when you next start Astropy.  Or, if you
want to see your changes immediately in your current Astropy session, just do::

    from astropy.config import reload_config()
    
    reload_config()

.. warning::
    The above is not true yet, because the setup doesn't automatically 
    populate the configuration files.  Hopefully it will be true soon, though.




For Developers
--------------
The Reference guide below describes the full interface - this is a summary of
typical practices.  The most common way to use the configuration system is as
follows::<commit_msg>doc tweak to clarify warning about config file default building process<commit_after>Configuration system Documentation
==================================

The astropy configuration system is designed to give users control of various
parameters used in astropy or affiliated packages without delving into the 
source code to make those changes.

.. todo::
    Move this portion of the documentation to a more appropriate place when a
    doc reorg happens

For Users
---------

To see the configuration options, look for your astropy configuration file.  
You can find it by doing::

    from astropy.config import get_config_dir
    
    print get_config_dir()

And you should see the location of your configuration directory. The standard 
scheme generally puts your configuration directory in ``$HOME/.astropy/config``,
but if you've set the environment variable `XDG_CONFIG_HOME` and the 
``$XDG_CONFIG_HOME/astropy`` directory exists, it will instead be there.

Once you've found the configuration file, open it with your favorite editor.
It should have all of the sections you might want, with descriptions and the 
type of the value that is accepted.  Feel free to edit this as you wish, and
any of these changes will be reflected when you next start Astropy.  Or, if you
want to see your changes immediately in your current Astropy session, just do::

    from astropy.config import reload_config()
    
    reload_config()

.. warning::
    The above is not true yet, because the setup doesn't automatically 
    populate the configuration files.  Hopefully it will be true soon, though.
    The :func:`astropy.config.configs._generate_all_config_items` function will
    already do this, basically, but there has to be some thought about how to
    make driver scripts that actually do this for each user, and coordinate
    when they get run so that everything is already built.




For Developers
--------------
The Reference guide below describes the full interface - this is a summary of
typical practices.  The most common way to use the configuration system is as
follows::
{'fraction_non_alphanumeric': 0.06663182649594983, 'fraction_numerical': 0.0, 'mean_word_length': 3.913992297817715, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5347921', 'n_tokens_mistral': 918, 'n_tokens_neox': 886, 'n_words': 527}