How to use the pymars.sampling.parse_psr_inputs function in pymars

To help you get started, we’ve selected a few pymars examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Niemeyer-Research-Group / pyMARS / pymars / pymars.py View on Github external
for sp in safe_species:
        assert sp in gas.species_names, f'Specified retained species {sp} not in model'
    
    ignition_conditions = input_dict.get('autoignition-conditions', {})
    assert ignition_conditions, 'autoignition-conditions need to be specified'

    psr_conditions = input_dict.get('psr-conditions', {})
    flame_conditions = input_dict.get('laminar-flame-conditions', {})
    if psr_conditions:
        raise NotImplementedError('PSR sampling not implemented yet, sorry!')
    if flame_conditions:
        raise NotImplementedError('Laminar flame sampling not implemented yet, sorry!')

    # check validity of input file
    ignition_inputs = parse_ignition_inputs(model, ignition_conditions, phase_name)
    psr_inputs = parse_psr_inputs(model, psr_conditions, phase_name)
    flame_inputs = parse_flame_inputs(model, flame_conditions, phase_name)

    return ReductionInputs(
        model=model, error=error, 
        ignition_conditions=ignition_inputs, 
        psr_conditions=psr_inputs, flame_conditions=flame_inputs,
        method=method, target_species=target_species, safe_species=safe_species,
        sensitivity_analysis=sensitivity_analysis, upper_threshold=upper_threshold,
        sensitivity_type=sensitivity_type, phase_name=phase_name
        )