From 7d9798fb9d73b94dfc32062deef2844e44b26fab Mon Sep 17 00:00:00 2001 From: Fruzsina Agocs Date: Fri, 3 Feb 2023 11:41:20 -0500 Subject: [PATCH 1/7] Adding latest mac os and windows to testing workflow --- .github/workflows/python-package.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 963b326..810c72d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -8,10 +8,16 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: python-version: [3.7, 3.8, 3.9] + os: ["ubuntu-latest"] + include: + - python-version: "3.9" + os: "macos-latest" + - python-version: "3.9" + os: "windows-latest" steps: - uses: actions/checkout@v2 From 429797c2b5fa6f9b33a8adf48bae3cebb691e280 Mon Sep 17 00:00:00 2001 From: Fruzsina Agocs Date: Fri, 3 Feb 2023 12:06:45 -0500 Subject: [PATCH 2/7] Windows compiler error fixing attempt --- include/solver.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/solver.hpp b/include/solver.hpp index 5cfc1c7..062f467 100644 --- a/include/solver.hpp +++ b/include/solver.hpp @@ -387,7 +387,7 @@ void Solution::solve(){ // std::cout << "All dense output points: " << std::endl; if(dotit!=dotimes.end()){ // std::cout << *dotit << std::endl; - while((*dotit-t>=0 && tnext-*dotit>=0) or (*dotit-t<=0 && tnext-*dotit<=0)){ + while((*dotit-t>=0 && tnext-*dotit>=0) || (*dotit-t<=0 && tnext-*dotit<=0)){ inner_dotimes.push_back(*dotit); dotit++; } From dc5fc861a4c053ac9eade7cce84d71b5ea912172 Mon Sep 17 00:00:00 2001 From: Fruzsina Agocs Date: Fri, 3 Feb 2023 12:17:45 -0500 Subject: [PATCH 3/7] More windows compiler errors --- include/solver.hpp | 86 +++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/include/solver.hpp b/include/solver.hpp index 062f467..5c246e6 100644 --- a/include/solver.hpp +++ b/include/solver.hpp @@ -109,7 +109,7 @@ a_tol, double h_0, const char* full_output){ // Determine direction of integration, fend>0 and integration ends when // it crosses zero - if((t>=tf) and h0<0){ + if((t>=tf) && h0<0){ // backwards fend = t-tf; fnext = fend; @@ -120,8 +120,8 @@ a_tol, double h_0, const char* full_output){ else sign = 0; - } - else if((t<=tf) and h0>0){ + }; + else if((t<=tf) && h0>0){ // forward fend = tf-t; fnext = fend; @@ -131,11 +131,11 @@ a_tol, double h_0, const char* full_output){ } else sign = 1; - } + }; else{ throw std::logic_error("Direction of integration in conflict with direction of initial step, terminating. Please check your values for ti, tf, and h."); return; - } + }; // No dense output desired if this constructor was called, so only output // answer at t_i and t_f @@ -196,32 +196,32 @@ a_tol, double h_0, const char* full_output){ // Determine direction of integration, fend>0 and integration ends when // it crosses zero - if((t>=tf) and h0<0){ + if((t>=tf) && h0<0){ // backwards fend = t-tf; fnext = fend; if(de_sys_->is_interpolated == 1){ de_sys_->Winterp.sign_ = 0; de_sys_->Ginterp.sign_ = 0; - } + }; else sign = 0; - } - else if((t<=tf) and h0>0){ + }; + else if((t<=tf) && h0>0){ // forward fend = tf-t; fnext = fend; if(de_sys_->is_interpolated == 1){ de_sys_->Winterp.sign_ = 1; de_sys_->Ginterp.sign_ = 1; - } + }; else sign = 1; - } + }; else{ throw std::logic_error("Direction of integration in conflict with direction of initial step, terminating. Please check your values for ti, tf, and h."); return; - } + }; // Dense output preprocessing: sort and reverse if necessary int dosize = do_times.size(); @@ -234,14 +234,14 @@ a_tol, double h_0, const char* full_output){ for(auto it=dotimes.begin(); it!=dotimes.end(); it++){ *it = *doit; doit++; - } + }; // Sort to ensure ascending order dotimes.sort(); // Reverse if necessary - if((de_sys_->is_interpolated == 1 and de_sys_->Winterp.sign_ == 0) or (de_sys_->is_interpolated == 0 and sign == 0)){ + if((de_sys_->is_interpolated == 1 && de_sys_->Winterp.sign_ == 0) || (de_sys_->is_interpolated == 0 && sign == 0)){ dotimes.reverse(); - } + }; dotit = dotimes.begin(); switch(order){ @@ -342,10 +342,10 @@ void Solution::solve(){ std::isnan(std::real(wkbx(1)))==false && std::isnan(std::imag(wkbx(1)))==false){ wkbdelta = std::max(1e-10, errmeasure_wkb.maxCoeff(&maxindex_wkb)); - } + }; else{ wkbdelta = std::numeric_limits::infinity(); - } + }; // predict next stepsize hrk = h*std::pow((1.0/rkdelta),1.0/nrk); @@ -356,10 +356,10 @@ void Solution::solve(){ // choose step with larger predicted stepsize if(std::abs(hwkb) >= std::abs(hrk)){ wkb = true; - } + }; else{ wkb = false; - } + }; if(wkb){ xnext = wkbx(0); dxnext = wkbx(1); @@ -367,7 +367,7 @@ void Solution::solve(){ // stepsize-increase wkbdelta = std::max(1e-10, errmeasure_wkb.tail(2).maxCoeff()); hnext = h*std::pow(1.0/wkbdelta,1.0/nwkb2); - } + }; else{ xnext = rkx(0); dxnext = rkx(1); @@ -379,8 +379,8 @@ void Solution::solve(){ std::cerr << "Warning: the solver took " << totsteps << " steps, and may take a while to converge." << std::endl; if(ssteps/totsteps < 0.05){ std::cerr << "Warning: the step acceptance ratio is below 5%, the solver may take a while to converge." << std::endl; - } - } + }; + }; // check if chosen step was successful if(std::abs(hnext)>=std::abs(h)){ @@ -390,7 +390,7 @@ void Solution::solve(){ while((*dotit-t>=0 && tnext-*dotit>=0) || (*dotit-t<=0 && tnext-*dotit<=0)){ inner_dotimes.push_back(*dotit); dotit++; - } + }; if(inner_dotimes.size() > 0){ inner_dosols.resize(inner_dotimes.size()); inner_dodsols.resize(inner_dotimes.size()); @@ -399,14 +399,14 @@ void Solution::solve(){ // std::cout << "Attempting " << inner_dosols.size() << " dense output points after successful WKB step from " << t << " to " << t+h << std::endl; wkbsolver->dense_step(t,inner_dotimes,inner_dosols,inner_dodsols); - } + }; else{ // Dense output after successful RK step for(auto it=inner_dotimes.begin(); it!=inner_dotimes.end(); it++) rksolver.dense_step(t,h,x,dx,inner_dotimes,inner_dosols,inner_dodsols); - } - } - } + }; + }; + }; auto inner_it=inner_dosols.begin(); auto inner_dit=inner_dodsols.begin(); while(inner_it!=inner_dosols.end() && it_dosol!=dosol.end() && inner_dit!=inner_dodsols.end() && it_dodsol!=dodsol.end()){ @@ -416,7 +416,7 @@ void Solution::solve(){ it_dosol++; inner_it++; inner_dit++; - } + }; inner_dotimes.resize(0); inner_dosols.resize(0); inner_dodsols.resize(0); @@ -426,11 +426,11 @@ void Solution::solve(){ wkbsteps +=1; wkbs.push_back(true); xvdm = wkbsolver->x_vdm; - } + }; else{ wkbs.push_back(false); xvdm = rksolver.x_vdm; - } + }; sol.push_back(xnext); dsol.push_back(dxnext); sol_vdm.push_back(xvdm); @@ -443,7 +443,7 @@ void Solution::solve(){ if(h>0){ fend=tf-t; fnext=tf-tnext; - } + }; else{ fend=t-tf; fnext=tnext-tf; @@ -453,10 +453,10 @@ void Solution::solve(){ if(de_sys_->is_interpolated == 1){ de_sys_->Winterp.update_interp_bounds(); de_sys_->Ginterp.update_interp_bounds(); - } + }; break; - } + }; else{ if(wkb){ if(maxindex_wkb<=1){ @@ -464,17 +464,17 @@ void Solution::solve(){ hnext = h*std::pow(1.0/wkbdelta,1.0/(nwkb1-1)); else hnext = 0.95*h*1.0/wkbdelta; - } + }; else hnext = h*std::pow(1.0/wkbdelta,1.0/(nwkb2-1)); - } + }; else hnext = h*std::pow(1.0/rkdelta,1.0/(nrk-1)); h = hnext; tnext = t + hnext; if(h>0){ fnext=tf-tnext; - } + }; else{ fnext=tnext-tf; }; @@ -502,7 +502,7 @@ void Solution::solve(){ ++it_x; ++it_dx; ++it_w; - } + }; // print all dense output to file int dosize = dosol.size(); auto it_dosol = dosol.begin(); @@ -513,10 +513,10 @@ void Solution::solve(){ ++it_dosol; ++it_dodsol; ++it_dotimes; - } + }; f.close(); - } + }; // If integrating backwards, reverse dense output (because it will have been // reversed at the start) @@ -524,14 +524,14 @@ void Solution::solve(){ if(de_sys_->Winterp.sign_ == 0){ dosol.reverse(); dodsol.reverse(); - } - } + }; + }; else{ if(sign == 0){ dosol.reverse(); dodsol.reverse(); - } - } + }; + }; }; From 793ac6bdf95d91f6e100507b4c8f2be6747d51cb Mon Sep 17 00:00:00 2001 From: Fruzsina Agocs Date: Fri, 3 Feb 2023 12:25:29 -0500 Subject: [PATCH 4/7] Undo semicolons --- include/solver.hpp | 100 ++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/include/solver.hpp b/include/solver.hpp index 5c246e6..031227c 100644 --- a/include/solver.hpp +++ b/include/solver.hpp @@ -70,7 +70,7 @@ class Solution // Experimental: list to contain continuous representation of the solution std::list,7,1>> sol_vdm; -}; +} /** Constructor for when dense output was not requested. Sets up solution of the * ODE. @@ -120,7 +120,7 @@ a_tol, double h_0, const char* full_output){ else sign = 0; - }; + } else if((t<=tf) && h0>0){ // forward fend = tf-t; @@ -131,11 +131,11 @@ a_tol, double h_0, const char* full_output){ } else sign = 1; - }; + } else{ throw std::logic_error("Direction of integration in conflict with direction of initial step, terminating. Please check your values for ti, tf, and h."); return; - }; + } // No dense output desired if this constructor was called, so only output // answer at t_i and t_f @@ -157,7 +157,7 @@ a_tol, double h_0, const char* full_output){ wkbsolver = &wkbsolver3; break; }; -}; +} /** Constructor for when dense output was requested. Sets up solution of the * ODE. @@ -203,10 +203,10 @@ a_tol, double h_0, const char* full_output){ if(de_sys_->is_interpolated == 1){ de_sys_->Winterp.sign_ = 0; de_sys_->Ginterp.sign_ = 0; - }; + } else sign = 0; - }; + } else if((t<=tf) && h0>0){ // forward fend = tf-t; @@ -214,14 +214,14 @@ a_tol, double h_0, const char* full_output){ if(de_sys_->is_interpolated == 1){ de_sys_->Winterp.sign_ = 1; de_sys_->Ginterp.sign_ = 1; - }; + } else sign = 1; - }; + } else{ throw std::logic_error("Direction of integration in conflict with direction of initial step, terminating. Please check your values for ti, tf, and h."); return; - }; + } // Dense output preprocessing: sort and reverse if necessary int dosize = do_times.size(); @@ -234,14 +234,14 @@ a_tol, double h_0, const char* full_output){ for(auto it=dotimes.begin(); it!=dotimes.end(); it++){ *it = *doit; doit++; - }; + } // Sort to ensure ascending order dotimes.sort(); // Reverse if necessary if((de_sys_->is_interpolated == 1 && de_sys_->Winterp.sign_ == 0) || (de_sys_->is_interpolated == 0 && sign == 0)){ dotimes.reverse(); - }; + } dotit = dotimes.begin(); switch(order){ @@ -255,7 +255,7 @@ a_tol, double h_0, const char* full_output){ wkbsolver = &wkbsolver3; break; }; -}; +} /** \brief Function to solve the ODE \f$ \ddot{x} + 2\gamma(t)\dot{x} + * \omega^2(t)x = 0 \f$ for \f$ x(t), \frac{dx}{dt} \f$. @@ -307,7 +307,7 @@ void Solution::solve(){ if(fnext < 0){ h = tf - t; tnext = tf; - }; + } // Keep updating stepsize until step is accepted while(true){ @@ -342,10 +342,10 @@ void Solution::solve(){ std::isnan(std::real(wkbx(1)))==false && std::isnan(std::imag(wkbx(1)))==false){ wkbdelta = std::max(1e-10, errmeasure_wkb.maxCoeff(&maxindex_wkb)); - }; + } else{ wkbdelta = std::numeric_limits::infinity(); - }; + } // predict next stepsize hrk = h*std::pow((1.0/rkdelta),1.0/nrk); @@ -356,10 +356,10 @@ void Solution::solve(){ // choose step with larger predicted stepsize if(std::abs(hwkb) >= std::abs(hrk)){ wkb = true; - }; + } else{ wkb = false; - }; + } if(wkb){ xnext = wkbx(0); dxnext = wkbx(1); @@ -367,20 +367,20 @@ void Solution::solve(){ // stepsize-increase wkbdelta = std::max(1e-10, errmeasure_wkb.tail(2).maxCoeff()); hnext = h*std::pow(1.0/wkbdelta,1.0/nwkb2); - }; + } else{ xnext = rkx(0); dxnext = rkx(1); hnext = hrk; - }; + } totsteps += 1; // Checking for too many steps and low acceptance ratio: if(totsteps % 5000 == 0){ std::cerr << "Warning: the solver took " << totsteps << " steps, and may take a while to converge." << std::endl; if(ssteps/totsteps < 0.05){ std::cerr << "Warning: the step acceptance ratio is below 5%, the solver may take a while to converge." << std::endl; - }; - }; + } + } // check if chosen step was successful if(std::abs(hnext)>=std::abs(h)){ @@ -390,7 +390,7 @@ void Solution::solve(){ while((*dotit-t>=0 && tnext-*dotit>=0) || (*dotit-t<=0 && tnext-*dotit<=0)){ inner_dotimes.push_back(*dotit); dotit++; - }; + } if(inner_dotimes.size() > 0){ inner_dosols.resize(inner_dotimes.size()); inner_dodsols.resize(inner_dotimes.size()); @@ -399,14 +399,14 @@ void Solution::solve(){ // std::cout << "Attempting " << inner_dosols.size() << " dense output points after successful WKB step from " << t << " to " << t+h << std::endl; wkbsolver->dense_step(t,inner_dotimes,inner_dosols,inner_dodsols); - }; + } else{ // Dense output after successful RK step for(auto it=inner_dotimes.begin(); it!=inner_dotimes.end(); it++) rksolver.dense_step(t,h,x,dx,inner_dotimes,inner_dosols,inner_dodsols); - }; - }; - }; + } + } + } auto inner_it=inner_dosols.begin(); auto inner_dit=inner_dodsols.begin(); while(inner_it!=inner_dosols.end() && it_dosol!=dosol.end() && inner_dit!=inner_dodsols.end() && it_dodsol!=dodsol.end()){ @@ -416,7 +416,7 @@ void Solution::solve(){ it_dosol++; inner_it++; inner_dit++; - }; + } inner_dotimes.resize(0); inner_dosols.resize(0); inner_dodsols.resize(0); @@ -426,11 +426,11 @@ void Solution::solve(){ wkbsteps +=1; wkbs.push_back(true); xvdm = wkbsolver->x_vdm; - }; + } else{ wkbs.push_back(false); xvdm = rksolver.x_vdm; - }; + } sol.push_back(xnext); dsol.push_back(dxnext); sol_vdm.push_back(xvdm); @@ -443,20 +443,20 @@ void Solution::solve(){ if(h>0){ fend=tf-t; fnext=tf-tnext; - }; + } else{ fend=t-tf; fnext=tnext-tf; - }; + } ssteps +=1; // Update interpolation bounds if(de_sys_->is_interpolated == 1){ de_sys_->Winterp.update_interp_bounds(); de_sys_->Ginterp.update_interp_bounds(); - }; + } break; - }; + } else{ if(wkb){ if(maxindex_wkb<=1){ @@ -464,23 +464,23 @@ void Solution::solve(){ hnext = h*std::pow(1.0/wkbdelta,1.0/(nwkb1-1)); else hnext = 0.95*h*1.0/wkbdelta; - }; + } else hnext = h*std::pow(1.0/wkbdelta,1.0/(nwkb2-1)); - }; + } else hnext = h*std::pow(1.0/rkdelta,1.0/(nrk-1)); h = hnext; tnext = t + hnext; if(h>0){ fnext=tf-tnext; - }; + } else{ fnext=tnext-tf; - }; - }; - }; - }; + } + } + } + } // Write output to file if prompted if(not (*fo==0)){ @@ -502,7 +502,7 @@ void Solution::solve(){ ++it_x; ++it_dx; ++it_w; - }; + } // print all dense output to file int dosize = dosol.size(); auto it_dosol = dosol.begin(); @@ -513,10 +513,10 @@ void Solution::solve(){ ++it_dosol; ++it_dodsol; ++it_dotimes; - }; + } f.close(); - }; + } // If integrating backwards, reverse dense output (because it will have been // reversed at the start) @@ -524,14 +524,14 @@ void Solution::solve(){ if(de_sys_->Winterp.sign_ == 0){ dosol.reverse(); dodsol.reverse(); - }; - }; + } + } else{ if(sign == 0){ dosol.reverse(); - dodsol.reverse(); - }; - }; + dodsol.reverse() + } + } -}; +} From 546e9ee82f56cd33bad5c78b11c9f15ee3bc8f04 Mon Sep 17 00:00:00 2001 From: Fruzsina Agocs Date: Fri, 3 Feb 2023 12:41:14 -0500 Subject: [PATCH 5/7] Fix introduced compiler errors --- include/solver.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/solver.hpp b/include/solver.hpp index 031227c..ded4d1e 100644 --- a/include/solver.hpp +++ b/include/solver.hpp @@ -70,7 +70,7 @@ class Solution // Experimental: list to contain continuous representation of the solution std::list,7,1>> sol_vdm; -} +}; /** Constructor for when dense output was not requested. Sets up solution of the * ODE. @@ -157,7 +157,7 @@ a_tol, double h_0, const char* full_output){ wkbsolver = &wkbsolver3; break; }; -} +}; /** Constructor for when dense output was requested. Sets up solution of the * ODE. @@ -255,7 +255,7 @@ a_tol, double h_0, const char* full_output){ wkbsolver = &wkbsolver3; break; }; -} +}; /** \brief Function to solve the ODE \f$ \ddot{x} + 2\gamma(t)\dot{x} + * \omega^2(t)x = 0 \f$ for \f$ x(t), \frac{dx}{dt} \f$. @@ -529,9 +529,9 @@ void Solution::solve(){ else{ if(sign == 0){ dosol.reverse(); - dodsol.reverse() + dodsol.reverse(); } } -} +}; From b12b143359231195746e8bcb84b4259271757ac4 Mon Sep 17 00:00:00 2001 From: Fruzsina Agocs Date: Fri, 3 Feb 2023 12:47:16 -0500 Subject: [PATCH 6/7] Trying to fix more win compiler errors --- include/solver.hpp | 2 +- pyoscode/_pyoscode.cpp | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/solver.hpp b/include/solver.hpp index ded4d1e..4765bb4 100644 --- a/include/solver.hpp +++ b/include/solver.hpp @@ -483,7 +483,7 @@ void Solution::solve(){ } // Write output to file if prompted - if(not (*fo==0)){ + if(!(*fo==0)){ std::string output(fo); std::ofstream f; f.open(output); diff --git a/pyoscode/_pyoscode.cpp b/pyoscode/_pyoscode.cpp index 2317a49..7becac4 100644 --- a/pyoscode/_pyoscode.cpp +++ b/pyoscode/_pyoscode.cpp @@ -39,7 +39,7 @@ static std::complex wfun(double t){ if(py_result == NULL) return NULL; // Check if return value was the correct type (complex) - if(PyComplex_Check(py_result) or PyFloat_Check(py_result)){ + if(PyComplex_Check(py_result) || PyFloat_Check(py_result)){ result = std::complex(PyComplex_RealAsDouble(py_result), PyComplex_ImagAsDouble(py_result)); } Py_DECREF(py_result); @@ -57,7 +57,7 @@ static std::complex gfun(double t){ if(py_result == NULL) return NULL; // Check if return value was the correct type (complex) - if(PyComplex_Check(py_result) or PyFloat_Check(py_result)) + if(PyComplex_Check(py_result) || PyFloat_Check(py_result)) result = std::complex(PyComplex_RealAsDouble(py_result), PyComplex_ImagAsDouble(py_result)); Py_DECREF(py_result); return result; @@ -118,15 +118,15 @@ static PyObject *_pyoscode_solve_fn(PyObject *self, PyObject *args, PyObject *kw if(t_evalsize!=0){ if(std::is_sorted(t_evallist.begin(), t_evallist.end()) == false) throw "The points at which dense output is requested are not in ascending order."; - else if(h0>0 and (t_evallist.front() < ti or t_evallist.back() > tf)){ + else if(h0>0 && (t_evallist.front() < ti || t_evallist.back() > tf)){ throw "The point at which dense output is requested must lie in the integration range (between ti, tf)."; } - else if(h0<0 and (t_evallist.front() < tf or t_evallist.back() > ti)){ + else if(h0<0 && (t_evallist.front() < tf || t_evallist.back() > ti)){ throw "The point at which dense output is requested must lie in the integration range (between ti, tf)."; } } // Check: direction of integration must match initial stepsize sign - if( ((tf-ti)>0 and h0<0) or ((tf-ti)<0 and h0>0) ) + if( ((tf-ti)>0 && h0<0) || ((tf-ti)<0 && h0>0) ) throw "Direction of integration ( tf-ti ) in conflict with sign of initial step (h)."; } catch(const char* errormsg){ @@ -245,7 +245,7 @@ static PyObject *_pyoscode_solve(PyObject *self, PyObject *args, PyObject *kwarg t_evalarray = PyArray_FROM_OTF(t_evalobj, NPY_DOUBLE, NPY_ARRAY_IN_ARRAY); } // If that didn't work, throw an exception - if(tsarray==NULL or wsarray==NULL or gsarray==NULL){ + if(tsarray==NULL || wsarray==NULL || gsarray==NULL){ Py_XDECREF(tsarray); Py_XDECREF(wsarray); Py_XDECREF(gsarray); @@ -284,7 +284,7 @@ static PyObject *_pyoscode_solve(PyObject *self, PyObject *args, PyObject *kwarg try{ // Check 1: same size arrays, large enough arrays - if(tssize != wssize or wssize != gssize or tssize != gssize) + if(tssize != wssize || wssize != gssize || tssize != gssize) throw "The sizes of the input arrays (ts, ws, gs) do not match. Please supply arrays of the same size."; else if(tssize < 2) throw "The input arrays (ts, ws, gs) have to have at least size 2."; @@ -302,9 +302,9 @@ static PyObject *_pyoscode_solve(PyObject *self, PyObject *args, PyObject *kwarg } // Check 3: integration limits ti, tf must lie inside ts - if(ti < ts[0] or ti > ts[tssize-1]) + if(ti < ts[0] || ti > ts[tssize-1]) throw "The start of integration, ti, must lie inside the array ts."; - else if(tf < ts[0] or tf > ts[tssize-1]) + else if(tf < ts[0] || tf > ts[tssize-1]) throw "The end of integration, tf, must lie inside of the array ts."; // Check 4: dense output points must be inside integration range, and @@ -312,15 +312,15 @@ static PyObject *_pyoscode_solve(PyObject *self, PyObject *args, PyObject *kwarg if(t_evalsize!=0){ if(std::is_sorted(t_evallist.begin(), t_evallist.end()) == false) throw "The points at which dense output is requested are not in ascending order."; - else if(h0>0 and (t_evallist.front() < ti or t_evallist.back() > tf)){ + else if(h0>0 && (t_evallist.front() < ti || t_evallist.back() > tf)){ throw "The point at which dense output is requested must lie in the integration range (between ti, tf)."; } - else if(h0<0 and (t_evallist.front() < tf or t_evallist.back() > ti)){ + else if(h0<0 && (t_evallist.front() < tf || t_evallist.back() > ti)){ throw "The point at which dense output is requested must lie in the integration range (between ti, tf)."; } } // Check 5: direction of integration must match initial stepsize sign - if( ((tf-ti)>0 and h0<0) or ((tf-ti)<0 and h0>0) ) + if( ((tf-ti)>0 && h0<0) || ((tf-ti)<0 && h0>0) ) throw "Direction of integration ( tf-ti ) in conflict with sign of initial step (h)."; } From ea651e4515abf104711f69ea0f0aaa42285298c7 Mon Sep 17 00:00:00 2001 From: Fruzsina Agocs Date: Fri, 3 Feb 2023 14:06:42 -0500 Subject: [PATCH 7/7] Update version number --- README.rst | 2 ++ setup.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2ee129e..bca8152 100644 --- a/README.rst +++ b/README.rst @@ -259,6 +259,8 @@ devs of `exhale `__ for making the beautiful C Changelog --------- +- 1.1.1: + - Support for mac and Windows OS at CI. - 1.1.0: - Users can now define w, g as functions in Python (pyoscode) and call the solver via pyoscode.solve_fn(...) - 1.0.6: diff --git a/setup.py b/setup.py index bc50be0..f9a75c6 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ def readme(short=False): setup( name="pyoscode", - version="1.1.0", + version="1.1.1", description=readme(short=True), long_description=readme(), url="https://github.com/fruzsinaagocs/oscode",