Skip to content

cti2yaml failure #996

@ischoegl

Description

@ischoegl

Problem description

cti2yaml fails to convert the test input file test/data/kineticsfromscratch.cti

Steps to reproduce

kineticsfromscratch.cti contains valid definitions:

In [1]: import cantera as ct

In [2]: sol = ct.Solution('test/data/kineticsfromscratch.cti')

In [3]: sol.n_species, sol.n_reactions
Out[3]: (9, 5)

However, an attempt to convert to yaml via cti2yaml fails:

$ cd test/data
$ cti2yaml kineticsfromscratch.cti 
Traceback (most recent call last):
  File "/usr/local/bin/cti2yaml", line 11, in <module>
    load_entry_point('Cantera==2.6.0a1', 'console_scripts', 'cti2yaml')()
  File "/usr/local/lib/python3.6/dist-packages/cantera/cti2yaml.py", line 1701, in main
    convert(input_file, output_file)
  File "/usr/local/lib/python3.6/dist-packages/cantera/cti2yaml.py", line 1661, in convert
    emitter.dump(phases_map, dest)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/main.py", line 451, in dump
    return self.dump_all([data], stream, _kw, transform=transform)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/main.py", line 465, in dump_all
    self._context_manager.dump(data)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/main.py", line 817, in dump
    self._yaml.representer.represent(data)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/representer.py", line 85, in represent
    node = self.represent_data(data)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/representer.py", line 112, in represent_data
    node = self.yaml_representers[data_types[0]](self, data)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/representer.py", line 1173, in represent_dict
    return self.represent_mapping(tag, data)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/representer.py", line 1018, in represent_mapping
    node_value = self.represent_data(item_value)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/representer.py", line 112, in represent_data
    node = self.yaml_representers[data_types[0]](self, data)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/representer.py", line 350, in represent_list
    return self.represent_sequence(u'tag:yaml.org,2002:seq', data)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/representer.py", line 934, in represent_sequence
    node_item = self.represent_data(item)
  File "/home/docker/.local/lib/python3.6/site-packages/ruamel/yaml/representer.py", line 112, in represent_data
    node = self.yaml_representers[data_types[0]](self, data)
  File "/usr/local/lib/python3.6/dist-packages/cantera/cti2yaml.py", line 1108, in to_yaml
    node.get_yaml(out)
  File "/usr/local/lib/python3.6/dist-packages/cantera/cti2yaml.py", line 1156, in get_yaml
    out['transport'] = _newNames[self.transport]
KeyError: 'None'

System information

  • Cantera version: 2.6.0a1
  • OS: Ubuntu 18.04
  • Python/MATLAB/other software versions: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions