[sympy] DeprecationWarning beautification project

2012-04-18 Thread smichr
I am proposing a change to the warning handling for SymPyDeprecationWarning: OLD ``` >>> Integral(x).transform(x, u, inverse=True) sympy\integrals\integrals.py:411: SymPyDeprecationWarning: SymPyDeprecationWarni ng("The feature transform(x, f(x), inverse=True) is deprecated. Use transform(f (x)

Re: [sympy] DeprecationWarning beautification project

2012-04-18 Thread Joachim Durchholz
Am 18.04.2012 17:55, schrieb smichr: I am proposing a change to the warning handling for SymPyDeprecationWarning: The output sure looks better, what's the change in the code? -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, sen

Re: [sympy] DeprecationWarning beautification project

2012-04-18 Thread Chris Smith
On Wed, Apr 18, 2012 at 11:02 PM, Joachim Durchholz wrote: > Am 18.04.2012 17:55, schrieb smichr: >> >> I am proposing a change to the warning handling for >> SymPyDeprecationWarning: > > > The output sure looks better, what's the change in the code? > Just added a warn property: ``` @property +

Re: [sympy] DeprecationWarning beautification project

2012-04-18 Thread Tom Bachmann
Sure sounds good to me. Does not seem high priority, but surely cannot hurt either? On 18.04.2012 16:55, smichr wrote: I am proposing a change to the warning handling for SymPyDeprecationWarning: OLD ``` Integral(x).transform(x, u, inverse=True) sympy\integrals\integrals.py:411: SymPyDepre

Re: [sympy] DeprecationWarning beautification project

2012-04-18 Thread Joachim Durchholz
Am 18.04.2012 19:31, schrieb Chris Smith: So instead of doing ``` import warnings warnings.warn(SymPyDeprecationWarning(foo)) ``` you do ``` SymPyDeprecationWarning(foo).warn ``` That's what I was after. Looks nice :-) -- You received this message because you are subscribed to the Google Gr

Re: [sympy] DeprecationWarning beautification project

2012-04-18 Thread Ronan Lamy
Le mercredi 18 avril 2012 à 23:16 +0545, Chris Smith a écrit : > On Wed, Apr 18, 2012 at 11:02 PM, Joachim Durchholz > wrote: > > Am 18.04.2012 17:55, schrieb smichr: > >> > >> I am proposing a change to the warning handling for > >> SymPyDeprecationWarning: > > > > > > The output sure looks bett

Re: [sympy] DeprecationWarning beautification project

2012-04-18 Thread Aaron Meurer
I agree it's annoying that warnings are always printed twice, but I wonder if there's a good reason for it. On Wed, Apr 18, 2012 at 12:19 PM, Ronan Lamy wrote: > Le mercredi 18 avril 2012 à 23:16 +0545, Chris Smith a écrit : >> On Wed, Apr 18, 2012 at 11:02 PM, Joachim Durchholz >> wrote: >> >

Re: [sympy] DeprecationWarning beautification project

2012-04-18 Thread Chris Smith
On Thu, Apr 19, 2012 at 12:04 AM, Ronan Lamy wrote: > > Properties with side-effects are evil. They break introspection, making > e.g. graphical debuggers unusable. So this should definitely be a method > instead of a property. > will change > Also, forcing the import of all of sympy just to rai

Re: [sympy] DeprecationWarning beautification project

2012-04-19 Thread Ronan Lamy
Le mercredi 18 avril 2012 à 13:21 -0600, Aaron Meurer a écrit : > I agree it's annoying that warnings are always printed twice, but I > wonder if there's a good reason for it. > > On Wed, Apr 18, 2012 at 12:19 PM, Ronan Lamy wrote: > > > > Also, forcing the import of all of sympy just to raise a

Re: [sympy] DeprecationWarning beautification project

2012-04-19 Thread Joachim Durchholz
Am 19.04.2012 15:25, schrieb Ronan Lamy: I'm referring to sympy.utilities, which does import basically all of sympy.core. It's actually not as bad as I thought, but still seems quite dangerous for something as basic as a deprecation warning. What dangers do you mean? The ones I can think of ar

Re: [sympy] DeprecationWarning beautification project

2012-04-20 Thread Ronan Lamy
Le jeudi 19 avril 2012 à 19:05 +0200, Joachim Durchholz a écrit : > Am 19.04.2012 15:25, schrieb Ronan Lamy: > > I'm referring to sympy.utilities, which does import basically all of > > sympy.core. It's actually not as bad as I thought, but still seems quite > > dangerous for something as basic as

Re: [sympy] DeprecationWarning beautification project

2012-04-21 Thread Joachim Durchholz
Am 21.04.2012 00:20, schrieb Ronan Lamy: The danger I mentioned is that it increases the risk of circular imports. Getting an ImportError because of a warning is no fun, but that will happen to us if this gets in as is. More broadly, warnings tend to appear where you least expect them, so fiddlin

Re: [sympy] DeprecationWarning beautification project

2012-04-21 Thread Chris Smith
> The way to mitigate that would be to organize SymPy in layers, and disallow > importing high-layer code into low-layer code; if you need that, the > high-layer code probably didn't belong into the high layer in the first > place. I don't know how to do this but I've sure wished that this organiz

Re: [sympy] DeprecationWarning beautification project

2012-04-21 Thread Joachim Durchholz
Am 21.04.2012 10:38, schrieb Chris Smith: The way to mitigate that would be to organize SymPy in layers, and disallow importing high-layer code into low-layer code; if you need that, the high-layer code probably didn't belong into the high layer in the first place. I don't know how to do this b