On Wed, Mar 10, 2010 at 11:14 PM, Priit Laes <plaes...@gmail.com> wrote: > Ühel kenal päeval, K, 2010-03-10 kell 15:08, kirjutas Brian Granger: >> Hi, >> >> I have improved the Piecewise class and implemented B-splines. Here >> is the branch on github: >> >> http://github.com/ellisonbg/sympy/tree/bg-piecewise > > +def bspline_basis(d, knots, n, x, close=True): > + """The n-th B-spline at x of degree d with knots. > + > + B-Splines are piecewise polynomials of degree d [1]. There are defined > on > > Maybe "They are ..." ? > > + a set of knots, which is a sequence of integers or floats. > > ... > > + It is quite time consuming to contruct and evaluate B-splines. If you > construct ---------------------------^^^ > + need to evaluate a B-splines many times, it is best to lambdify them > + first: > > ... > > + if d==0: > spaces maybe: d == 0 > + result = Piecewise( > + (S.One, Interval(knots[n], knots[n+1], False, True)), > + (0, True) > + ) > + elif d>0: > d > 0 seems a bit clearer than d>0. Unfortunately we do not have code > style manual :S
We do, we try to follow the python code style guildelines: http://www.python.org/dev/peps/pep-0008/ so there should be spaces around == and <. Thanks for the review Priit and the link to the github compnare, it's very interesting. Brian, why did you XFAILed this test: +...@xfail +def test_Liouville_ODE_xfail(): + eq4 = x*diff(f(x), x, x) + x/f(x)*diff(f(x), x)**2 + x*diff(f(x), x) + sol4 = [Eq(f(x), sqrt(C1 + C2*exp(-x))), Eq(f(x), -sqrt(C1 + C2*exp(-x)))] is it something that your code breaks? Ondrej -- You received this message because you are subscribed to the Google Groups "sympy-patches" group. To post to this group, send email to sympy-patc...@googlegroups.com. To unsubscribe from this group, send email to sympy-patches+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy-patches?hl=en.