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

Failure in test-python-utils with v2.6.0a2 #1040

Closed
santoshshanbhogue opened this issue May 15, 2021 · 11 comments · Fixed by #1123
Closed

Failure in test-python-utils with v2.6.0a2 #1040

santoshshanbhogue opened this issue May 15, 2021 · 11 comments · Fixed by #1123

Comments

@santoshshanbhogue
Copy link
Contributor

santoshshanbhogue commented May 15, 2021

Problem description
Two tests fail on my mac (there are others that fail, but they are comments in the source code that these are expected such as in test_mixture.py::TestMixture::test_equilibrate2)

Steps to reproduce

run scons test test-python-utils

Behavior

See the screen dump at the end of this message for more info

System information

  • Cantera version: 2.6.0a2 commit #627e21e95
  • OS: Mac OS 10.15.7
  • Python/MATLAB/other software versions: 3.7.4

Attachments

../../build/python/cantera/test/test_transport.py .......................................                        [ 96%]
../../build/python/cantera/test/test_utils.py ..................FF.......                                        [100%]

======================================================= FAILURES =======================================================
______________________________________________ TestPyToAnyValue.test_none ______________________________________________

self = <cantera.test.test_utils.TestPyToAnyValue testMethod=test_none>

    def test_none(self):
>       self.check_conversion(None, "void")

../../build/python/cantera/test/test_utils.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../build/python/cantera/test/test_utils.py:14: in check_conversion
    self.assertEqual(held_type, check_type)
E   AssertionError: 'v' != 'void'
E   - v
E   + void
__________________________________________ TestPyToAnyValue.test_scalar_bool ___________________________________________

self = <cantera.test.test_utils.TestPyToAnyValue testMethod=test_scalar_bool>

    def test_scalar_bool(self):
>       self.check_conversion(True, "bool")

../../build/python/cantera/test/test_utils.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../build/python/cantera/test/test_utils.py:14: in check_conversion
    self.assertEqual(held_type, check_type)
E   AssertionError: 'b' != 'bool'
E   - b
E   + bool

Additional context

@ischoegl
Copy link
Member

@santoshshanbhogue ... thank you for reporting this issue. Could you please provide some additional information about your specific setup? (both hardware and cantera configuration). I am asking as there are some apparent differences between your system and the GitHub OSX test environment (where those tests pass).

@santoshshanbhogue
Copy link
Contributor Author

Hardware info:
Model Name: MacBook Pro
Model Identifier: MacBookPro15,1
Processor Name: 8-Core Intel Core i9
Processor Speed: 2.3 GHz
Number of Processors: 1
Total Number of Cores: 8
L2 Cache (per Core): 256 KB
L3 Cache: 16 MB
Hyper-Threading Technology: Enabled
Memory: 32 GB

Cantera configuration:
prefix = '/Users/santosh1/packages/ct_dev_version'
python_package = 'full'
matlab_toolbox = 'y'
matlab_path = '/Applications/MATLAB_R2019a.app/'
f90_interface = 'n'
system_eigen = 'n'
system_fmt = 'n'
system_sundials = 'n'

System kernel info:
Darwin Kernel Version 19.6.0

Let me know if you need anything else

@bryanwweber
Copy link
Member

I think the NumPy, Cython, and Python versions would all help too.

@santoshshanbhogue
Copy link
Contributor Author

I'm using Python 3.7.4
Numpy '1.17.2'
and cython '0.29.13'

@ischoegl
Copy link
Member

Interesting - I was mostly curious about Apple Silicon vs Intel processor. I don’t use a Mac and there’s nothing out of the ordinary, so I don’t have any ideas at the moment.

@speth
Copy link
Member

speth commented May 17, 2021

I'm mostly interested in which C++ compiler C++ standard library version are being used, and what version of Boost is present. One of those is responsible for the strings that are being returned here.

I think what's happening is that we've ended up setting some very specific expectations for the return values of AnyValue::type_str() in these tests, when it's really just meant to provide something to put in an error message.

@santoshshanbhogue
Copy link
Contributor Author

I'm using g++ and compiling with --std=c++0x

Apple clang version 12.0.0 (clang-1200.0.32.29)
The standard library version is 201103
Boost version: 1.55.0

@speth
Copy link
Member

speth commented May 19, 2021

It's interesting that this is (I think) the version of Boost that first introduced the demangle function that we're using here. Can you check the top of your scons build output for the lines that mention Boost and the check for the dmangle function. For example, I have:

INFO: Found Boost version 1.71
Checking whether boost::core::demangle is declared... (cached) yes

p.s. You aren't actually using g++. As you can see from the version output mentioning clang, this is just a very confusing alias that Apple has introduced.

@santoshshanbhogue
Copy link
Contributor Author

santoshshanbhogue commented May 19, 2021

Interesting, actually, no, the 1.55.0 version that I use does not have the demangle function and the scons build log indicates as such

I just upgraded to v1.76 (the latest) which has the demangle function and all tests pass

I also just checked (https://cantera.org/compiling/dependencies.html#other-required-software) and it states that Boost > 1.54 will suffice

By the way, is there some plan for development in MATLAB for which you need contributors?

@speth
Copy link
Member

speth commented May 19, 2021

We aren't deliberately requiring a newer Boost version, and apparently the note I made in SConstruct that demangle is available in 1.55 isn't correct.

I'd like to keep this open, as there are apparently a couple of little hiccups here that warrant fixes.

@speth speth reopened this May 19, 2021
@bryanwweber
Copy link
Member

I looked into which version has core/demangle.hpp and it seems to be in 1.56.0.

speth added a commit to speth/cantera that referenced this issue Oct 19, 2021
Without Boost, the string versions of certain typenames are
compiler-dependent. Make sure we use consitent names for all of the
types where we end up checking for the names in the test suite.

Also, correct comment indicating the minimum version of Boost that has
the demangle function.

Fixes Cantera#1040
speth added a commit to speth/cantera that referenced this issue Oct 19, 2021
Without Boost, the string versions of certain typenames are
compiler-dependent. Make sure we use consistent names for all of the
types where we end up checking for the names in the test suite.

Also, correct comment indicating the minimum version of Boost that has
the demangle function.

Fixes Cantera#1040
ischoegl pushed a commit that referenced this issue Oct 19, 2021
Without Boost, the string versions of certain typenames are
compiler-dependent. Make sure we use consistent names for all of the
types where we end up checking for the names in the test suite.

Also, correct comment indicating the minimum version of Boost that has
the demangle function.

Fixes #1040
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.

4 participants