Exemple #1
0
        cfgtype='string(default=None)')
    sfd98_dir = ConfigItem(
        None,
        "Directory containing SFD (1998) dust maps, with names: "
        "'SFD_dust_4096_ngp.fits' and 'SFD_dust_4096_sgp.fits'. "
        "Example: sfd98_dir = /home/user/data/sfd98",
        cfgtype='string(default=None)')
    remote_timeout = ConfigItem(
        10.0, "Remote timeout in seconds.")

# Create an instance of the class we just defined.
conf = _Conf()

# Update the user's ~/.astropy/config/sncosmo.cfg if needed.
update_default_config("sncosmo",  # pkg
                      os.path.dirname(__file__),  # configdir
                      version=__version__)

# clean up namespace
del os, ConfigItem, ConfigNamespace, update_default_config

# import all the things into the top-level namespace
from .bandpasses import *
from .magsystems import *
from .spectrum import *
from .models import *
from .io import *
from .snanaio import *
from .fitting import *
from .simulation import *
from .plotting import *
Exemple #2
0
    sfd98_dir = ConfigItem(
        None, "Directory containing SFD (1998) dust maps, with names: "
        "'SFD_dust_4096_ngp.fits' and 'SFD_dust_4096_sgp.fits'. "
        "Example: sfd98_dir = /home/user/data/sfd98",
        cfgtype='string(default=None)')
    remote_timeout = ConfigItem(10.0, "Remote timeout in seconds.")


# Create an instance of the class we just defined.
# This needs to be done before the imports below because `conf` is used
# in some parts of the library.
conf = _Conf()

# Update the user's ~/.astropy/config/sncosmo.cfg if needed.
update_default_config(
    "sncosmo",  # pkg
    os.path.dirname(__file__),  # configdir
)

# clean up namespace
del os, ConfigItem, ConfigNamespace, update_default_config

# import all the things into the top-level namespace
from .bandpasses import *
from .magsystems import *
from .spectrum import *
from .models import *
from .io import *
from .snanaio import *
from .fitting import *
from .simulation import *
from .plotting import *
Exemple #3
0
    sfd98_dir = ConfigItem(
        None, "Directory containing SFD (1998) dust maps, with names: "
        "'SFD_dust_4096_ngp.fits' and 'SFD_dust_4096_sgp.fits'. "
        "Example: sfd98_dir = /home/user/data/sfd98",
        cfgtype='string(default=None)')
    remote_timeout = ConfigItem(10.0, "Remote timeout in seconds.")


# Create an instance of the class we just defined.
# This needs to be done before the imports below because `conf` is used
# in some parts of the library.
conf = _Conf()

# Update the user's ~/.astropy/config/sncosmo.cfg if needed.
update_default_config(
    "sncosmo",  # pkg
    os.path.dirname(__file__),  # configdir
    version=__version__)

# clean up namespace
del os, ConfigItem, ConfigNamespace, update_default_config

# import all the things into the top-level namespace
from .bandpasses import *
from .magsystems import *
from .spectrum import *
from .models import *
from .io import *
from .snanaio import *
from .fitting import *
from .simulation import *
from .plotting import *
    from astropy.tests.runner import TestRunner

    test = TestRunner.make_test_runner_in(os.path.dirname(__file__))
    test.__test__ = False
    __all__ += ["test"]

    # add these here so we only need to cleanup the namespace at the end
    config_dir = None

    if not os.environ.get("ASTROPY_SKIP_CONFIG_UPDATE", False):
        config_dir = os.path.dirname(__file__)
        config_template = os.path.join(config_dir, __package__ + ".cfg")
        if os.path.isfile(config_template):
            try:
                update_default_config(__package__,
                                      config_dir,
                                      version=__version__)
            except TypeError as orig_error:
                try:
                    update_default_config(__package__, config_dir)
                except ConfigurationDefaultMissingError as e:
                    wmsg = (e.args[0] +
                            " Cannot install default profile. If you are "
                            "importing from source, this is expected.")
                    warn(ConfigurationDefaultMissingWarning(wmsg))
                    del e
                except Exception:
                    raise orig_error

# /if
    ConfigurationDefaultMissingError,
    ConfigurationDefaultMissingWarning)

# Create the test function for self test
from astropy.tests.runner import TestRunner
test = TestRunner.make_test_runner_in(os.path.dirname(__file__))
test.__test__ = False
__all__ = ['test']

# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
    config_dir = os.path.dirname(__file__)
    config_template = os.path.join(config_dir, __package__ + ".cfg")
    if os.path.isfile(config_template):
        try:
            update_default_config(
                __package__, config_dir, version=__version__)
        except TypeError as orig_error:
            try:
                update_default_config(__package__, config_dir)
            except ConfigurationDefaultMissingError as e:
                wmsg = (e.args[0] +
                        " Cannot install default profile. If you are "
                        "importing from source, this is expected.")
                warn(ConfigurationDefaultMissingWarning(wmsg))
                del e
            except Exception:
                raise orig_error
Exemple #6
0
def test_unedited_template():
    # Test that the config file is written at most once
    config_dir = os.path.join(os.path.dirname(__file__), '..', '..')
    configuration.update_default_config('astropy', config_dir)
    assert configuration.update_default_config('astropy', config_dir) is False
Exemple #7
0
def test_unedited_template():
    # Test that the config file is written at most once
    config_dir = os.path.join(os.path.dirname(__file__), '..', '..')
    configuration.update_default_config('astropy', config_dir)
    assert configuration.update_default_config('astropy', config_dir) is False