Skip to content

Commit

Permalink
remove named parameter in raising InvalidStepException
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Feb 26, 2019
1 parent 94b28c0 commit 6e16d48
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
14 changes: 7 additions & 7 deletions EPPs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,22 @@ def _validate_step(self):
# check the number of input containers
if len(self.input_container_names) > self._max_nb_input_containers:
raise InvalidStepError(
message='Maximum number of input container is %s. There are %s input container in the step.' % (
'Maximum number of input container is %s. There are %s input container in the step.' % (
self._max_nb_input_containers, len(self.input_container_names)
)
)
if self._max_nb_output_containers is not None:
# check the number of output containers
if len(self.output_container_names) > self._max_nb_output_containers:
raise InvalidStepError(
message='Maximum number of output plates is %s. There are %s output plates in the step.' % (
'Maximum number of output plates is %s. There are %s output plates in the step.' % (
self._max_nb_output_containers, len(self.output_container_names)
)
)
if self._max_nb_inputs is not None:
if len(self.artifacts) > self._max_nb_inputs:
raise InvalidStepError(
message="Maximum number of inputs is %s. %s inputs present in step." % (
"Maximum number of inputs is %s. %s inputs present in step." % (
self._max_nb_inputs, len(self.artifacts)
)
)
Expand All @@ -215,21 +215,21 @@ def _validate_step(self):
outputs = self.process.outputs_per_input(artifact.id, Analyte=True)
if len(outputs) != self._nb_analytes_per_input:
raise InvalidStepError(
message="%s replicates required for each input. "
"%s replicates required for each input. "
"%s replicates found for %s." % (self._nb_analytes_per_input, len(outputs), artifact.id)
)
if self._nb_resfiles_per_input is not None:
for artifact in self.artifacts:
outputs = self.process.outputs_per_input(artifact.id, ResultFile=True)
if len(outputs) != self._nb_resfiles_per_input:
raise InvalidStepError(
message="%s replicates required for each input. "
"%s replicates required for each input. "
"%s replicates found for %s." % (self._nb_analytes_per_input, len(outputs), artifact.id)
)
if self._max_nb_projects is not None:
if len(self.projects) > self._max_nb_projects:
raise InvalidStepError(
message='Maximum number of projet in step is %s. %s projects found.' % (
'Maximum number of projet in step is %s. %s projects found.' % (
self._max_nb_projects, len(self.projects)
)
)
Expand Down Expand Up @@ -356,7 +356,7 @@ def generate_csv_array(self):
counter += 1

if counter == 0:
raise InvalidStepError(message="No valid keys present in csv_dict. Key format must be row:column e.g. A:1.")
raise InvalidStepError("No valid keys present in csv_dict. Key format must be row:column e.g. A:1.")

return csv_rows

Expand Down
2 changes: 1 addition & 1 deletion scripts/autoplacement_qpcr_384.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _run(self):
output_counter += 1

if len(standards_dict) < 21:
raise InvalidStepError(message="Step requires QSTD A to F and No Template Control with 3 replicates each")
raise InvalidStepError("Step requires QSTD A to F and No Template Control with 3 replicates each")

# assemble the plate layout of the output plate as a list
plate_layout_columns = ["1", "2", "3", "4", "5", "6"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/autoplacement_seq_plate_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _run(self):
# all standards have been added correctly.
if len(standards_dict) != 24:
raise InvalidStepError(
message="Standards missing from step. All 8 standards should be added to the step.")
"Standards missing from step. All 8 standards should be added to the step.")

# assemble the plate layout of the output plate with the 8 standards stamped across the first 3 columns
# and each set of sample replicates stamped across three neighbouring columns
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate_hamilton_input_cfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ def _generate_csv_dict(self):
rsb_barcode = lot.lot_number

if not rsb_barcode:
raise InvalidStepError(message='Please assign RSB lot before generating Hamilton input.')
raise InvalidStepError('Please assign RSB lot before generating Hamilton input.')

# find all the inputs for the step that are analytes (i.e. samples and not associated files)
for input_art in self.artifacts:
if input_art.type == 'Analyte':
outputs = self.process.outputs_per_input(input_art.id, Analyte=True)
# the script is only compatible with 1 output for each input i.e. replicates are not allowed
if len(outputs) > 1:
raise InvalidStepError(message='Multiple outputs found for an input %s. '
raise InvalidStepError('Multiple outputs found for an input %s. '
'This step is not compatible with replicates.' % input_art.name)
output = outputs[0]

Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_hamilton_input_imp_ssqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _generate_csv_dict(self):
rsb_barcode = lot.lot_number

if not rsb_barcode:
raise InvalidStepError(message='Please assign RSB lot before generating Hamilton input.')
raise InvalidStepError('Please assign RSB lot before generating Hamilton input.')

# find all the inputs for the step that are analytes (i.e. samples and not associated files)
for input_art in self.artifacts:
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_hamilton_input_ntp.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _generate_csv_dict(self):
rsb_barcode = lot.lot_number

if not rsb_barcode:
raise InvalidStepError(message='Please assign RSB lot before generating Hamilton input.')
raise InvalidStepError('Please assign RSB lot before generating Hamilton input.')


# find all the inputs for the step that are analytes (i.e. samples and not associated files)
Expand Down
12 changes: 6 additions & 6 deletions scripts/generate_hamilton_input_qpcr_1to24.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ def _generate_csv_dict(self):

# check that DIL1 and DIL2 plate barcodes have the correct format
if not re.match(DIL1_template, DIL1_barcode):
raise InvalidStepError(message='%s is not a valid DIL1 container name. Container names must match %s' % (
raise InvalidStepError('%s is not a valid DIL1 container name. Container names must match %s' % (
DIL1_barcode, DIL1_template))

if not re.match(DIL2_template, DIL2_barcode):
raise InvalidStepError(message='%s is not a valid DIL2 container name. Container names must match %s' % (
raise InvalidStepError('%s is not a valid DIL2 container name. Container names must match %s' % (
DIL2_barcode, DIL2_template))

# find the corresponding lot number i.e. barcode for the QMX and QSTD.
Expand All @@ -92,16 +92,16 @@ def _generate_csv_dict(self):

if not qmx_barcode:
raise InvalidStepError(
message='qPCR Master Mix (QMX) lot not selected. Please select in "Reagent Lot Tracking" at top of step.')
'qPCR Master Mix (QMX) lot not selected. Please select in "Reagent Lot Tracking" at top of step.')

if not qstd_barcode:
raise InvalidStepError(
message='QSTD Plate lot not selected. Please select in "Reagent Lot Tracking" at top of step.')
'QSTD Plate lot not selected. Please select in "Reagent Lot Tracking" at top of step.')

# check that no more than 31 inputs present in the step. 7 standards and a maximum of 24 samples.
if len(self.artifacts) > 31:
raise InvalidStepError(
message='%s samples and standards present in step. There should be 7 standards and up to 24 samples present' % (
'%s samples and standards present in step. There should be 7 standards and up to 24 samples present' % (
len(self.artifacts)))

# find all the inputs for the step that are analytes (i.e. samples and not associated files) then add them to a set
Expand All @@ -115,7 +115,7 @@ def _generate_csv_dict(self):

# the script is only compatible with 3 outputs for each input i.e. replicates are not allowed
if len(output) != 3:
raise InvalidStepError(message='%s outputs found for an input %s. 3 replicates required.' % (
raise InvalidStepError('%s outputs found for an input %s. 3 replicates required.' % (
(str(len(output))), input_art.name))

# output locations i.e. wells in the QPCR plate need to appear in numerical order so they appear in column order
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_hamilton_input_seq_quant_plate.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _generate_csv_dict(self):

if not sdna_barcode:
raise InvalidStepError(
message='SDNA Plate lot not selected. Please select in "Reagent Lot Tracking" at top of step.')
'SDNA Plate lot not selected. Please select in "Reagent Lot Tracking" at top of step.')

# find all the inputs for the step that are analytes (i.e. samples and not associated files)
for art in self.artifacts:
Expand Down

0 comments on commit 6e16d48

Please sign in to comment.