From 16fd18315c461a854d5d718a31608b1776aa20d4 Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Tue, 7 Nov 2017 11:34:15 -0500 Subject: [PATCH] Remove HAS_NO_PYTHON configuration variable This variable is not needed since in the two places its used we do a runtime check of the presence of the Python interface anyways --- SConstruct | 5 ----- include/cantera/base/config.h.in | 6 ------ src/base/ct2ctml.cpp | 17 ----------------- test/kinetics/rates.cpp | 2 -- test/thermo/phaseConstructors.cpp | 2 -- 5 files changed, 32 deletions(-) diff --git a/SConstruct b/SConstruct index 32dc1967c..993199479 100644 --- a/SConstruct +++ b/SConstruct @@ -1436,11 +1436,6 @@ configh['SOLARIS'] = 1 if env['OS'] == 'Solaris' else None configh['DARWIN'] = 1 if env['OS'] == 'Darwin' else None cdefine('NEEDS_GENERIC_TEMPL_STATIC_DECL', 'OS', 'Solaris') -if env['python_package'] == 'none' and env['python3_package'] == 'n': - configh['HAS_NO_PYTHON'] = 1 -else: - configh['HAS_NO_PYTHON'] = None - configh['SUNDIALS_VERSION'] = env['sundials_version'].replace('.','') if env.get('has_sundials_lapack') and env['use_lapack']: diff --git a/include/cantera/base/config.h.in b/include/cantera/base/config.h.in index 18b850b9d..cdbc7ed61 100644 --- a/include/cantera/base/config.h.in +++ b/include/cantera/base/config.h.in @@ -70,12 +70,6 @@ typedef int ftnlen; // Fortran hidden string length type // and this leads to multiple defines at link time %(NEEDS_GENERIC_TEMPL_STATIC_DECL)s -//--------------------- Python ------------------------------------ - -// If this is defined, then python will not be assumed to be -// present to support conversions -%(HAS_NO_PYTHON)s - //-------------- Optional Cantera Capabilities ---------------------- // Enable Sundials to use an external BLAS/LAPACK library if it was diff --git a/src/base/ct2ctml.cpp b/src/base/ct2ctml.cpp index abd48d19c..c6778754f 100644 --- a/src/base/ct2ctml.cpp +++ b/src/base/ct2ctml.cpp @@ -89,14 +89,6 @@ static std::string call_ctml_writer(const std::string& text, bool isfile) arg = "text=r'''" + text + "'''"; } -#ifdef HAS_NO_PYTHON - //! Section to bomb out if python is not present in the computation - //! environment. - throw CanteraError("ct2ctml", - "python cti to ctml conversion requested for file, " + file + - ", but not available in this computational environment"); -#endif - string python_output, error_output; int python_exit_code; try { @@ -191,15 +183,6 @@ std::string ct_string2ctml_string(const std::string& cti) void ck2cti(const std::string& in_file, const std::string& thermo_file, const std::string& transport_file, const std::string& id_tag) { -#ifdef HAS_NO_PYTHON - //! Section to bomb out if python is not present in the computation - //! environment. - string ppath = in_file; - throw CanteraError("ct2ctml", - "python ck to cti conversion requested for file, " + ppath + - ", but not available in this computational environment"); -#endif - string python_output; int python_exit_code; try { diff --git a/test/kinetics/rates.cpp b/test/kinetics/rates.cpp index 68df5f7c6..d7fdba98b 100644 --- a/test/kinetics/rates.cpp +++ b/test/kinetics/rates.cpp @@ -8,7 +8,6 @@ namespace Cantera { -#ifndef HAS_NO_PYTHON TEST(FracCoeff, ConvertFracCoeff) { IdealGasPhase thermo1("../data/frac.cti", "gas"); @@ -33,7 +32,6 @@ TEST(FracCoeff, ConvertFracCoeff) } } } -#endif class FracCoeffTest : public testing::Test { diff --git a/test/thermo/phaseConstructors.cpp b/test/thermo/phaseConstructors.cpp index 0e076b033..bfdaa3ee3 100644 --- a/test/thermo/phaseConstructors.cpp +++ b/test/thermo/phaseConstructors.cpp @@ -155,7 +155,6 @@ TEST(IonsFromNeutralConstructor, fromScratch) EXPECT_NEAR(mu[1], -2.88157298e+06, 1e-1); } -#ifndef HAS_NO_PYTHON // skip these tests if the Python converter is unavailable class CtiConversionTest : public testing::Test { public: @@ -215,7 +214,6 @@ TEST_F(ChemkinConversionTest, FailedConversion) { ASSERT_THROW(ck2cti("h2o2_missingThermo.inp"), CanteraError); } -#endif class ConstructFromScratch : public testing::Test {