Commit 418a1405 authored by Médéric Boquien's avatar Médéric Boquien

Optimise imports. Cleanup done using PyCharm Community Edition.

parent 74809bca
......@@ -5,6 +5,7 @@
# Author: Yannick Roehlly & Denis Burgarella
from importlib import import_module
import numpy as np
from astropy.table import Column
......
......@@ -42,7 +42,6 @@ from .workers import init_analysis as init_worker_analysis
from .workers import analysis as worker_analysis
from ..utils import ParametersHandler, backup_dir
from ..utils import OUT_DIR
# Tolerance threshold under which any flux or error is considered as 0.
TOLERANCE = 1e-12
......
......@@ -9,7 +9,6 @@ from astropy import log
from astropy.table import Table, Column
import numpy as np
from scipy.special import erf
from scipy.stats import scoreatpercentile
from ..utils import OUT_DIR
......
......@@ -28,6 +28,7 @@ from ...warehouse import SedWarehouse
from .workers import init_fluxes as init_worker_fluxes
from .workers import fluxes as worker_fluxes
# Limit the redshift to this number of decimals
REDSHIFT_DECIMALS = 2
......
......@@ -10,7 +10,6 @@ import time
import numpy as np
from ...warehouse import SedWarehouse
from ..utils import OUT_DIR
......
......@@ -13,7 +13,9 @@ Populations.
"""
from collections import OrderedDict
import numpy as np
from . import CreationModule
from ..data import Database
......
......@@ -13,8 +13,10 @@ This module implements the Casey (2012) infra-red models.
"""
from collections import OrderedDict
import numpy as np
import scipy.constants as cst
from . import CreationModule
......
......@@ -12,6 +12,7 @@ This module implements the Dale (2014) infra-red models.
"""
from collections import OrderedDict
from pcigale.data import Database
from . import CreationModule
......
......@@ -13,7 +13,9 @@ This module implements the Draine and Li (2007) infra-red models.
"""
from collections import OrderedDict
import numpy as np
from pcigale.data import Database
from . import CreationModule
......
......@@ -13,7 +13,9 @@ This module implements the updated Draine and Li (2007) infrared models.
"""
from collections import OrderedDict
import numpy as np
from pcigale.data import Database
from . import CreationModule
......
......@@ -14,7 +14,9 @@ attenuation formulae, adding an UV-bump and a power law.
"""
from collections import OrderedDict
import numpy as np
from . import CreationModule
......
......@@ -14,7 +14,9 @@ in Charlot and Fall (2000) with a UV bump added.
"""
from collections import OrderedDict
import numpy as np
from . import CreationModule
......
......@@ -11,7 +11,9 @@ This module implements the Fritz et al. (2006) models.
"""
from collections import OrderedDict
import numpy as np
from pcigale.data import Database
from . import CreationModule
......
......@@ -11,8 +11,8 @@ This module reads a SED spectrum from a file.
"""
from astropy.table import Table
from collections import OrderedDict
from ..utils import read_table
from . import CreationModule
......
......@@ -12,7 +12,9 @@ This module implements the Maraston (2005) Single Stellar Populations.
"""
from collections import OrderedDict
import numpy as np
from . import CreationModule
from ..data import Database
......
......@@ -17,8 +17,10 @@ wavelength range.
"""
from collections import OrderedDict
import numpy as np
import scipy.constants as cst
from . import CreationModule
......
......@@ -4,9 +4,11 @@
# Author: Médéric Boquien <mboquien@ast.cam.ac.uk>
from collections import OrderedDict
import numpy as np
from pcigale.data import Database
import scipy.constants as cst
from pcigale.data import Database
from . import CreationModule
......
......@@ -16,7 +16,9 @@ for all the physical processes at play to build the received total emission.
"""
from collections import OrderedDict
import numpy as np
from . import CreationModule
......
......@@ -18,8 +18,10 @@ This module implements the radio emission of galaxies, taking into account only
"""
from collections import OrderedDict
import numpy as np
import scipy.constants as cst
from . import CreationModule
......
......@@ -21,9 +21,9 @@ is changed, this module may need to be adapted.
import numpy as np
from scipy.constants import parsec
from scipy.misc import factorial
from astropy.cosmology import WMAP7 as cosmology
from ..creation_modules import CreationModule
from astropy.cosmology import WMAP7 as cosmology
def igm_transmission(wavelength, redshift):
......
......@@ -13,9 +13,12 @@ decreasing exponentials.
"""
from collections import OrderedDict
import numpy as np
from . import CreationModule
# Time lapse used in the age grid in Myr. If should be consistent with the
# time lapse in the SSP modules.
AGE_LAPSE = 1
......
......@@ -22,9 +22,12 @@ and interpolate the values of a, b and c.
"""
from collections import OrderedDict
import numpy as np
from . import CreationModule
# Time lapse used in the age grid in Myr. If should be consistent with the
# time lapse in the SSP modules.
AGE_LAPSE = 1
......
......@@ -15,9 +15,12 @@ constant.
"""
from collections import OrderedDict
import numpy as np
from . import CreationModule
# Time lapse used in the age grid in Myr. If should be consistent with the
# time lapse in the SSP modules.
AGE_LAPSE = 1
......
......@@ -14,9 +14,12 @@ rise of the SFR up to a maximum, followed by an exponential decrease.
"""
from collections import OrderedDict
import numpy as np
from . import CreationModule
# Time lapse used in the age grid in Myr. If should be consistent with the
# time lapse in the SSP modules.
AGE_LAPSE = 1
......
......@@ -12,7 +12,9 @@ This module reads the star formation history in a file.
"""
from collections import OrderedDict
import numpy as np
from ..utils import read_table
from . import CreationModule
......
......@@ -15,7 +15,9 @@ decaying exponential, or "delayed".
"""
from collections import OrderedDict
import numpy as np
from . import CreationModule
......
......@@ -20,6 +20,7 @@ from sqlalchemy import create_engine, exc, Column, String, Float, PickleType
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import class_mapper, sessionmaker
import numpy as np
from .filters import Filter
from .m2005 import M2005
from .bc03 import BC03
......@@ -30,7 +31,6 @@ from .fritz2006 import Fritz2006
from .nebular_continuum import NebularContinuum
from .nebular_lines import NebularLines
DATABASE_FILE = pkg_resources.resource_filename(__name__, 'data.db')
ENGINE = create_engine('sqlite:///' + DATABASE_FILE, echo=False)
......
......@@ -31,12 +31,14 @@ Such SED is characterised by:
"""
import numpy as np
from scipy.constants import c, parsec
from . import utils
from .io.vo import save_sed_to_vo
from scipy.constants import c, parsec
from ..data import Database
# Time lapse used to compute the average star formation rate. We use a
# constant to keep it easily changeable for advanced user while limiting the
# number of parameters. The value is in Myr.
......
......@@ -3,14 +3,16 @@
# Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt
# Author: Yannick Roehlly
import configobj
import pkg_resources
import pkgutil
import collections
import multiprocessing as mp
import numpy as np
from glob import glob # To allow the use of glob() in "eval..."
from textwrap import wrap
import configobj
from glob import glob # To allow the use of glob() in "eval..."
import pkg_resources
import numpy as np
from ..data import Database
from ..utils import read_table
from .. import creation_modules
......
......@@ -4,6 +4,7 @@
# Author: Yannick Roehlly
import marshal
from ..sed import SED
from .. import creation_modules
......
......@@ -4,13 +4,15 @@
# Author: Médéric Boquien
import argparse
import multiprocessing as mp
import sys
from astropy.table import Table, Column
import astropy.units as u
import matplotlib.pyplot as plt
import multiprocessing as mp
import numpy as np
from pcigale.data import Database, Filter
import sys
__version__ = "0.1-alpha"
......
......@@ -7,17 +7,19 @@
# Author: Yannick Roehlly, Médéric Boquien & Denis Burgarella
import argparse
from astropy.table import Table
from itertools import product, repeat
from collections import OrderedDict
from astropy.table import Table
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import multiprocessing as mp
import numpy as np
import os
import pkg_resources
from scipy.constants import c, parsec
from scipy.constants import c
from pcigale.data import Database
from pcigale.utils import read_table
from pcigale.session.configuration import Configuration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment