Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruamel.yaml new API implementation broke #1059

Closed
DavidAkinpelu opened this issue Jun 14, 2021 · 6 comments · Fixed by #1060
Closed

ruamel.yaml new API implementation broke #1059

DavidAkinpelu opened this issue Jun 14, 2021 · 6 comments · Fixed by #1060
Assignees

Comments

@DavidAkinpelu
Copy link
Contributor

DavidAkinpelu commented Jun 14, 2021

Problem description

Some unit tests failed due to the breakage in the implementation of the new ruamel.yaml API. It may be related to #1048 and #1049.

Steps to reproduce

Run unit test on the main branch

======================================================================
FAIL: setUpClass (cantera.test.test_composite.TestModels)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\David\cantera\build\python\cantera\test\test_composite.py", line 17, in setUpClass
    cls.yml = utilities.load_yaml(cls.yml_file)
  File "C:\Users\David\cantera\build\python\cantera\test\utilities.py", line 25, in load_yaml
    return yaml_.load(stream)
  File "C:\Users\David\anaconda3\envs\cantera-dev\lib\site-packages\ruamel_yaml\main.py", line 331, in load
    return constructor.get_single_data()
  File "C:\Users\David\anaconda3\envs\cantera-dev\lib\site-packages\ruamel_yaml\constructor.py", line 111, in get_single_data
    return self.construct_document(node)
  File "C:\Users\David\anaconda3\envs\cantera-dev\lib\site-packages\ruamel_yaml\constructor.py", line 116, in construct_document
    data = self.construct_object(node)
  File "C:\Users\David\anaconda3\envs\cantera-dev\lib\site-packages\ruamel_yaml\constructor.py", line 167, in construct_object
    data = constructor(self, node)
  File "C:\Users\David\anaconda3\envs\cantera-dev\lib\site-packages\ruamel_yaml\constructor.py", line 729, in construct_undefined
    raise ConstructorError(
ruamel_yaml.constructor.ConstructorError: could not determine a constructor for the tag None
  in "C:\Users\David\cantera\build\python\cantera\test\data\thermo-models.yaml", line 1, column 1'

System information

  • Cantera version: 2.6.0a2/ main branch
  • OS: Windows 10
  • Python/MATLAB/other software versions: Python 3.9
@ischoegl
Copy link
Member

@DavidAkinpelu ... Thank you for pointing this out: this is indeed due to recent changes in #1049.

@ischoegl ischoegl self-assigned this Jun 14, 2021
@ischoegl
Copy link
Member

@DavidAkinpelu ... could you verify that #1060 fixes the issue?

@DavidAkinpelu
Copy link
Contributor Author

Got this error while trying to run the unit test. Seems the last two digits were switched.

======================================================================
FAIL: test_deprecated_callers (cantera.test.test_reaction.TestChebyshev)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\David\cantera\build\python\cantera\test\test_reaction.py", line 501, in test_deprecated_callers
    self.check_equal(rxn(T, P), value)
  File "C:\Users\David\cantera\build\python\cantera\test\test_reaction.py", line 458, in check_equal
    self.assertEqual(one, two)
AssertionError: 2858762454.1119056 != 2858762454.1119065
======================================================================
FAIL: test_deprecated_callers (cantera.test.test_reaction.TestChebyshev2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\David\cantera\build\python\cantera\test\test_reaction.py", line 498, in test_deprecated_callers
    self.check_equal(rxn(T, P), value)
  File "C:\Users\David\cantera\build\python\cantera\test\test_reaction.py", line 458, in check_equal
    self.assertEqual(one, two)
AssertionError: 2858762454.1119056 != 2858762454.1119065
----------------------------------------------------------------------

@ischoegl
Copy link
Member

Ok, this is due to #995 - checking equality on floats ...

@ischoegl
Copy link
Member

I pushed an update that should fix the remaining failing test. @DavidAkinpelu could you check?

@DavidAkinpelu
Copy link
Contributor Author

@ischoegl Worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants