Re: [sage-devel] Re: Mechanism to choose NamedConvertMap as coercion map?

2017-12-18 Thread Jeroen Demeyer

On 2017-12-18 18:31, Simon King wrote:

One way to answer the question whether a coercion from A to B exists is
by implementing the method B._coerce_map_from_.


Right, I was asking the question because I need to implement such a 
method for RIF and CIF.



If that method returns "True" then the coercion system knows that
it is right to choose _real_mpfi_() for coercion.


1. Check for a coercion map.

2. If coercion is possible, check for a NamedConvertMap. If so, use that
instead.


No. If there is a coercion map, then (by definition) coercion is possible,
and the coercion map is cached. So, do not use something else instead.


I think it should be the other way around: if a _real_mpfi_() method 
exists, it should always be picked as conversion map. The existence of 
that method means that somebody explicitly implemented a specific 
conversion to RIF. So any other map that the coercion framework can come 
up with cannot be as good as this NamedConvertMap using _real_mpfi_().


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread PHPirate
Thanks for the replies, so I would be very interested to run vim or emacs 
on Windows (although I have never heard of any windows user doing so) but 
since you both run a different OS you may not know how to set this up on 
Windows?
I'll try in any case later on, I think I should open a separate topic for 
that I guess? 

For now, I found some tips at https://wiki.sagemath.org/Tips about usage 
with vim, and a couple of vim plugins 
like https://github.com/petRUShka/vim-sage but no complete installation 
guide. Is there one? If not, if I manage to get it work I will write one 
myself then. 
I really hope I will manage to run Sage scripts from within vim, as the 
wiki hints is possible!

In any case, conclusion for this topic: don't use PyCharm, try vim (or if 
you want, emacs or atom or whatever) instead.

Let me quote Martin Vahi...
"As a side note I say that I've noticed that software developers, me myself 
included, are usually not as good at math as they _should_ and pure 
mathematicians tend to be at software development not as good as they 
could. That seems to explain a lot of things in this world. :-D"

On Monday, December 18, 2017 at 10:25:14 PM UTC+1, Dima Pasechnik wrote:
>
>
>
> On Monday, December 18, 2017 at 8:20:18 PM UTC, David Roe wrote:
>>
>>
>>
>> On Mon, Dec 18, 2017 at 8:55 AM, PHPirate  wrote:
>>
>>> Thanks, that sounds a bit too difficult for me though so I'll just stick 
>>> to writing in PyCharm and try to execute my Sage files via the Sage shell.
>>>
>>> But out of curiosity, am I the only one wanting to write scripts in 
>>> Sage? Or are there other people using editors in the same way?
>>>
>>
>> I think many people write scripts for Sage, though much of that 
>> development isn't happening on Windows.  Personally, I use emacs on OS X.
>>
>
> I use vim on Linux (as well as, if needed, on OSX and on FreeBSD). Surely 
> it does syntax highlighting for Python/Cython
> and with a small effort for Sage (as it's basically Python, language-wise) 
> too...
>
> I know people using atom for the same purpose (and yes, emacs for sure).
>
> Vim and emacs run, natively, on Windows. IMHO Notepad is the last resort...
>   
>
>> David
>>  
>>
>>>
>>> On Monday, December 18, 2017 at 5:42:50 PM UTC+1, Erik Bray wrote:

 On Mon, Dec 18, 2017 at 5:37 PM, PHPirate  
 wrote: 
 > Hm, it is at least worth a try (just saw your message on GH) Okay I 
 can 
 > understand if Sage has no syntax highlighting in any IDE on Windows, 
 but as 
 > the situation is now for me, is that there is no IDE in which you can 
 type 
 > Sage and then hit 'run' and then get Sage output. Now I think I could 
 write 
 > Sage in Notepad and then execute a Sage file via the Sage shell but 
 I'm 
 > looking to shortcut that a bit (my expectations are quite lower now I 
 know 
 > that Sage doesn't have a standard editor which everyone uses). 
 > 
 > But is it a bad idea to write Sage scripts? Did I misunderstand 
 something, 
 > and should I use the console only? 

 It's not at all a bad idea; it's just that if you want correct syntax 
 highlighting for it you'll have to use an editor for which there is 
 syntax highlighting support for Sage, or add it yourself to your 
 editor of choice.  Certainly there's no reason to use notepad 
 regardless.  It's just that different editors have different means of 
 providing syntax highlighting for new languages (where Sage's syntax 
 is just a small superset over pure Python syntax). 

 More importantly, the default Python interpreter also isn't going to 
 know how to execute a Sage script, though it seems that in PyCharm 
 it's probably possible to configure the necessary options to pre-load 
 the Sage syntax parser and then pass it a .sage script, but I haven't 
 tried it yet. 

 > On Monday, December 18, 2017 at 2:06:09 PM UTC+1, Erik Bray wrote: 
 >> 
 >> That sounds a bit bogus to me.  I've never used PyCharm before and 
 don't 
 >> know how it works, but I suspect it could be made to work with 
 Cygwin's 
 >> Python.  It's pretty low-priority for me though.  I don't see how 
 using 
 >> PyCharm to edit sage source code would be useful--it won't even do 
 syntax 
 >> highlighting properly, unless I'm missing something. 
 >> 
 >> On Saturday, December 16, 2017 at 2:01:08 PM UTC+1, Dima Pasechnik 
 wrote: 
 >>> 
 >>> I've already expalined here 
 >>> https://github.com/sagemath/sage-windows/issues/12 that PyCharm 
 doesn't 
 >>> support Cygwin Python, 
 >>> and thus it's not going to be trivial to fix. The reason that we 
 must use 
 >>> Cygwin Python is that a number of essential Sage components (i.e. 
 Python 
 >>> extensions you need) e.g. GAP, won't work natively on Windows, as 
 they use 
 >>> fork() and other Unix/Posix specific system functi

[sage-devel] Fwd: [IPython-dev] display of dicts?

2017-12-18 Thread William Stein
Relevant to recent discussion on sage-devel...

Forwarded conversation
Subject: [IPython-dev] display of dicts?


From: Chris Barker 
Date: Mon, Dec 18, 2017 at 5:08 PM
To: ipython-...@python.org


As Guido has just declared that dicts will now officially preserve order:

https://mail.python.org/pipermail/python-dev/2017-December/151283.html

I was playing around  them in py3.6 ipython, and found some (to me) odd
behavior:

In [1]: d = {'one':1, 'two':2, 'three':3}

In [2]: d
Out[2]: {'one': 1, 'three': 3, 'two': 2}

Hmm -- order does not appear to be preserved.

But then:

In [3]: str(d)
Out[3]: "{'one': 1, 'two': 2, 'three': 3}"

In [4]: repr(d)
Out[4]: "{'one': 1, 'two': 2, 'three': 3}"

In [5]: d.values()
Out[5]: dict_values([1, 2, 3])

In [6]: d.keys()
Out[6]: dict_keys(['one', 'two', 'three'])

In [7]: d.items()
Out[7]: dict_items([('one', 1), ('two', 2), ('three', 3)])

Order IS preserved.

So presumably iPython is calling sorted() or some such when displaying a
dict.

Is that that case? Is that documented anywhere?? I can't find it.

And with Python >= 3.6, dict order is preserved, so it would probably be
better to NOT mess with dict order when displaying them in iPython.

SIDE NOTE:

I had a bit of trouble finding this mailing list -- google still points to
the old ones on scipy.org. -- maybe we can put a note on the home page of
those lists that they are been moved??

(I only noticed, 'cause the archives of those stop last March)

-Chris





-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

___
IPython-dev mailing list
ipython-...@python.org
https://mail.python.org/mailman/listinfo/ipython-dev


--
From: Nathan Goldbaum 
Date: Mon, Dec 18, 2017 at 5:40 PM
To: IPython Community list 


IPython does use pretty-printing by default. You can control it with the
%pprint magic, in your IPython configuration, with the
PlainTextFormatter.pprint option, or with the --pprint command line
argument when starting IPython.

http://ipython.readthedocs.io/en/stable/config/options/
terminal.html#configtrait-PlainTextFormatter.pprint



___
> IPython-dev mailing list
> ipython-...@python.org
> https://mail.python.org/mailman/listinfo/ipython-dev
>
>

___
IPython-dev mailing list
ipython-...@python.org
https://mail.python.org/mailman/listinfo/ipython-dev





-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread Dima Pasechnik


On Monday, December 18, 2017 at 8:20:18 PM UTC, David Roe wrote:
>
>
>
> On Mon, Dec 18, 2017 at 8:55 AM, PHPirate  > wrote:
>
>> Thanks, that sounds a bit too difficult for me though so I'll just stick 
>> to writing in PyCharm and try to execute my Sage files via the Sage shell.
>>
>> But out of curiosity, am I the only one wanting to write scripts in Sage? 
>> Or are there other people using editors in the same way?
>>
>
> I think many people write scripts for Sage, though much of that 
> development isn't happening on Windows.  Personally, I use emacs on OS X.
>

I use vim on Linux (as well as, if needed, on OSX and on FreeBSD). Surely 
it does syntax highlighting for Python/Cython
and with a small effort for Sage (as it's basically Python, language-wise) 
too...

I know people using atom for the same purpose (and yes, emacs for sure).

Vim and emacs run, natively, on Windows. IMHO Notepad is the last resort...
  

> David
>  
>
>>
>> On Monday, December 18, 2017 at 5:42:50 PM UTC+1, Erik Bray wrote:
>>>
>>> On Mon, Dec 18, 2017 at 5:37 PM, PHPirate  wrote: 
>>> > Hm, it is at least worth a try (just saw your message on GH) Okay I 
>>> can 
>>> > understand if Sage has no syntax highlighting in any IDE on Windows, 
>>> but as 
>>> > the situation is now for me, is that there is no IDE in which you can 
>>> type 
>>> > Sage and then hit 'run' and then get Sage output. Now I think I could 
>>> write 
>>> > Sage in Notepad and then execute a Sage file via the Sage shell but 
>>> I'm 
>>> > looking to shortcut that a bit (my expectations are quite lower now I 
>>> know 
>>> > that Sage doesn't have a standard editor which everyone uses). 
>>> > 
>>> > But is it a bad idea to write Sage scripts? Did I misunderstand 
>>> something, 
>>> > and should I use the console only? 
>>>
>>> It's not at all a bad idea; it's just that if you want correct syntax 
>>> highlighting for it you'll have to use an editor for which there is 
>>> syntax highlighting support for Sage, or add it yourself to your 
>>> editor of choice.  Certainly there's no reason to use notepad 
>>> regardless.  It's just that different editors have different means of 
>>> providing syntax highlighting for new languages (where Sage's syntax 
>>> is just a small superset over pure Python syntax). 
>>>
>>> More importantly, the default Python interpreter also isn't going to 
>>> know how to execute a Sage script, though it seems that in PyCharm 
>>> it's probably possible to configure the necessary options to pre-load 
>>> the Sage syntax parser and then pass it a .sage script, but I haven't 
>>> tried it yet. 
>>>
>>> > On Monday, December 18, 2017 at 2:06:09 PM UTC+1, Erik Bray wrote: 
>>> >> 
>>> >> That sounds a bit bogus to me.  I've never used PyCharm before and 
>>> don't 
>>> >> know how it works, but I suspect it could be made to work with 
>>> Cygwin's 
>>> >> Python.  It's pretty low-priority for me though.  I don't see how 
>>> using 
>>> >> PyCharm to edit sage source code would be useful--it won't even do 
>>> syntax 
>>> >> highlighting properly, unless I'm missing something. 
>>> >> 
>>> >> On Saturday, December 16, 2017 at 2:01:08 PM UTC+1, Dima Pasechnik 
>>> wrote: 
>>> >>> 
>>> >>> I've already expalined here 
>>> >>> https://github.com/sagemath/sage-windows/issues/12 that PyCharm 
>>> doesn't 
>>> >>> support Cygwin Python, 
>>> >>> and thus it's not going to be trivial to fix. The reason that we 
>>> must use 
>>> >>> Cygwin Python is that a number of essential Sage components (i.e. 
>>> Python 
>>> >>> extensions you need) e.g. GAP, won't work natively on Windows, as 
>>> they use 
>>> >>> fork() and other Unix/Posix specific system functions. 
>>> >>> 
>>> >>> On Saturday, December 16, 2017 at 12:19:56 PM UTC, PHPirate wrote: 
>>>  
>>>  Thanks, it sounds reasonable. But do you mean the Jupyter notebook 
>>>  included with Sage, which you can start with 
>>>  sage --notebook ipython 
>>>  from the Sage shell? I do not like notebooks such as this one and 
>>>  Mathematica because they do not go well with a VCS. Is it then 
>>> possible to 
>>>  use this Jupyter to edit and run Sage files saved in a better way, 
>>> like 
>>>  python files? 
>>> > 
>>> > -- 
>>> > You received this message because you are subscribed to the Google 
>>> Groups 
>>> > "sage-devel" group. 
>>> > To unsubscribe from this group and stop receiving emails from it, send 
>>> an 
>>> > email to sage-devel+...@googlegroups.com. 
>>> > To post to this group, send email to sage-...@googlegroups.com. 
>>> > Visit this group at https://groups.google.com/group/sage-devel. 
>>> > For more options, visit https://groups.google.com/d/optout. 
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com .
>> To post to this group, send email to sage-...@googleg

Re: [sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread David Roe
On Mon, Dec 18, 2017 at 8:55 AM, PHPirate  wrote:

> Thanks, that sounds a bit too difficult for me though so I'll just stick
> to writing in PyCharm and try to execute my Sage files via the Sage shell.
>
> But out of curiosity, am I the only one wanting to write scripts in Sage?
> Or are there other people using editors in the same way?
>

I think many people write scripts for Sage, though much of that development
isn't happening on Windows.  Personally, I use emacs on OS X.
David


>
> On Monday, December 18, 2017 at 5:42:50 PM UTC+1, Erik Bray wrote:
>>
>> On Mon, Dec 18, 2017 at 5:37 PM, PHPirate  wrote:
>> > Hm, it is at least worth a try (just saw your message on GH) Okay I can
>> > understand if Sage has no syntax highlighting in any IDE on Windows,
>> but as
>> > the situation is now for me, is that there is no IDE in which you can
>> type
>> > Sage and then hit 'run' and then get Sage output. Now I think I could
>> write
>> > Sage in Notepad and then execute a Sage file via the Sage shell but I'm
>> > looking to shortcut that a bit (my expectations are quite lower now I
>> know
>> > that Sage doesn't have a standard editor which everyone uses).
>> >
>> > But is it a bad idea to write Sage scripts? Did I misunderstand
>> something,
>> > and should I use the console only?
>>
>> It's not at all a bad idea; it's just that if you want correct syntax
>> highlighting for it you'll have to use an editor for which there is
>> syntax highlighting support for Sage, or add it yourself to your
>> editor of choice.  Certainly there's no reason to use notepad
>> regardless.  It's just that different editors have different means of
>> providing syntax highlighting for new languages (where Sage's syntax
>> is just a small superset over pure Python syntax).
>>
>> More importantly, the default Python interpreter also isn't going to
>> know how to execute a Sage script, though it seems that in PyCharm
>> it's probably possible to configure the necessary options to pre-load
>> the Sage syntax parser and then pass it a .sage script, but I haven't
>> tried it yet.
>>
>> > On Monday, December 18, 2017 at 2:06:09 PM UTC+1, Erik Bray wrote:
>> >>
>> >> That sounds a bit bogus to me.  I've never used PyCharm before and
>> don't
>> >> know how it works, but I suspect it could be made to work with
>> Cygwin's
>> >> Python.  It's pretty low-priority for me though.  I don't see how
>> using
>> >> PyCharm to edit sage source code would be useful--it won't even do
>> syntax
>> >> highlighting properly, unless I'm missing something.
>> >>
>> >> On Saturday, December 16, 2017 at 2:01:08 PM UTC+1, Dima Pasechnik
>> wrote:
>> >>>
>> >>> I've already expalined here
>> >>> https://github.com/sagemath/sage-windows/issues/12 that PyCharm
>> doesn't
>> >>> support Cygwin Python,
>> >>> and thus it's not going to be trivial to fix. The reason that we must
>> use
>> >>> Cygwin Python is that a number of essential Sage components (i.e.
>> Python
>> >>> extensions you need) e.g. GAP, won't work natively on Windows, as
>> they use
>> >>> fork() and other Unix/Posix specific system functions.
>> >>>
>> >>> On Saturday, December 16, 2017 at 12:19:56 PM UTC, PHPirate wrote:
>> 
>>  Thanks, it sounds reasonable. But do you mean the Jupyter notebook
>>  included with Sage, which you can start with
>>  sage --notebook ipython
>>  from the Sage shell? I do not like notebooks such as this one and
>>  Mathematica because they do not go well with a VCS. Is it then
>> possible to
>>  use this Jupyter to edit and run Sage files saved in a better way,
>> like
>>  python files?
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "sage-devel" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to sage-devel+...@googlegroups.com.
>> > To post to this group, send email to sage-...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/sage-devel.
>> > For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: 8.2.beta0 Doctest error on tensorfield.py

2017-12-18 Thread Eric Gourgoulhon
Le lundi 18 décembre 2017 19:01:48 UTC+1, vdelecroix a écrit :
>
> This is fixed in 
>
>   https://trac.sagemath.org/ticket/24396 
>
>
Thank you Vincent!

And Eric you should be in copy of that ticket 
>
>
No, I wasn't: for some reason, I did not receive any notification from Trac 
for this ticket, despite you put me in CC. 

Best regards,

Eric.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: 8.2.beta0 Doctest error on tensorfield.py

2017-12-18 Thread Eric Gourgoulhon
Hi Simon,

Le lundi 18 décembre 2017 18:37:14 UTC+1, Simon King a écrit :
>
> Hi Eric, 
>
> On 2017-12-18, Eric Gourgoulhon > 
> wrote: 
> > Le lundi 18 décembre 2017 15:58:30 UTC+1, Vincent Klein a écrit : 
> > I don't know what is the policy here: should all the lines that depend 
> on 
> > the one marked "# long time" be marked "# long time" as well, so that 
> "sage 
> > -t" without "--long" is successful ? 
>
> Of course! The same holds for "# optional: bla". All subsequent lines 
> have to be marked in the same way, unless they work the same regardless 
> whether the previous lines have been executed or not. 
>
>
Thanks for your answer. Indeed, this seems the only sensible thing to do!

Best regards,

  Eric.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread PHPirate
Bit off-topic but yeah, that's the kind of IDE Sage needs :) 
(MMa was maybe not the best example, I use packages all the time if I need 
to collaborate)

On Monday, December 18, 2017 at 6:40:58 PM UTC+1, Peter Luschny wrote:
>
> I do not like notebooks such as this one and Mathematica because they do 
>> not go well with a VCS. 
>>
>
> With Eclipse you have a powerful IDE for Mathematica. Called Wolfram 
> Workbench. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: 8.2.beta0 Doctest error on tensorfield.py

2017-12-18 Thread Vincent Delecroix

This is fixed in

 https://trac.sagemath.org/ticket/24396

And Eric you should be in copy of that ticket

On 18/12/2017 15:26, Eric Gourgoulhon wrote:

Hi,

Le lundi 18 décembre 2017 15:58:30 UTC+1, Vincent Klein a écrit :


Hi all,

I get the following errors with a fresh 8.2.beta0 install (after "make
distclean" "make").
I have the sames errors on Ubuntu 14.04 and 16.04.
Traceback:

sage -t --warn-long 17.5 src/sage/manifolds/differentiable/tensorfield.py
# 3 doctests failed



That's because without the --long option, some doctest lines (those marked
with "# long time") are skipped, which causes some subsequent tests to
fail.
If one adds --long, all doctests are passed:
sage -t --long src/sage/manifolds/differentiable/tensorfield.py

I don't know what is the policy here: should all the lines that depend on
the one marked "# long time" be marked "# long time" as well, so that "sage
-t" without "--long" is successful ?

Eric.



--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread Peter Luschny

>
> I do not like notebooks such as this one and Mathematica because they do 
> not go well with a VCS. 
>

With Eclipse you have a powerful IDE for Mathematica. Called Wolfram 
Workbench. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: 8.2.beta0 Doctest error on tensorfield.py

2017-12-18 Thread Simon King
Hi Eric,

On 2017-12-18, Eric Gourgoulhon  wrote:
> Le lundi 18 décembre 2017 15:58:30 UTC+1, Vincent Klein a écrit :
> I don't know what is the policy here: should all the lines that depend on 
> the one marked "# long time" be marked "# long time" as well, so that "sage 
> -t" without "--long" is successful ?

Of course! The same holds for "# optional: bla". All subsequent lines
have to be marked in the same way, unless they work the same regardless
whether the previous lines have been executed or not.

Best regards,
Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Mechanism to choose NamedConvertMap as coercion map?

2017-12-18 Thread Simon King
Hi Jeroen,

On 2017-12-18, Jeroen Demeyer  wrote:
> Sage has NamedConvertMap to convert via special methods like 
> _real_mpfi_(). When looking for a conversion map, it first tries to find 
> a coercion map and then it checks for a default conversion map, ... 
> Why try to find a coercion map first?

One axiom of Sage's coercion system is: IF there is a coercion from A to B,
then it coincides with the default conversion from A to B.

Assuming that Sage does satisfy that axiom, I think one could indeed
simplify the logic: Do not check whether a coercion from A to B exists
(which may be costly), maybe just check whether the coercion is in the
cache. If it isn't cached, do the default conversion (since we assume
that it coincides with coercion anyway).

However, be careful! I suppose the current logic was chosen in order to
be better safe than sorry: If you are looking for a default conversion,
then it must coincide with the coercion (if it exists), hence, do
construct the coercion (if it exists) and use it as conversion, so that
there is no danger to accidentally pick an inconsistent conversion.

> For coercion, it is slightly more complicated: ideally, one would want 
> to use the _real_mpfi_() map if it exists, but that is wrong since the 
> map might not define a coercion (only a conversion).

One way to answer the question whether a coercion from A to B exists is
by implementing the method B._coerce_map_from_.

If that method returns "True" then the coercion system knows that
it is right to choose _real_mpfi_() for coercion.

> 1. Check for a coercion map.
>
> 2. If coercion is possible, check for a NamedConvertMap. If so, use that 
> instead.

No. If there is a coercion map, then (by definition) coercion is possible,
and the coercion map is cached. So, do not use something else instead.

> 3. If there is no NamedConvertMap, use the coercion map from step 1.

The coercion system works the other way around, IIRC:

1. It checks whether a coercion from A to B exists. That question
already is answered affirmatively if B._coerce_map_from_(A) returns
True. It may also return a map.

2. If a coercion exists and B._coerce_map_from_(A) didn't return a map,
then try to construct a direct conversion (it doesn't matter if it is
implemented by means of B._element_constructor_ or by means of a named
method).

3. If the construction of a direct conversion fails, then there is 
still the possibility of composing coercion maps, which is detected
by some backtracking algorithm in the coercion graph. The resulting
composed map is then also used for conversion.

> I feel like there should a mechanism to prefer a NamedConvertMap over 
> other maps. Has somebody encountered this problem before for some other 
> parent?

Actually I have hardly encountered NamedConvertMap before. When I
implement a conversion, it is, in most cases, by _element_constructor_.

Best regards,
Simon


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread PHPirate
Thanks, that sounds a bit too difficult for me though so I'll just stick to 
writing in PyCharm and try to execute my Sage files via the Sage shell.

But out of curiosity, am I the only one wanting to write scripts in Sage? 
Or are there other people using editors in the same way?

On Monday, December 18, 2017 at 5:42:50 PM UTC+1, Erik Bray wrote:
>
> On Mon, Dec 18, 2017 at 5:37 PM, PHPirate  > wrote: 
> > Hm, it is at least worth a try (just saw your message on GH) Okay I can 
> > understand if Sage has no syntax highlighting in any IDE on Windows, but 
> as 
> > the situation is now for me, is that there is no IDE in which you can 
> type 
> > Sage and then hit 'run' and then get Sage output. Now I think I could 
> write 
> > Sage in Notepad and then execute a Sage file via the Sage shell but I'm 
> > looking to shortcut that a bit (my expectations are quite lower now I 
> know 
> > that Sage doesn't have a standard editor which everyone uses). 
> > 
> > But is it a bad idea to write Sage scripts? Did I misunderstand 
> something, 
> > and should I use the console only? 
>
> It's not at all a bad idea; it's just that if you want correct syntax 
> highlighting for it you'll have to use an editor for which there is 
> syntax highlighting support for Sage, or add it yourself to your 
> editor of choice.  Certainly there's no reason to use notepad 
> regardless.  It's just that different editors have different means of 
> providing syntax highlighting for new languages (where Sage's syntax 
> is just a small superset over pure Python syntax). 
>
> More importantly, the default Python interpreter also isn't going to 
> know how to execute a Sage script, though it seems that in PyCharm 
> it's probably possible to configure the necessary options to pre-load 
> the Sage syntax parser and then pass it a .sage script, but I haven't 
> tried it yet. 
>
> > On Monday, December 18, 2017 at 2:06:09 PM UTC+1, Erik Bray wrote: 
> >> 
> >> That sounds a bit bogus to me.  I've never used PyCharm before and 
> don't 
> >> know how it works, but I suspect it could be made to work with Cygwin's 
> >> Python.  It's pretty low-priority for me though.  I don't see how using 
> >> PyCharm to edit sage source code would be useful--it won't even do 
> syntax 
> >> highlighting properly, unless I'm missing something. 
> >> 
> >> On Saturday, December 16, 2017 at 2:01:08 PM UTC+1, Dima Pasechnik 
> wrote: 
> >>> 
> >>> I've already expalined here 
> >>> https://github.com/sagemath/sage-windows/issues/12 that PyCharm 
> doesn't 
> >>> support Cygwin Python, 
> >>> and thus it's not going to be trivial to fix. The reason that we must 
> use 
> >>> Cygwin Python is that a number of essential Sage components (i.e. 
> Python 
> >>> extensions you need) e.g. GAP, won't work natively on Windows, as they 
> use 
> >>> fork() and other Unix/Posix specific system functions. 
> >>> 
> >>> On Saturday, December 16, 2017 at 12:19:56 PM UTC, PHPirate wrote: 
>  
>  Thanks, it sounds reasonable. But do you mean the Jupyter notebook 
>  included with Sage, which you can start with 
>  sage --notebook ipython 
>  from the Sage shell? I do not like notebooks such as this one and 
>  Mathematica because they do not go well with a VCS. Is it then 
> possible to 
>  use this Jupyter to edit and run Sage files saved in a better way, 
> like 
>  python files? 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sage-devel" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to sage-devel+...@googlegroups.com . 
> > To post to this group, send email to sage-...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sage-devel. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread Erik Bray
On Mon, Dec 18, 2017 at 5:37 PM, PHPirate  wrote:
> Hm, it is at least worth a try (just saw your message on GH) Okay I can
> understand if Sage has no syntax highlighting in any IDE on Windows, but as
> the situation is now for me, is that there is no IDE in which you can type
> Sage and then hit 'run' and then get Sage output. Now I think I could write
> Sage in Notepad and then execute a Sage file via the Sage shell but I'm
> looking to shortcut that a bit (my expectations are quite lower now I know
> that Sage doesn't have a standard editor which everyone uses).
>
> But is it a bad idea to write Sage scripts? Did I misunderstand something,
> and should I use the console only?

It's not at all a bad idea; it's just that if you want correct syntax
highlighting for it you'll have to use an editor for which there is
syntax highlighting support for Sage, or add it yourself to your
editor of choice.  Certainly there's no reason to use notepad
regardless.  It's just that different editors have different means of
providing syntax highlighting for new languages (where Sage's syntax
is just a small superset over pure Python syntax).

More importantly, the default Python interpreter also isn't going to
know how to execute a Sage script, though it seems that in PyCharm
it's probably possible to configure the necessary options to pre-load
the Sage syntax parser and then pass it a .sage script, but I haven't
tried it yet.

> On Monday, December 18, 2017 at 2:06:09 PM UTC+1, Erik Bray wrote:
>>
>> That sounds a bit bogus to me.  I've never used PyCharm before and don't
>> know how it works, but I suspect it could be made to work with Cygwin's
>> Python.  It's pretty low-priority for me though.  I don't see how using
>> PyCharm to edit sage source code would be useful--it won't even do syntax
>> highlighting properly, unless I'm missing something.
>>
>> On Saturday, December 16, 2017 at 2:01:08 PM UTC+1, Dima Pasechnik wrote:
>>>
>>> I've already expalined here
>>> https://github.com/sagemath/sage-windows/issues/12 that PyCharm doesn't
>>> support Cygwin Python,
>>> and thus it's not going to be trivial to fix. The reason that we must use
>>> Cygwin Python is that a number of essential Sage components (i.e. Python
>>> extensions you need) e.g. GAP, won't work natively on Windows, as they use
>>> fork() and other Unix/Posix specific system functions.
>>>
>>> On Saturday, December 16, 2017 at 12:19:56 PM UTC, PHPirate wrote:

 Thanks, it sounds reasonable. But do you mean the Jupyter notebook
 included with Sage, which you can start with
 sage --notebook ipython
 from the Sage shell? I do not like notebooks such as this one and
 Mathematica because they do not go well with a VCS. Is it then possible to
 use this Jupyter to edit and run Sage files saved in a better way, like
 python files?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread Erik Bray
On Mon, Dec 18, 2017 at 5:17 PM, Dima Pasechnik  wrote:
>
>
> On Monday, December 18, 2017 at 1:06:09 PM UTC, Erik Bray wrote:
>>
>> That sounds a bit bogus to me.  I've never used PyCharm before and don't
>> know how it works, but I suspect it could be made to work with Cygwin's
>> Python.
>
>
> PyCharm is a closed-source product that has a wizard to pick up "the
> Python", and this wizard won't work with Cygwin's Python, as the product's
> vendor says. Bogus or not...

I've confirmed that Cygwin's Python interpreter works fine with
PyCharm as long as the Path environment variable is set correctly.

So I think a more accurate interpretation of their statement is "We
don't know whether or not it will work and won't or can't comment on
if it will, nor provide support for it".  But it does work.

>> It's pretty low-priority for me though.  I don't see how using PyCharm to
>> edit sage source code would be useful--it won't even do syntax highlighting
>> properly, unless I'm missing something.
>>
>> On Saturday, December 16, 2017 at 2:01:08 PM UTC+1, Dima Pasechnik wrote:
>>>
>>> I've already expalined here
>>> https://github.com/sagemath/sage-windows/issues/12 that PyCharm doesn't
>>> support Cygwin Python,
>>> and thus it's not going to be trivial to fix. The reason that we must use
>>> Cygwin Python is that a number of essential Sage components (i.e. Python
>>> extensions you need) e.g. GAP, won't work natively on Windows, as they use
>>> fork() and other Unix/Posix specific system functions.
>>>
>>> On Saturday, December 16, 2017 at 12:19:56 PM UTC, PHPirate wrote:

 Thanks, it sounds reasonable. But do you mean the Jupyter notebook
 included with Sage, which you can start with
 sage --notebook ipython
 from the Sage shell? I do not like notebooks such as this one and
 Mathematica because they do not go well with a VCS. Is it then possible to
 use this Jupyter to edit and run Sage files saved in a better way, like
 python files?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread PHPirate
Hm, it is at least worth a try (just saw your message on GH) Okay I can 
understand if Sage has no syntax highlighting in any IDE on Windows, but as 
the situation is now for me, is that there is no IDE in which you can type 
Sage and then hit 'run' and then get Sage output. Now I think I could write 
Sage in Notepad and then execute a Sage file via the Sage shell but I'm 
looking to shortcut that a bit (my expectations are quite lower now I know 
that Sage doesn't have a standard editor which everyone uses).

But is it a bad idea to write Sage scripts? Did I misunderstand something, 
and should I use the console only?

On Monday, December 18, 2017 at 2:06:09 PM UTC+1, Erik Bray wrote:
>
> That sounds a bit bogus to me.  I've never used PyCharm before and don't 
> know how it works, but I suspect it could be made to work with Cygwin's 
> Python.  It's pretty low-priority for me though.  I don't see how using 
> PyCharm to edit sage source code would be useful--it won't even do syntax 
> highlighting properly, unless I'm missing something.
>
> On Saturday, December 16, 2017 at 2:01:08 PM UTC+1, Dima Pasechnik wrote:
>>
>> I've already expalined here 
>> https://github.com/sagemath/sage-windows/issues/12 that PyCharm doesn't 
>> support Cygwin Python,
>> and thus it's not going to be trivial to fix. The reason that we must use 
>> Cygwin Python is that a number of essential Sage components (i.e. Python 
>> extensions you need) e.g. GAP, won't work natively on Windows, as they use 
>> fork() and other Unix/Posix specific system functions.  
>>
>> On Saturday, December 16, 2017 at 12:19:56 PM UTC, PHPirate wrote:
>>>
>>> Thanks, it sounds reasonable. But do you mean the Jupyter notebook 
>>> included with Sage, which you can start with 
>>> sage --notebook ipython
>>> from the Sage shell? I do not like notebooks such as this one and 
>>> Mathematica because they do not go well with a VCS. Is it then possible to 
>>> use this Jupyter to edit and run Sage files saved in a better way, like 
>>> python files?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread Dima Pasechnik


On Monday, December 18, 2017 at 1:06:09 PM UTC, Erik Bray wrote:
>
> That sounds a bit bogus to me.  I've never used PyCharm before and don't 
> know how it works, but I suspect it could be made to work with Cygwin's 
> Python. 
>

PyCharm is a closed-source product that has a wizard to pick up "the 
Python", and this wizard won't work with Cygwin's Python, as the product's 
vendor says. Bogus or not...

 

> It's pretty low-priority for me though.  I don't see how using PyCharm to 
> edit sage source code would be useful--it won't even do syntax highlighting 
> properly, unless I'm missing something.
>
> On Saturday, December 16, 2017 at 2:01:08 PM UTC+1, Dima Pasechnik wrote:
>>
>> I've already expalined here 
>> https://github.com/sagemath/sage-windows/issues/12 that PyCharm doesn't 
>> support Cygwin Python,
>> and thus it's not going to be trivial to fix. The reason that we must use 
>> Cygwin Python is that a number of essential Sage components (i.e. Python 
>> extensions you need) e.g. GAP, won't work natively on Windows, as they use 
>> fork() and other Unix/Posix specific system functions.  
>>
>> On Saturday, December 16, 2017 at 12:19:56 PM UTC, PHPirate wrote:
>>>
>>> Thanks, it sounds reasonable. But do you mean the Jupyter notebook 
>>> included with Sage, which you can start with 
>>> sage --notebook ipython
>>> from the Sage shell? I do not like notebooks such as this one and 
>>> Mathematica because they do not go well with a VCS. Is it then possible to 
>>> use this Jupyter to edit and run Sage files saved in a better way, like 
>>> python files?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: 8.2.beta0 Doctest error on tensorfield.py

2017-12-18 Thread Vincent Klein
Ok i have read --long instead of --warn-long.
Thanks for your answer. 

Le lundi 18 décembre 2017 16:26:56 UTC+1, Eric Gourgoulhon a écrit :
>
> Hi,
>
> Le lundi 18 décembre 2017 15:58:30 UTC+1, Vincent Klein a écrit :
>>
>> Hi all, 
>>
>> I get the following errors with a fresh 8.2.beta0 install (after "make 
>> distclean" "make").
>> I have the sames errors on Ubuntu 14.04 and 16.04.
>> Traceback:
>>
>> sage -t --warn-long 17.5 
>> src/sage/manifolds/differentiable/tensorfield.py  # 3 doctests failed
>>
>>
> That's because without the --long option, some doctest lines (those marked 
> with "# long time") are skipped, which causes some subsequent tests to 
> fail. 
> If one adds --long, all doctests are passed:
> sage -t --long src/sage/manifolds/differentiable/tensorfield.py
>
> I don't know what is the policy here: should all the lines that depend on 
> the one marked "# long time" be marked "# long time" as well, so that "sage 
> -t" without "--long" is successful ?
>
> Eric.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: 8.2.beta0 Doctest error on tensorfield.py

2017-12-18 Thread Eric Gourgoulhon
Hi,

Le lundi 18 décembre 2017 15:58:30 UTC+1, Vincent Klein a écrit :
>
> Hi all, 
>
> I get the following errors with a fresh 8.2.beta0 install (after "make 
> distclean" "make").
> I have the sames errors on Ubuntu 14.04 and 16.04.
> Traceback:
>
> sage -t --warn-long 17.5 src/sage/manifolds/differentiable/tensorfield.py  
> # 3 doctests failed
>
>
That's because without the --long option, some doctest lines (those marked 
with "# long time") are skipped, which causes some subsequent tests to 
fail. 
If one adds --long, all doctests are passed:
sage -t --long src/sage/manifolds/differentiable/tensorfield.py

I don't know what is the policy here: should all the lines that depend on 
the one marked "# long time" be marked "# long time" as well, so that "sage 
-t" without "--long" is successful ?

Eric.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] 8.2.beta0 Doctest error on tensorfield.py

2017-12-18 Thread Vincent Klein
Hi all, 

I get the following errors with a fresh 8.2.beta0 install (after "make 
distclean" "make").
I have the sames errors on Ubuntu 14.04 and 16.04.
Traceback:

sage -t --warn-long 17.5 src/sage/manifolds/differentiable/tensorfield.py  
# 3 doctests failed
--
Total time for all tests: 4321.7 seconds
cpu time: 3517.5 seconds
cumulative wall time: 3935.7 seconds
vklein@tuono:~/odk/dev/sage$ sage -t --warn-long 17.5 
src/sage/manifolds/differentiable/tensorfield.py
Running doctests with ID 2017-12-18-15-20-43-6994e504.
Git branch: develop
Using --optional=mpir,python2,sage
Doctesting 1 file.
sage -t --warn-long 17.5 src/sage/manifolds/differentiable/tensorfield.py
**
File "src/sage/manifolds/differentiable/tensorfield.py", line 295, in 
sage.manifolds.differentiable.tensorfield.TensorField
Failed example:
t[eV,1,1,c_uv].expr()
Exception raised:
Traceback (most recent call last):
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
 
line 517, in _run
self.compile_and_execute(example, compiler, test.globs)
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
 
line 920, in compile_and_execute
exec(compiled, globs)
  File "", line 1, in 

t[eV,Integer(1),Integer(1),c_uv].expr()
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/manifolds/differentiable/tensorfield.py",
 
line 1472, in __getitem__
return self.comp(frame)[args]
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/manifolds/differentiable/tensorfield.py",
 
line 1235, in comp
return rst.comp(basis=basis, from_basis=from_basis)
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/manifolds/differentiable/tensorfield_paral.py",
 
line 921, in comp
from_basis=from_basis)
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/tensor/modules/free_module_tensor.py",
 
line 1076, in components
"the components in the {}".format(basis))
ValueError: no basis could be found for computing the components in the 
Coordinate frame (V, (d/du,d/dv))
**
File "src/sage/manifolds/differentiable/tensorfield.py", line 298, in 
sage.manifolds.differentiable.tensorfield.TensorField
Failed example:
type(t[eV,1,1,c_uv].expr())
Exception raised:
Traceback (most recent call last):
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
 
line 517, in _run
self.compile_and_execute(example, compiler, test.globs)
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
 
line 920, in compile_and_execute
exec(compiled, globs)
  File "", line 1, in 

type(t[eV,Integer(1),Integer(1),c_uv].expr())
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/manifolds/differentiable/tensorfield.py",
 
line 1472, in __getitem__
return self.comp(frame)[args]
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/manifolds/differentiable/tensorfield.py",
 
line 1235, in comp
return rst.comp(basis=basis, from_basis=from_basis)
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/manifolds/differentiable/tensorfield_paral.py",
 
line 921, in comp
from_basis=from_basis)
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/tensor/modules/free_module_tensor.py",
 
line 1076, in components
"the components in the {}".format(basis))
ValueError: no basis could be found for computing the components in the 
Coordinate frame (V, (d/du,d/dv))
**
File "src/sage/manifolds/differentiable/tensorfield.py", line 318, in 
sage.manifolds.differentiable.tensorfield.TensorField
Failed example:
f = t(a,b)
Exception raised:
Traceback (most recent call last):
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
 
line 517, in _run
self.compile_and_execute(example, compiler, test.globs)
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
 
line 920, in compile_and_execute
exec(compiled, globs)
  File "", line 1, in 

f = t(a,b)
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/manifolds/differentiable/tensorfield.py",
 
line 2348, in __call__
resu_rr = self_rr(*args_rr)
  File 
"/home/vklein/odk/dev/sage/local/lib/python2.7/site-packages/sage/manifolds/differentiable/tensorfield_paral.py",
 
line 1461, in __call__
return FreeModuleTensor.__call__(self_r, *args_r)
 

[sage-devel] Mechanism to choose NamedConvertMap as coercion map?

2017-12-18 Thread Jeroen Demeyer

Hello,

I'm working on coercion for interval fields (See Trac #24371) and there 
is one issue that I don't know how to solve elegantly:


Sage has NamedConvertMap to convert via special methods like 
_real_mpfi_(). When looking for a conversion map, it first tries to find 
a coercion map and then it checks for a default conversion map, which 
could be the NamedConvertMap. Now this seems to be the wrong order: 
after all, if a conversion exists using the _real_mpfi_() map, there is 
no reason to look further. Why try to find a coercion map first?


For coercion, it is slightly more complicated: ideally, one would want 
to use the _real_mpfi_() map if it exists, but that is wrong since the 
map might not define a coercion (only a conversion). So for coercion, it 
seems that the logic should be:


1. Check for a coercion map.

2. If coercion is possible, check for a NamedConvertMap. If so, use that 
instead.


3. If there is no NamedConvertMap, use the coercion map from step 1.

I feel like there should a mechanism to prefer a NamedConvertMap over 
other maps. Has somebody encountered this problem before for some other 
parent? I created Trac #24381 for this issue.



Jeroen.

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Running Sage from an IDE like PyCharm on Windows.

2017-12-18 Thread Erik Bray
That sounds a bit bogus to me.  I've never used PyCharm before and don't 
know how it works, but I suspect it could be made to work with Cygwin's 
Python.  It's pretty low-priority for me though.  I don't see how using 
PyCharm to edit sage source code would be useful--it won't even do syntax 
highlighting properly, unless I'm missing something.

On Saturday, December 16, 2017 at 2:01:08 PM UTC+1, Dima Pasechnik wrote:
>
> I've already expalined here 
> https://github.com/sagemath/sage-windows/issues/12 that PyCharm doesn't 
> support Cygwin Python,
> and thus it's not going to be trivial to fix. The reason that we must use 
> Cygwin Python is that a number of essential Sage components (i.e. Python 
> extensions you need) e.g. GAP, won't work natively on Windows, as they use 
> fork() and other Unix/Posix specific system functions.  
>
> On Saturday, December 16, 2017 at 12:19:56 PM UTC, PHPirate wrote:
>>
>> Thanks, it sounds reasonable. But do you mean the Jupyter notebook 
>> included with Sage, which you can start with 
>> sage --notebook ipython
>> from the Sage shell? I do not like notebooks such as this one and 
>> Mathematica because they do not go well with a VCS. Is it then possible to 
>> use this Jupyter to edit and run Sage files saved in a better way, like 
>> python files?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Meaning of edge_labels in canonical_label()

2017-12-18 Thread Dima Pasechnik
On Monday, December 18, 2017 at 10:40:56 AM UTC, Jori Mäntysalo wrote:
>
> Using edge_labels=True in canonical_label() of graph seems to work, i.e. 
> canonization transforms isomorphism to equality. Also the parameter does 
> *something*, it is not ignored. 
>

I guess you get lexicographically minimal (or maximal), as a vector, 
adjacency matrix of the graph.
(so labels should be possible to order, not only to compare for equality).
   

>
> But what is the meaning of it? For partition-parameter the meaning is 
> clear (but not clearly documented). 
>
> -- 
> Jori Mäntysalo 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Meaning of edge_labels in canonical_label()

2017-12-18 Thread Jori Mäntysalo
Using edge_labels=True in canonical_label() of graph seems to work, i.e. 
canonization transforms isomorphism to equality. Also the parameter does 
*something*, it is not ignored.


But what is the meaning of it? For partition-parameter the meaning is 
clear (but not clearly documented).


--
Jori Mäntysalo


[sage-devel] blocker making patchbot fail

2017-12-18 Thread Ralf Stephan
Hello,

The previously noticed blocker #24378
is in review but
https://trac.sagemath.org/ticket/24284

is now coming up frequently too so I changed its priority. Please review.

Regards,

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.