Commit 5c907487 authored by Médéric Boquien's avatar Médéric Boquien Committed by Yannick Roehlly

Typo and spelling corrections

PEP8-fication of the code and correction of various typos and spelling
mistakes.
parent 4f422dc6
......@@ -215,7 +215,7 @@ class Database(object):
self.session.commit()
except exc.IntegrityError:
self.session.rollback()
raise StandardError('The filter is yet in the base.')
raise StandardError('The filter is already in the base.')
else:
raise StandardError('The database is not writable.')
......
......@@ -159,7 +159,7 @@ class SED(object):
If the key is present in the dictionary, it will raise an exception.
Use this method (instead of direct value assignment ) to avoid
overriding a yet present information.
overriding an already present information.
Parameters
----------
......@@ -171,7 +171,7 @@ class SED(object):
If True, the added variable is set as proportional to the
mass.
force : boolean
If false (default), adding a key that yet exists in the info
If false (default), adding a key that already exists in the info
dictionary will raise an error. If true, doing this will update
the associated value.
......@@ -181,7 +181,7 @@ class SED(object):
if mass_proportional:
self.mass_proportional_info.append(key)
else:
raise KeyError("The information %s is yet present "
raise KeyError("The information %s is already present "
"in the SED. " % key)
def add_module(self, module_name, module_conf):
......@@ -392,7 +392,7 @@ class SED(object):
transmission[1])
# TODO: Can we avoid to normalise as the filter transmission is
# yet normalised?
# already normalised?
f_lambda = utils.luminosity_to_flux(
(np.trapz(transmission_r * l_lambda_r, wavelength_r) /
np.trapz(transmission_r, wavelength_r)),
......
......@@ -59,9 +59,9 @@ def complete_parameters(given_parameters, parameter_list):
if unexpected_parameters:
message += ("Unexpected parameters: " +
", ".join(unexpected_parameters) +
".")
". ")
raise KeyError("The parameters passed are different from the "
"expected one." + message)
"expected one. " + message)
return given_parameters
......
......@@ -56,13 +56,10 @@ class Module(common.SEDCreationModule):
)
}
out_parameter_list = {
'qpah': 'Mass fraction of PAH',
'umin': 'Minimum radiation field',
'umax': 'Maximum radiation field',
'gamma': 'Fraction illuminated from Umin to Umax'
}
out_parameter_list = {'qpah': 'Mass fraction of PAH',
'umin': 'Minimum radiation field',
'umax': 'Maximum radiation field',
'gamma': 'Fraction illuminated from Umin to Umax'}
def _init_code(self):
"""Get the model out of the database"""
......@@ -84,15 +81,14 @@ class Module(common.SEDCreationModule):
# mass in W kg¯¹, The gamma parameter does not affect the fact that it
# is for 1 kg because it represents a mass fraction of each component.
self.emissivity = np.trapz((1. - gamma) * self.model_minmin.lumin +
gamma * self.model_minmax.lumin,
x=self.model_minmin.wave)
gamma * self.model_minmax.lumin,
x=self.model_minmin.wave)
# We want to be able to display the respective constributions of both
# components, therefore we keep they separately.
self.model_minmin.lumin *= (1. - gamma) / self.emissivity
self.model_minmax.lumin *= gamma / self.emissivity
def process(self, sed):
"""Add the IR re-emission contributions
......
......@@ -6,4 +6,3 @@ Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt
@author: Yannick Roehlly <yannick.roehlly@oamp.fr>
"""
......@@ -135,7 +135,7 @@ class Module(common.AnalysisModule):
os.mkdir(OUT_DIR)
except OSError:
print("pcigale can't create the {} directory, maybe "
"it yet exists.".format(OUT_DIR))
"it already exists.".format(OUT_DIR))
sys.exit()
# Open the warehouse
......
......@@ -6,4 +6,3 @@ Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt
@author: Yannick Roehlly <yannick.roehlly@oamp.fr>
"""
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