Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Returns
-------
dict
Formatted mode_params for a fluorescence mode.
Raises
------
TypeError
Invalid input types, e.g. settle_time is not of type Unit(second)
ValueError
Invalid wells specified
ValueError
Gain is not between 0 and 1
"""
if not is_valid_well(wells):
raise ValueError(
f"Invalid wells {wells}, must be an iterable of wells or a "
f"WellGroup."
)
if isinstance(wells, Well):
wells = WellGroup([wells])
if not isinstance(excitation, list):
raise ValueError("Excitation {} must be a list")
if not isinstance(emission, list):
raise ValueError("Emission {} must be a list")
excitation = [self.wavelength_selection(**_) for _ in excitation]
emission = [self.wavelength_selection(**_) for _ in emission]
`position_z_calculated`
Returns
-------
dict
Formatted mode_params for an absorbance mode.
Raises
------
TypeError
Invalid type specified for input parameters, e.g. `num_flashes`
not of type int
ValueError
Invalid wells specified
"""
if not is_valid_well(wells):
raise ValueError(
f"Invalid wells {wells}, must be an iterable of wells or a "
f"WellGroup."
)
if isinstance(wells, Well):
wells = WellGroup([wells])
if not isinstance(wavelength, list):
wavelength = [wavelength]
wavelength = [parse_unit(_, "nanometer") for _ in wavelength]
if num_flashes is not None and not isinstance(num_flashes, int):
raise TypeError(f"Invalid num_flashes {num_flashes}, must be an int")
`position_z_calculated`
Returns
-------
dict
Formatted mode_params for a luminescence mode.
Raises
------
TypeError
Invalid input types, e.g. settle_time is not of type Unit(second)
ValueError
Gain is not between 0 and 1
"""
if not is_valid_well(wells):
raise ValueError(
f"Invalid wells {wells}, must be an iterable of wells or a "
f"WellGroup."
)
if isinstance(wells, Well):
wells = WellGroup([wells])
if num_flashes is not None and not isinstance(num_flashes, int):
raise TypeError(f"Invalid num_flashes {num_flashes}, must be an int")
if settle_time is not None:
settle_time = parse_unit(settle_time, "second")
if integration_time is not None:
integration_time = parse_unit(integration_time, "second")
for the full explanation
Returns
-------
dict
position_z parameters for a Spectrophotometry instruction
Raises
------
ValueError
If a list of wells is not provided
ValueError
If an invalid heuristic is specified
"""
if any([not is_valid_well(well) for well in wells]):
raise ValueError("Only an iterable of wells is allowed")
if heuristic is not None and heuristic not in self.Z_HEURISTICS:
raise ValueError(
f"heuristic must be one of {self.Z_HEURISTICS} but {heuristic} "
f"was specified"
)
return {"calculated_from_wells": {"wells": wells, "heuristic": heuristic}}