Commit f10d9f86 authored by Médéric Boquien's avatar Médéric Boquien

Slight formatting corrections to follow the PEP8 a bit more closely.

parent eb3ffc69
...@@ -97,7 +97,8 @@ class ObservationsManagerPassbands(object): ...@@ -97,7 +97,8 @@ class ObservationsManagerPassbands(object):
self.tofit = self.bands + self.intprops + self.extprops self.tofit = self.bands + self.intprops + self.extprops
self.tofit_err = self.bands_err + self.intprops_err + self.extprops_err self.tofit_err = self.bands_err + self.intprops_err + self.extprops_err
self.observations = list([Observation(row, self) for row in self.table]) self.observations = list([Observation(row, self)
for row in self.table])
def __len__(self): def __len__(self):
return len(self.observations) return len(self.observations)
...@@ -162,9 +163,12 @@ class ObservationsManagerPassbands(object): ...@@ -162,9 +163,12 @@ class ObservationsManagerPassbands(object):
for item in self.tofit: for item in self.tofit:
error = item + '_err' error = item + '_err'
if item in self.intprops: if item in self.intprops:
if error not in self.intprops_err or error not in self.table.colnames: if (error not in self.intprops_err or
raise ValueError("Intensive properties errors must be in input file.") error not in self.table.colnames):
elif error not in self.tofit_err or error not in self.table.colnames: raise ValueError("Intensive properties errors must be in "
"input file.")
elif (error not in self.tofit_err or
error not in self.table.colnames):
colerr = Column(data=np.fabs(self.table[item] * defaulterror), colerr = Column(data=np.fabs(self.table[item] * defaulterror),
name=error) name=error)
self.table.add_column(colerr, self.table.add_column(colerr,
......
...@@ -73,7 +73,7 @@ class ParametersManagerGrid(object): ...@@ -73,7 +73,7 @@ class ParametersManagerGrid(object):
""" """
k = len(l) // nb k = len(l) // nb
step = k + nz - k%nz step = k + nz - k % nz
return [l[i * step: (i+1) * step] for i in range(nb)] return [l[i * step: (i+1) * step] for i in range(nb)]
...@@ -223,7 +223,6 @@ class ParametersManagerFile(object): ...@@ -223,7 +223,6 @@ class ParametersManagerFile(object):
raise ValueError("The number of blocks must be no more than the number" raise ValueError("The number of blocks must be no more than the number"
"of models.") "of models.")
def from_index(self, index): def from_index(self, index):
"""Provides the parameters of a model given an index. """Provides the parameters of a model given an index.
......
...@@ -13,6 +13,7 @@ import numpy as np ...@@ -13,6 +13,7 @@ import numpy as np
from multiprocessing.sharedctypes import RawArray from multiprocessing.sharedctypes import RawArray
from ..warehouse import SedWarehouse from ..warehouse import SedWarehouse
def get_info(cls): def get_info(cls):
warehouse = SedWarehouse() warehouse = SedWarehouse()
sed = warehouse.get_sed(cls.conf['sed_modules'], sed = warehouse.get_sed(cls.conf['sed_modules'],
...@@ -22,6 +23,7 @@ def get_info(cls): ...@@ -22,6 +23,7 @@ def get_info(cls):
return (info, sed.mass_proportional_info) return (info, sed.mass_proportional_info)
class SharedArray(object): class SharedArray(object):
"""Class to Create a shared array that can be read/written by parallel """Class to Create a shared array that can be read/written by parallel
processes, were data related to the models is going to be stored. For processes, were data related to the models is going to be stored. For
......
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