#1956: implement multivariate power series arithmetic
-------------------------------------------+--------------------------------
Reporter: was | Owner: malb
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.6.1
Component: commutative algebra | Keywords: multivariate power
series
Author: Niles Johnson | Upstream: N/A
Reviewer: Martin Albrecht, Simon King | Merged:
Work_issues: |
-------------------------------------------+--------------------------------
Changes (by was):
* status: needs_review => needs_work
Comment:
Looking with my eyes... I found one bug not mentioned or fixed elsewhere:
{{{
733 except TypeError,AttributeError:
}}}
This should be
{{{
733 except (TypeError,AttributeError):
}}}
otherwise, AttributeError gets *set* to the string that the TypeError
raises. Do check for other cases of this issue in the code.
This scares me a little:
{{{
raise TypeError("action of "+c.parent()+" on "+f.parent()+" not defined.")
}}}
the reason is that any exception such that constructing a string as part
of it could take time, can potentially *MASSIVELY* slow down Sage. Just
do:
{{{
raise TypeError
}}}
or
{{{
raise TypeError, "action not defined"
}}}
instead. Since otherwise, constructing that string might dominate
arithmetic... (the coercion model will try to do the arithmetic, get the
error, then try something else). Also, it is easy enough using "%debug"
to see what all the relevant variables are when one gets an exception.
I see this also
{{{
1062 except:
}}}
I am against using naked excepts unless their is a very good reason to do
so.
I also think that whenever possible all the inputs to a function should be
documented. For example look at this one:
{{{
109 109 def completion(self, p, prec=20, extras=None):
110 """
111 Return the completion of self with respect to the
ideal generated
112 by the variable(s) ``p``.
113
114 INPUT:
115
116 - ``p`` -- variable or tuple of variables
117
118 EXAMPLES::
}}}
I think prec and extras should be documented. Especially important is
"extras", since that is not self-explanatory at all. There is also a
function {{{def solve_linear_de(self, prec = infinity, b=None, f0=None):
}}} with no docs on its input. Since it just does {{{raise
NotImplementedError}}} I think that's fine.
I don't like all this "type(obj)==type" stuff. I think
isinstance(obj,type) is much better:
{{{
140 if p in self or type(p) == str and
set(p).issubset(set([str(g) for g in self.gens()])):
141 p = tuple([p])
142 elif type(p) == list or type(p) == tuple:
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/1956#comment:51>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.