From ade965a0030a38a58e4ac28d410a3c24cc7ca93d Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Sun, 26 Jan 2025 20:00:02 -0600 Subject: [PATCH] [sourcegen] Align CLib APIs --- .../sourcegen/sourcegen/_data/ct_auto.yaml | 24 +++--- .../sourcegen/_data/ctfunc_auto.yaml | 30 +++---- .../sourcegen/sourcegen/_data/ctkin_auto.yaml | 14 ++-- .../sourcegen/_data/ctthermo_auto.yaml | 80 ++++++++++--------- .../sourcegen/_data/cttrans_auto.yaml | 3 +- 5 files changed, 80 insertions(+), 71 deletions(-) diff --git a/interfaces/sourcegen/sourcegen/_data/ct_auto.yaml b/interfaces/sourcegen/sourcegen/_data/ct_auto.yaml index 2669c37ef..a8027d501 100644 --- a/interfaces/sourcegen/sourcegen/_data/ct_auto.yaml +++ b/interfaces/sourcegen/sourcegen/_data/ct_auto.yaml @@ -7,20 +7,22 @@ docstring: |- prefix: ct3 base: "" recipes: -- name: version # previously: getCanteraVersion -- name: gitCommit # previously: getGitCommit +- name: getCanteraVersion + implements: version # inconsistent API (preexisting) +- name: getGitCommit + implements: gitCommit # inconsistent API (preexisting) - name: getCanteraError -- name: addDataDirectory # previously: addCanteraDirectory - implements: addDirectory +- name: addCanteraDirectory + implements: addDirectory # inconsistent API (preexisting) - name: getDataDirectories - name: findInputFile -- name: suppress_deprecation_warnings -- name: make_deprecation_warnings_fatal -- name: suppress_warnings -- name: warnings_suppressed -- name: make_warnings_fatal -- name: suppress_thermo_warnings -- name: use_legacy_rate_constants +- name: suppress_deprecation_warnings # inconsistent API (snake_case; preexisting) +- name: make_deprecation_warnings_fatal # inconsistent API (snake_case; preexisting) +- name: suppress_warnings # inconsistent API (snake_case; preexisting) +- name: warnings_suppressed # inconsistent API (snake_case; preexisting) +- name: make_warnings_fatal # inconsistent API (snake_case; preexisting) +- name: suppress_thermo_warnings # inconsistent API (snake_case; preexisting) +- name: use_legacy_rate_constants # inconsistent API (snake_case; preexisting) - name: appdelete - name: clearStorage - name: resetStorage diff --git a/interfaces/sourcegen/sourcegen/_data/ctfunc_auto.yaml b/interfaces/sourcegen/sourcegen/_data/ctfunc_auto.yaml index 4eae4d28c..aae0b4df7 100644 --- a/interfaces/sourcegen/sourcegen/_data/ctfunc_auto.yaml +++ b/interfaces/sourcegen/sourcegen/_data/ctfunc_auto.yaml @@ -7,25 +7,27 @@ docstring: |- prefix: func13 base: Func1 recipes: -- name: checkFunc1 # previously: check -- name: newBasic # previously: new_basic +- name: check + implements: checkFunc1 # inconsistent API (preexisting) +- name: new_basic # inconsistent API (snake_case; preexisting) implements: newFunc1(const string&, double) -- name: newAdvanced # previously: new_advanced +- name: new_advanced # inconsistent API (snake_case; preexisting) implements: newFunc1(const string&, const vector&) -- name: newCompound # previously: new_compound +- name: new_compound # inconsistent API (snake_case; preexisting) implements: newFunc1(const string&, const shared_ptr, const shared_ptr) -- name: newModified # previously: new_modified +- name: new_modified # inconsistent API (snake_case; preexisting) implements: newFunc1(const string&, const shared_ptr, double) -- name: newSum # previously: new_sum - implements: newSumFunction -- name: newDiff # previously: new_diff - implements: newDiffFunction -- name: newProd # previously: new_prod - implements: newProdFunction -- name: newRatio # previously: new_ratio - implements: newRatioFunction +- name: new_sum + implements: newSumFunction # inconsistent API (preexisting) +- name: new_diff + implements: newDiffFunction # inconsistent API (preexisting) +- name: new_prod + implements: newProdFunction # inconsistent API (preexisting) +- name: new_ratio + implements: newRatioFunction # inconsistent API (preexisting) - name: type -- name: eval # previously: value +- name: value + implements: eval # inconsistent API (preexisting) - name: derivative what: accessor # - name: duplicate <--- unnecessary: traditional CLib duplicates function diff --git a/interfaces/sourcegen/sourcegen/_data/ctkin_auto.yaml b/interfaces/sourcegen/sourcegen/_data/ctkin_auto.yaml index 142355585..ef15087e9 100644 --- a/interfaces/sourcegen/sourcegen/_data/ctkin_auto.yaml +++ b/interfaces/sourcegen/sourcegen/_data/ctkin_auto.yaml @@ -9,18 +9,20 @@ base: Kinetics parents: [] # List of parent classes derived: [InterfaceKinetics] # List of specializations recipes: -- name: kineticsType # previously: getType +- name: getType + implements: kineticsType # inconsistent API (preexisting) - name: nReactions -- name: reaction # new +- name: reaction # New in Cantera 3.2 uses: nReactions what: accessor - name: nPhases - name: phase uses: nPhases what: accessor -- name: reactionPhase # new +- name: reactionPhase # New in Cantera 3.2 - name: phaseIndex -- name: nTotalSpecies # previously: nSpecies +- name: nSpecies + implements: nTotalSpecies # inconsistent API (preexisting) - name: reactantStoichCoeff - name: productStoichCoeff - name: getFwdRatesOfProgress @@ -35,8 +37,8 @@ recipes: - name: multiplier - name: setMultiplier - name: isReversible -- name: kineticsSpeciesIndex # previously: speciesIndex - implements: kineticsSpeciesIndex(const string&) +- name: speciesIndex + implements: kineticsSpeciesIndex(const string&) # inconsistent API (preexisting) - name: advanceCoverages implements: advanceCoverages(double) - name: getDeltaEnthalpy # previously: part of getDelta diff --git a/interfaces/sourcegen/sourcegen/_data/ctthermo_auto.yaml b/interfaces/sourcegen/sourcegen/_data/ctthermo_auto.yaml index d2156bcd7..7e26fecc6 100644 --- a/interfaces/sourcegen/sourcegen/_data/ctthermo_auto.yaml +++ b/interfaces/sourcegen/sourcegen/_data/ctthermo_auto.yaml @@ -11,10 +11,11 @@ parents: [Phase] # List of parent classes derived: [SurfPhase] # List of specializations recipes: - name: report -- name: name # previously: getName +- name: getName + implements: name # inconsistent API (preexisting) - name: setName - name: getEosType - implements: type + implements: type # inconsistent API (preexisting) - name: nElements - name: nSpecies - name: temperature @@ -41,16 +42,17 @@ recipes: implements: setMoleFractionsByName(const string&) - name: setMassFractionsByName implements: setMassFractionsByName(const string&) -- name: atomicWeights # previously: getAtomicWeights +- name: getAtomicWeights uses: nElements + implements: atomicWeights # inconsistent API (preexisting) - name: getMolecularWeights uses: nSpecies - name: getCharges uses: nElements -- name: elementName # previously: getElementName - implements: elementName(int) -- name: speciesName # previously: getSpeciesName - implements: speciesName(int) +- name: getElementName + implements: elementName(int) # inconsistent API (preexisting) +- name: getSpeciesName + implements: speciesName(int) # inconsistent API (preexisting) - name: elementIndex - name: speciesIndex - name: nAtoms @@ -71,9 +73,9 @@ recipes: - name: cv_mole - name: cv_mass - name: chemPotentials - implements: getChemPotentials + implements: getChemPotentials # inconsistent API (preexisting) - name: electroChemPotentials - implements: getElectrochemPotentials + implements: getElectrochemPotentials # inconsistent API (preexisting) - name: electricPotential - name: setElectricPotential - name: thermalExpansionCoeff @@ -83,38 +85,38 @@ recipes: - name: getPartialMolarIntEnergies - name: getPartialMolarCp - name: getPartialMolarVolumes -- name: setState_TPX # new +- name: setState_TPX # New in Cantera 3.2 implements: setState_TPX(double, double, const double*) -- name: setState_TPY # new +- name: setState_TPY # New in Cantera 3.2 implements: setState_TPY(double, double, const double*) -- name: setState_TP # previously: set_TP - implements: setState_TP(double, double) -- name: setState_TD # previously: set_TD - implements: setState_TD(double, double) -- name: setState_DP # previously: set_DP - implements: setState_DP(double, double) -- name: setState_HP # previously: set_HP - implements: setState_HP(double, double) -- name: setState_UV # previously: set_UV - implements: setState_UV(double, double) -- name: setState_SV # previously: set_SV - implements: setState_SV(double, double) -- name: setState_SP # previously: set_SP - implements: setState_SP(double, double) -- name: setState_ST # previously: set_ST - implements: setState_ST(double, double) -- name: setState_TV # previously: set_TV - implements: setState_TV(double, double) -- name: setState_PV # previously: set_PV - implements: setState_PV(double, double) -- name: setState_UP # previously: set_UP - implements: setState_UP(double, double) -- name: setState_VH # previously: set_VH - implements: setState_VH(double, double) -- name: setState_TH # previously: set_TH - implements: setState_TH(double, double) -- name: setState_SH # previously: set_SH - implements: setState_SH(double, double) +- name: set_TP + implements: setState_TP(double, double) # inconsistent API (preexisting) +- name: set_TD + implements: setState_TD(double, double) # inconsistent API (preexisting) +- name: set_DP + implements: setState_DP(double, double) # inconsistent API (preexisting) +- name: set_HP + implements: setState_HP(double, double) # inconsistent API (preexisting) +- name: set_UV + implements: setState_UV(double, double) # inconsistent API (preexisting) +- name: set_SV + implements: setState_SV(double, double) # inconsistent API (preexisting) +- name: set_SP + implements: setState_SP(double, double) # inconsistent API (preexisting) +- name: set_ST + implements: setState_ST(double, double) # inconsistent API (preexisting) +- name: set_TV + implements: setState_TV(double, double) # inconsistent API (preexisting) +- name: set_PV + implements: setState_PV(double, double) # inconsistent API (preexisting) +- name: set_UP + implements: setState_UP(double, double) # inconsistent API (preexisting) +- name: set_VH + implements: setState_VH(double, double) # inconsistent API (preexisting) +- name: set_TH + implements: setState_TH(double, double) # inconsistent API (preexisting) +- name: set_SH + implements: setState_SH(double, double) # inconsistent API (preexisting) - name: equilibrate implements: ThermoPhase::equilibrate(const string&, const string&, double, int, int, int) diff --git a/interfaces/sourcegen/sourcegen/_data/cttrans_auto.yaml b/interfaces/sourcegen/sourcegen/_data/cttrans_auto.yaml index 83137b60a..a74fe9f3a 100644 --- a/interfaces/sourcegen/sourcegen/_data/cttrans_auto.yaml +++ b/interfaces/sourcegen/sourcegen/_data/cttrans_auto.yaml @@ -15,7 +15,8 @@ recipes: - name: electricalConductivity - name: getThermalDiffCoeffs - name: getMixDiffCoeffs -- name: getBinaryDiffCoeffs # previously: getBinDiffCoeffs +- name: getBinDiffCoeffs + implements: getBinaryDiffCoeffs # inconsistent API (preexisting) - name: getMultiDiffCoeffs - name: getMolarFluxes - name: getMassFluxes