Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
use the specified number of threads.
"""
if method in ['DRG', 'DRGEP', 'PFA']:
assert target_species, (
'Need to specify at least one target species for graph-based reduction methods'
)
if not method and not run_sensitivity_analysis:
raise ValueError(
'Either a graph-based method or sensitivity analysis (or both) must be specified.'
)
if method == 'DRG':
reduced_model = run_drg(
model_file, ignition_conditions, psr_conditions, flame_conditions,
error_limit, target_species, safe_species, phase_name=phase_name,
threshold_upper=upper_threshold, num_threads=num_threads, path=path
)
elif method == 'DRGEP':
reduced_model = run_drgep(
model_file, ignition_conditions, psr_conditions, flame_conditions,
error_limit, target_species, safe_species, phase_name=phase_name,
threshold_upper=upper_threshold, num_threads=num_threads, path=path
)
elif method == 'PFA':
reduced_model = run_pfa(
model_file, ignition_conditions, psr_conditions, flame_conditions,
error_limit, target_species, safe_species, phase_name=phase_name,
num_threads=num_threads, path=path
)