Skip to content

We should replace cantera.Species.fromCti() calls with cantera.Species.from_yaml() calls #2676

Closed

Description

@rwest

Bug Description

The unit tests include the warning:

test/rmgpy/speciesTest.py::TestSpecies::test_cantera
  /home/runner/work/RMG-Py/RMG-Py/test/rmgpy/speciesTest.py:477: DeprecationWarning: XML_Node::build: 
  The CTI and XML input file formats are deprecated and will be removed in
  Cantera 3.0. Use 'cti2yaml.py' or 'ctml2yaml.py' to convert CTI or XML input
  files to the YAML format. See https://cantera.org/tutorials/legacy2yaml.html
  for more information.

The relevant part of RMG-Py/test/rmgpy/speciesTest.py is

        rmg_ct_species = rmg_species.to_cantera(use_chemkin_identifier=True)

        ct_species = ct.Species.fromCti(
            """species(name=u'Ar',
        atoms='Ar:1',
        thermo=(NASA([200.00, 1000.00],
                     [ 2.50000000E+00,  0.00000000E+00,  0.00000000E+00,
                       0.00000000E+00,  0.00000000E+00, -7.45375000E+02,
                       4.37967000E+00]),
                NASA([1000.00, 6000.00],
                     [ 2.50000000E+00,  0.00000000E+00,  0.00000000E+00,
                       0.00000000E+00,  0.00000000E+00, -7.45375000E+02,
                       4.37967000E+00])),
        transport=gas_transport(geom='atom',
                                diam=3.33,
                                well_depth=136.501,
                                dipole=2.0,
                                polar=1.0,
                                rot_relax=15.0))"""
        )
        assert type(rmg_ct_species) == type(ct_species)

We should replace the fromCti block with a from_yaml block with a syntax a bit like this (this example is obviously a different species)

ct.Species.from_yaml(
'''name: C6H5CH3
composition: {C: 7, H: 8}
thermo:
  model: NASA7
  temperature-ranges: [100.00, 1073.72, 5000.00]
  data:
  - [2.05719474e+00, 3.12152776E-02, 3.04758250E-05, -5.05435593E-08, 
     1.81542493E-11, 3.83493690E+03, 1.65378111E+01]
  - [9.30667130E+00, 3.36713230E-02, -1.41158452E-05, 2.69973752E-09, 
    -1.93204076E-13, 5.79813528E+02, -2.68610894E+01]'''
    )

Note the transportDataTest.py also has a fromCti call.

  • speciesTest.py
  • transportDataTest.py

How To Reproduce

Run the unit tests, specifically test/rmgpy/speciesTest.py

Expected Behavior

We wouldn't get deprecation warnings from Cantera.

Activity

  1. JacksonBurns commented on Jun 11, 2024

    @JacksonBurns
    Contributor

    Would this also require setting a new lower limit to the supported Cantera version inside the environment file? I assume that this new function has not been backported to all previous versions, and there would be some new cutoff.

  2. rwest commented on Jun 25, 2024

    @rwest
    MemberAuthor

    For a year now we have required Cantera 2.6, and from_yaml is documented in that version. (It already existed in 2.5.1 but was called fromYaml)

  3. github-actions commented on Sep 24, 2024

    @github-actions

    This issue is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant issue, otherwise it will automatically be closed in 30 days.

  4. added
    stale
    on Sep 24, 2024
  5. added
    abandoned
    on Oct 25, 2024
  6. JacksonBurns commented on Jan 22, 2025

    @JacksonBurns
    Contributor

    The Python 3.9 upgrade is running into a challenge with Arm-Based Macs that could be solved by resolving this issue.

    The juliacall overhaul required with Python 3.9 does not work when running in x86 emulation mode on Apple Silicon, so we would rather run in ARM native. Cantera 2.6 does not have arm-osx builds, but the latest versions of cantera do.

  7. removed
    stale
    abandoned
    on Jan 22, 2025
  8. linked a pull request that will close this issueUpdate to `cantera` 3.x #2751on Jan 22, 2025
  9. 10 remaining items

  10. added
    abandoned
    on Nov 22, 2025
  11. removed
    stale
    abandoned
    on Nov 22, 2025
  12. reopened this on Nov 22, 2025
  13. github-actions commented on Feb 21, 2026

    @github-actions

    This issue is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant issue, otherwise it will automatically be closed in 30 days.

  14. added
    stale
    on Feb 21, 2026
  15. added
    abandoned
    on Mar 23, 2026
  16. removed
    stale
    abandoned
    on Mar 25, 2026
  17. linked a pull request that will close this issueUpgrade to Cantera 3 (again?) #2885on Mar 25, 2026
  18. reopened this on Mar 26, 2026
  19. rwest commented on Mar 26, 2026

    @rwest
    MemberAuthor

    Closed by bc03022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions