mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Use ninja for the examples (#2635)
* Use ninja for the examples Should help a little bit with doc building * FIx some templates * Fix template deduction error in count_x_for_y_many functions The count_x_for_y_many and count_x_for_y_manyC functions were using a single template parameter for both input (double) and output (size_t) arrays, causing template deduction failures in Cython bindings. Changed to use separate template parameters YContainer and CountContainer to properly support different types for input y values and output counts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix types in PXD header too * Docs should get ninja too * Changes from clang-format * Fix git diff argument order in clang-format script The script was comparing PR_BRANCH to TARGET_BRANCH, which shows changes from the PR branch to the target (what's in target that's NOT in PR). For PR validation, we need the opposite: changes from target to PR (what's in PR that's NOT in target). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix Cython template deduction errors in solve_for_x_manyC and count_x_for_y_manyC Add explicit template parameters [double, size_t] to both function calls to resolve template type deduction errors when compiling with Cython. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix wheel building by removing return from void Cython template calls The functions solve_for_x_manyC and count_x_for_y_manyC return void in C++. When Cython sees a return statement with a void function call containing template arguments with commas (e.g., [double, size_t]), it wraps the call in the __Pyx_void_to_None macro. This macro is a simple preprocessor macro that cannot handle the commas in template arguments, treating them as macro argument separators instead. The fix is to remove the return statements, making these simple void function calls. This prevents the __Pyx_void_to_None wrapping and allows the wheel to build successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -559,7 +559,7 @@ void _PropsSImulti(const std::vector<std::string>& Outputs, const std::string& N
|
||||
std::string N2 = Name2; // Make Non-constant copy of Name2 that we can modify
|
||||
const bool HasPhase1 = StripPhase(N1, State); // strip phase string from first name if needed
|
||||
const bool HasPhase2 = StripPhase(N2, State); // strip phase string from second name if needed
|
||||
if (HasPhase1 && HasPhase2) // if both Names have a phase string, don't allow it.
|
||||
if (HasPhase1 && HasPhase2) // if both Names have a phase string, don't allow it.
|
||||
throw ValueError("Phase can only be specified on one of the input key strings");
|
||||
|
||||
try {
|
||||
@@ -610,7 +610,8 @@ std::vector<std::vector<double>> PropsSImulti(const std::vector<std::string>& Ou
|
||||
#endif
|
||||
return std::vector<std::vector<double>>();
|
||||
}
|
||||
double PropsSI(const std::string& Output, const std::string& Name1, double Prop1, const std::string& Name2, double Prop2, const std::string& FluidName) {
|
||||
double PropsSI(const std::string& Output, const std::string& Name1, double Prop1, const std::string& Name2, double Prop2,
|
||||
const std::string& FluidName) {
|
||||
#if !defined(NO_ERROR_CATCHING)
|
||||
try {
|
||||
#endif
|
||||
@@ -642,9 +643,9 @@ double PropsSI(const std::string& Output, const std::string& Name1, double Prop1
|
||||
// END OF TRY
|
||||
#if !defined(NO_ERROR_CATCHING)
|
||||
} catch (const std::exception& e) {
|
||||
set_error_string(
|
||||
e.what()
|
||||
+ format(" : PropsSI(\"%s\",\"%s\",%0.10g,\"%s\",%0.10g,\"%s\")", Output.c_str(), Name1.c_str(), Prop1, Name2.c_str(), Prop2, FluidName.c_str()));
|
||||
set_error_string(e.what()
|
||||
+ format(" : PropsSI(\"%s\",\"%s\",%0.10g,\"%s\",%0.10g,\"%s\")", Output.c_str(), Name1.c_str(), Prop1, Name2.c_str(), Prop2,
|
||||
FluidName.c_str()));
|
||||
# if defined(PROPSSI_ERROR_STDOUT)
|
||||
std::cout << e.what() << std::endl;
|
||||
# endif
|
||||
|
||||
Reference in New Issue
Block a user