...
 
Commits (2)
......@@ -14,6 +14,7 @@
- The colours in the SED plots have been tweaked for aesthetic reasons. (Médéric Boquien)
- The markers for the observed fluxes in the SED plots have been tweaked to improve readability. (Médéric Boquien)
- The computation of all the cosmology-dependent quantities has been consolidated in pcigale/utils/cosmology.py and optimised. This leads to a slightly faster startup, in particular when there are many objects to fit, and it makes it easier to change the cosmology. (Médéric Boquien)
- The time spent computing is now displayed in hours, minutes, and seconds rather than just seconds to improve legibility. (Médéric Boquien)
### Fixed
- Make sure we can plot the PDF of equivalent widths. (Médéric Boquien)
- Fix a crash when generating a mock catalogue containing intensive properties. (Médéric Boquien)
......
......@@ -31,7 +31,7 @@ import multiprocessing as mp
import numpy as np
from .. import AnalysisModule
from ..utils import Counter
from utils.counter import Counter
from .workers import sed as worker_sed
from .workers import init_sed as init_worker_sed
from .workers import init_analysis as init_worker_analysis
......
......@@ -19,7 +19,7 @@ from collections import OrderedDict
import multiprocessing as mp
from .. import AnalysisModule
from ..utils import Counter
from utils.counter import Counter
from .workers import init_fluxes as init_worker_fluxes
from .workers import fluxes as worker_fluxes
from ...managers.models import ModelsManager
......
......@@ -8,7 +8,7 @@ import numpy as np
from scipy.constants import parsec
from ..utils.cosmology import luminosity_distance
from ..utils.io import read_table
from utils.io import read_table
from .utils import get_info
......
......@@ -8,7 +8,7 @@ import collections
import itertools
import numpy as np
from ..utils.io import read_table
from utils.io import read_table
class ParametersManager(object):
......
......@@ -13,7 +13,7 @@ This module reads a SED spectrum from a file.
from collections import OrderedDict
from ..utils.io import read_table
from utils.io import read_table
from . import SedModule
......
......@@ -15,7 +15,7 @@ from collections import OrderedDict
import numpy as np
from ..utils.io import read_table
from utils.io import read_table
from . import SedModule
......
......@@ -16,7 +16,7 @@ import validate
from ..managers.parameters import ParametersManager
from ..data import Database
from ..utils.io import read_table
from utils.io import read_table
from .. import sed_modules
from .. import analysis_modules
from ..warehouse import SedWarehouse
......
......@@ -16,8 +16,8 @@ matplotlib.use('Agg')
import matplotlib.pyplot as plt
import multiprocessing as mp
import numpy as np
from pcigale.utils import read_table
from pcigale.analysis_modules.utils import Counter
from utils.io import read_table
from utils.counter import Counter
def pool_initializer(counter):
......
......@@ -17,7 +17,7 @@ import multiprocessing as mp
import numpy as np
import pkg_resources
from scipy import stats
from pcigale.analysis_modules.utils import Counter
from utils.counter import Counter
# Name of the file containing the best models information
BEST_RESULTS = "results.fits"
......
......@@ -15,8 +15,8 @@ matplotlib.use('Agg')
import matplotlib.pyplot as plt
import multiprocessing as mp
import numpy as np
from pcigale.utils import read_table
from pcigale.analysis_modules.utils import Counter
from utils.io import read_table
from utils.counter import Counter
def pool_initializer(counter):
......
......@@ -20,9 +20,9 @@ from os import path
import pkg_resources
from scipy.constants import c
from pcigale.data import Database
from pcigale.utils import read_table
from utils.io import read_table
import matplotlib.gridspec as gridspec
from pcigale.analysis_modules.utils import Counter
from utils.counter import Counter
# Name of the file containing the best models information
BEST_RESULTS = "results.fits"
......
......@@ -4,7 +4,8 @@
# Author: Médéric Boquien
"""
Various utility functions for pcigale analysis modules
Multiprocessing counter class with utility functions for periodic updating and
printing.
"""
import multiprocessing as mp
......@@ -45,5 +46,8 @@ class Counter:
def pprint(self, n):
dt = time.time() - self.t0
print(f"{n}/{self.nmodels} performed in {dt:.1f} seconds ({n/dt:.1f}/s)",
s = round(dt % 60, 1)
m = round((dt // 60) % 60)
h = round(dt // 3600)
print(f"{n}/{self.nmodels} in {h:02}:{m:02}:{s:04.1f} ({n/dt:.1f}/s)",
end="\n" if n == self.nmodels else "\r")