[sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread Simon King
On 22 Aug., 04:37, Chris Seberino  wrote:
> ...
> sin (pi)    # rare,  sin(pi) more likely
> f (3, 4)    # rare,   f(3, 4) more likely

Likelihood is a not a good guideline, IMHO. I prefer rigour.

> What about a run level that parses "f (3, 4)" as implicit
> multiplication?

"3," is a tuple in Python:
  sage: 3,
  (3,)

Hence, when you write "f (3, 4)", do you really mean that *both* blank
spaces should trigger a multiplication? Do you really mean f
multiplied with the tuple (3,) multiplied with 4?

And even when you write "f (3,4)" (with only one blank space): Do you
really mean "expression f multiplied with tuple (3,4)"? What is the
product of an expression with a tuple?

Best regards,
Simon


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread v_2e
  Hello guys!
  Could you please explain me (and perhaps some of the other readers)
the reasons (or advantages) of using implicit multiplication at all?
  I mean in what situations it could be useful?

  Thanks
Vladimir


- 
 

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Matplotlib: An apparent error

2011-08-22 Thread Jason Grout

On 8/21/11 6:54 PM, William Stein wrote:


Obvious question: are you using exactly the same versions of numpy,
etc., in both of your tests?


Exactly.  We are currently behind the latest release of matplotlib.  Can 
you do this in both systems?


import matplotlib
print matplotlib.__version__

and report your results?  Please do the same for numpy as well.

Thanks,

Jason


--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: An integral solved by Mathematica, but not by Sage

2011-08-22 Thread kcrisman


On Aug 21, 5:26 am, achrzesz  wrote:
> sage: (integrate( exp(-x^2/2)/sqrt(2*pi) * sign(x-1), x, -oo, 1 )
> +integrate( exp(-x^2/2)/sqrt(2*pi) * sign(x-1), x, 1,
> oo )).simplify_full()
>
> -erf(1/2*sqrt(2))

Interesting that this "just works", and I guess it makes sense.
Still, hopefully we'll get #11483 resolved as well soon.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread Simon King
Hi Vladimir,

On 22 Aug., 12:05, v...@ukr.net wrote:
>   Hello guys!
>   Could you please explain me (and perhaps some of the other readers)
> the reasons (or advantages) of using implicit multiplication at all?
>   I mean in what situations it could be useful?

I don't know any advantage of implicit multiplication, and that's why
I wouldn't like to drop Python syntax for implicit multiplication's
sake. But apparently other people find it practical to be able to
write 2x instead of 2*x.

Cheers,
Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread Chris Seberino
On Aug 22, 12:52 am, Maarten Derickx 
wrote:
> I don't think your proposal will be an enhancement. For two reasons.
>
> 1. x (x) an x*(x) have the same amount of characters.

Some people prefer implicit multiplication.  It is already a feature
of Sage.

> 2. currently the python and sage expressions are not white space dependant.
> Your suggestion would introduce such a whitespace dependancy and will be
> very unexpected for a lot of people if they just happen to do something like
>  "sin (pi)".

Sage is already whitespace dependent when you turn on implicit
multiplication.

Thanks for info.  I posted on dev and will propose this as a new level
for discussion there.

cs

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread Chris Seberino


On Aug 22, 3:32 am, Simon King  wrote:
> On 22 Aug., 04:37, Chris Seberino  wrote:
>
> > ...
> > sin (pi)    # rare,  sin(pi) more likely
> > f (3, 4)    # rare,   f(3, 4) more likely
>
> Likelihood is a not a good guideline, IMHO. I prefer rigour.

Implicit multiplication is rigorous (or any remaining corner cases can
be made so).  Syntax is just interpreted differently.

> Hence, when you write "f (3, 4)", do you really mean that *both* blank
> spaces should trigger a multiplication? Do you really mean f
> multiplied with the tuple (3,) multiplied with 4?

I proposed this on dev and it didn't immediately get shot down as
crazy.  I am only proposing parsing
LETTER-WHITESPACE-LEFTPARENS" differently.  Hence "3, 4" would not be
affected.

 > And even when you write "f (3,4)" (with only one blank space): Do
you
> really mean "expression f multiplied with tuple (3,4)"? What is the
> product of an expression with a tuple?

In my proposal a function call with a space between the f and the
tuple would not be allowed.  Hence, your example would either give a
result if the product of f and (3, 4) made sense, or, an error.   That
would be rigorous and preferred IMHO.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread Chris Seberino
On Aug 22, 8:06 am, Simon King  wrote:
> But apparently other people find it practical to be able to
> write 2x instead of 2*x.

The preference comes from years of using Mathematica.  Also, I think a
space looks cleaner and it is easier to type (no shift needed! :).

Chris

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread v_2e
  Hello!

On Mon, 22 Aug 2011 07:43:28 -0700 (PDT)
Chris Seberino  wrote:

> On Aug 22, 8:06 am, Simon King  wrote:
> > But apparently other people find it practical to be able to
> > write 2x instead of 2*x.
> 
> The preference comes from years of using Mathematica.  Also, I think a
> space looks cleaner and it is easier to type (no shift needed! :).
> 
> Chris
> 
  It seems to me that interpreting the "f (x)" as "f*x" could easily
confuse the people who are new to Python and Sage. They will read (or
maybe have already read) some book on Python and the will try to apply
their new knowledge in Sage, but instead will find some strange
inexplicable (at first glance) behaviour.
  Wouldn't it be better to stick to Zen of Python rule #2 in this case?

"Explicit is better than implicit."

  The usage of Python as an interface language is one of the most
attractive thing about Sage. And many people expect to start using
Sage easily with their existing Python knowledge, I believe. So why
changing its default syntax (which is clear enough and easy to use by
itself) and disorientate people at their first steps?

 Regards,
Vladimir

- 
 

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread kcrisman


On Aug 22, 11:28 am, v...@ukr.net wrote:
>   Hello!
>
> On Mon, 22 Aug 2011 07:43:28 -0700 (PDT)
>
> Chris Seberino  wrote:
> > On Aug 22, 8:06 am, Simon King  wrote:
> > > But apparently other people find it practical to be able to
> > > write 2x instead of 2*x.
>
> > The preference comes from years of using Mathematica.  Also, I think a
> > space looks cleaner and it is easier to type (no shift needed! :).
>
> > Chris
>
>   It seems to me that interpreting the "f (x)" as "f*x" could easily
> confuse the people who are new to Python and Sage. They will read (or
> maybe have already read) some book on Python and the will try to apply
> their new knowledge in Sage, but instead will find some strange
> inexplicable (at first glance) behaviour.
>   Wouldn't it be better to stick to Zen of Python rule #2 in this case?
>
>         "Explicit is better than implicit."
>


I think in this case the point is not that this would be a default,
but an option that people who know about Python can use for certain
things they find easier this way.  I think the Mathematica
consideration is an important one as well - we have a few similar un-
Pythonic syntax things in the preparser because the syntax is that way
in Matlab.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Bayesian Reasoning and Machine Learning toolbox

2011-08-22 Thread samontab
I found a nice toolbox full of "routines for inference and learning in
graphical models and machine learning" available at
http://www.cs.ucl.ac.uk/staff/d.barber/brml
The draft of the book that explains all the details is also available
for download as of August 2011.

Maybe it will be of help to some of the Sage developers... the code is
for Matlab, compatible with octave, and released as GPL.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread Chris Seberino

On Aug 22, 10:28 am, v...@ukr.net wrote:
>   It seems to me that interpreting the "f (x)" as "f*x" could easily
> confuse the people who are new to Python and Sage. They will read (or
> maybe have already read) some book on Python and the will try to apply
> their new knowledge in Sage, but instead will find some strange
> inexplicable (at first glance) behaviour.
>   Wouldn't it be better to stick to Zen of Python rule #2 in this case?
>
>         "Explicit is better than implicit."

As kcrisman said, this would only be an option.
Also, I think "f(x)" is more explicit than "f (x)".
I never use "f (x)" in Python code and wonder why it is even allowed
in Python instead of raising an exception.

cs

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread William Stein
On Mon, Aug 22, 2011 at 10:23 AM, Chris Seberino  wrote:
>
> On Aug 22, 10:28 am, v...@ukr.net wrote:
>>   It seems to me that interpreting the "f (x)" as "f*x" could easily
>> confuse the people who are new to Python and Sage. They will read (or
>> maybe have already read) some book on Python and the will try to apply
>> their new knowledge in Sage, but instead will find some strange
>> inexplicable (at first glance) behaviour.
>>   Wouldn't it be better to stick to Zen of Python rule #2 in this case?
>>
>>         "Explicit is better than implicit."
>
> As kcrisman said, this would only be an option.
> Also, I think "f(x)" is more explicit than "f (x)".
>
> I never use "f (x)" in Python code and wonder why it is even allowed
> in Python instead of raising an exception.

Wow, that's almost as bad as "I didn't put any cheese on the eggs for
the vegan." which I just overheard hear at Sage Days 32 from the chef.

 -- William

>
> cs
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Figure

2011-08-22 Thread Santanu Sarkar
I generate the figure using Sage code.
In the figure I want to label y axis as $\beta\rightarrow$.
Is there any option for this in Sage?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


cprsa.eps
Description: PostScript document


Re: [sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread Robert Bradshaw
On Mon, Aug 22, 2011 at 6:06 AM, Simon King  wrote:
> Hi Vladimir,
>
> On 22 Aug., 12:05, v...@ukr.net wrote:
>>   Hello guys!
>>   Could you please explain me (and perhaps some of the other readers)
>> the reasons (or advantages) of using implicit multiplication at all?
>>   I mean in what situations it could be useful?
>
> I don't know any advantage of implicit multiplication, and that's why
> I wouldn't like to drop Python syntax for implicit multiplication's
> sake. But apparently other people find it practical to be able to
> write 2x instead of 2*x.

Or paste.

Personally, I found this handy when writing a lot of polynomials/power
series. When my brain was in "math mode" I kept getting interrupted by
syntax errors :).

As far as this proposal, we try to be very cautious when adding
anything to the preparser, and double cautious when changing the
meaning of valid Python syntax. With the exception of leading
whitespace for code blocks, Sage/Python is not whitespace sensitive.
Also, to throw my 2 cents in, "f (x)" looks like a function call to
me.

As for the OP's original deprecation warning, this was to fix the ambiguity of

sage: f = x^2
sage: g = t + 1
sage: h = f + g
sage: h(2, 3)


sage: z = f - x^2
sage: z(3)
BOOM

- Robert

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Figure

2011-08-22 Thread kcrisman
I can't see this figure immediately, but there is definitely an option
for labelling axes in normal plots.  See 
http://www.sagemath.org/doc/reference/sage/plot/plot.html
- there should be examples with "axes_labels", search for that term.
You can almost use your message as the code!

- kcrisman

On Aug 22, 1:54 pm, Santanu Sarkar 
wrote:
> I generate the figure using Sage code.
> In the figure I want to label y axis as $\beta\rightarrow$.
> Is there any option for this in Sage?
>
>  cprsa.eps
> 36KViewDownload

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org