Re: [sage-devel] Re: equal FractionFieldElement_1poly_field have different hashes

2014-09-23 Thread Nils Bruin
On Monday, September 22, 2014 11:37:13 PM UTC-7, Clemens Heuberger wrote:
>
> the problem is that the labels of a state could be any hashable Sage 
> object. 
> Thus preprocessing this single case of Frac(QQ[x]) would be quite ugly 
> IMHO and 
> would not address the underlying problem. 
>

The Frac(QQ[x]) case is really a bug. See 
http://trac.sagemath.org/ticket/16268.
Probably the denominator there should be made monic (that works also for 
Frac(K[x]) where K is not a field of fractions of a PID).

If we want to compute in Frac(R[x]) where R = ZZ[sqrt(-5)] we'd need some 
more tricks; probably multiply numerator and denominator so that the 
denominator is a polynomial over ZZ with content 1.

The more general problem will not be resolved:

sage: GF(3)(1) == GF(5)(1)
False
sage: GF(3)(1) == ZZ(1)
True
sage: GF(5)(1) == ZZ(1)
True
sage: set([ZZ(1),GF(3)(1),GF(5)(1)])
{1}
sage: set([GF(3)(1),ZZ(1),GF(5)(1)])
{1, 1}

This is a consequence of automatic coercions that have to be in place for 
many users to feel that sage is not placing undue notational burden on 
them. As a consequence, you see that you cannot expect to be able to use 
{ZZ(1), GF(3)(1),GF(5)(1)} as label set. Using other data structures is not 
going to solve that problem. Just document that people should be choosing 
their labels from a uniform universe; enforce it if you feel like being 
pedantic (possibly in a good way).

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Please review global docstring/test change #16746

2014-09-23 Thread Jeroen Demeyer

On 2014-09-23 18:36, John Cremona wrote:

Well done.Surely if all those hunderds of lines now look good,
that counts for a large number of tests that Volker did it right?  If
so, I think you can give the ticket a positive review...
I'm not so sure. For example, the last version of the patch accidentally 
disabled all doctests for plotting, a fact which could *easily* have 
been overlooked by a reviewer.


I really would like somebody else (preferably somebody who knows about 
IPython and displayhooks) to review that part of the ticket.


--
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: equal FractionFieldElement_1poly_field have different hashes

2014-09-23 Thread Stefan
I guess there are two or three solutions:

1) don't use sets
2) put big, red warnings in the documentation of your functions
3) have an optional argument to your functions that switches between sets 
and safer (but slower) data structures. The documentation should be clear 
about the implications.

--Stefan.

On Tuesday, September 23, 2014 1:37:13 AM UTC-5, Clemens Heuberger wrote:
>
>
> Hi Simon, 
>
> Am 2014-09-20 um 18:47 schrieb Simon King: 
> > On 2014-09-20, Clemens Heuberger > 
> wrote: 
> >> Shall I enforce that the parent of all labels is the same (and warn the 
> user if 
> >> this is not the case?). Probably, I'd also allow strings as an 
> additional type 
> >> because this should not lead to conflicts. 
> > 
> > You could pre-process the input before passing it to the dict/set. 
> > Hence, if the user inputs an element of Frac(QQ[x]), then you can 
> > pre-process it by normalising it (i.e., make the denominator monic). 
>
> the problem is that the labels of a state could be any hashable Sage 
> object. 
> Thus preprocessing this single case of Frac(QQ[x]) would be quite ugly 
> IMHO and 
> would not address the underlying problem. 
>
> Best regards, 
>
> Clemens 
>
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: weird(?) patchbot build failures for patchbot 'groebner'

2014-09-23 Thread Jakob Kroeker


How are the directories /tmp/tmpUOouim-sage-git-temp and 
/home/jkroeker/Projects/sage-patchbot supposed to be related, is there a 
symlink or something?


The tmp directory has gone. To my knowledge there is only a 
(patchbot-)symlink 
/tmp/tmpUOouim-sage-git-temp/upstream -> 
/home/jkroeker/Projects/sage-patchbot/upstream

/home, /home/jkroeker, /home/jkroeker/Projects and /tmp  are not symlinks  
or mountpoints (checked with 'ls' and 'mountpoint')

Now when I try to reproduce the issue by running a certain ticket,

./sage --nodotsage -patchbot --ticket=16878 

at the first run I hit the documentation build issue(?)

[reference] WARNING: Unable to fetch 
/home/jkroeker/Projects/sage-patchbot/src/doc/output/doctrees/en/reference/modfrm_hecketriangle/environment.pickle
Error building the documentation.
Traceback (most recent call last):
  File "/home/jkroeker/Projects/sage-patchbot/src/doc/common/builder.py", line 
1490, in 
getattr(get_builder(name), type)()
  File "/home/jkroeker/Projects/sage-patchbot/src/doc/common/builder.py", line 
291, in _wrapper
getattr(get_builder(document), 'inventory')(*args, **kwds)
  File "/home/jkroeker/Projects/sage-patchbot/src/doc/common/builder.py", line 
515, in _wrapper
getattr(DocBuilder(self.name, lang), format)(*args, **kwds)
  File "/home/jkroeker/Projects/sage-patchbot/src/doc/common/builder.py", line 
109, in f
execfile(sys.argv[0])
  File 
"/home/jkroeker/Projects/sage-patchbot/src/doc/common/custom-sphinx-build.py", 
line 210, in 
raise OSError(ERROR_MESSAGE)
OSError: [reference] WARNING: Unable to fetch 
/home/jkroeker/Projects/sage-patchbot/src/doc/output/doctrees/en/reference/modfrm_hecketriangle/environment.pickle

make: *** [doc-html] Error 1
Traceback (most recent call last):
  File "/home/jkroeker/Projects/sage-patchbot/local/bin/patchbot/patchbot.py", 
line 458, in test_a_ticket
do_or_die("$MAKE")
  File "/home/jkroeker/Projects/sage-patchbot/local/bin/patchbot/util.py", line 
107, in do_or_die
raise exn_class, "%s %s" % (res, cmd)
Exception: 512 $MAKE
Traceback (most recent call last):
  File "/home/jkroeker/Projects/sage-patchbot/local/bin/patchbot/patchbot.py", 
line 458, in test_a_ticket
do_or_die("$MAKE")
  File "/home/jkroeker/Projects/sage-patchbot/local/bin/patchbot/util.py", line 
107, in do_or_die
raise exn_class, "%s %s" % (res, cmd)
Exception: 512 $MAKE



and at the second run a timeout for cmdline test:

sage -t --long src/sage/tests/cmdline.py
**
File "src/sage/tests/cmdline.py", line 104, in 
sage.tests.cmdline.test_executable
Failed example:
(out, err, ret) = test_executable(["sage"])
Exception raised:
Traceback (most recent call last):
  File 
"/home/jkroeker/Projects/sage-patchbot/local/lib/python2.7/site-packages/sage/doctest/forker.py",
 
line 480, in _run
self.execute(example, compiled, test.globs)
  File 
"/home/jkroeker/Projects/sage-patchbot/local/lib/python2.7/site-packages/sage/doctest/forker.py",
 
line 839, in execute
exec compiled in globs
  File "", line 1, in 

(out, err, ret) = test_executable(["sage"])
  File 
"/home/jkroeker/Projects/sage-patchbot/local/lib/python2.7/site-packages/sage/tests/cmdline.py",
 
line 650, in test_executable
raise RuntimeError("timeout in test_executable()")
RuntimeError: timeout in test_executable()
**
File "src/sage/tests/cmdline.py", line 105, in 
sage.tests.cmdline.test_executable
Failed example:
out.find(version()) >= 0
Expected:
True
Got:
False
**
1 item had failures:
   2 of 210 in sage.tests.cmdline.test_executable
[209 tests, 2 failures, 213.95 s]

while all other tests pass (patchbot is on ticket_merged branch) .


Jakob

Am Montag, 22. September 2014 19:24:49 UTC+2 schrieb Volker Braun:
>
> The include file is installed in 
> /home/jkroeker/Projects/sage-patchbot/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h,
>  
> and the following fails:
>
> gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC 
> -I/tmp/tmpUOouim-sage-git-temp-16878/local/lib/python/site-packages/numpy/core/include
>  
> -I/tmp/tmpUOouim-sage-git-temp-16878/local/include 
> -I/tmp/tmpUOouim-sage-git-temp-16878/local/include/csage 
> -I/tmp/tmpUOouim-sage-git-temp-16878/src 
> -I/tmp/tmpUOouim-sage-git-temp-16878/src/sage/ext 
> -I/home/jkroeker/Projects/sage-patchbot/local/include/python2.7 -c 
> build/cythonized/sage/calculus/riemann.c -o 
> build/temp.linux-x86_64-2.7/build/cythonized/sage/calculus/riemann.o 
> -fno-strict-aliasing -w
> build/cythonized/sage/calculus/riemann.c:348:31: fatal error: 
> numpy/arrayobject.h: No such file or directory
>
> How are the directories /tmp/tmpUOouim-sage-git-temp and 
> /home/jkroeker/Projects/sage-patchbot supposed to

Re: [sage-devel] Please review global docstring/test change #16746

2014-09-23 Thread John Cremona
On 23 September 2014 17:23, Jeroen Demeyer  wrote:
> On 2014-09-23 14:54, John Cremona wrote:
>>
>> I took a quick look and was daunted by the large number of changes,
>> many in files I never normally look at.
>
>
> As I already said on the ticket, I checked those many changes and they are
> ok. What I have not checked is the actual code related to the displayhook.

Well done.Surely if all those hunderds of lines now look good,
that counts for a large number of tests that Volker did it right?  If
so, I think you can give the ticket a positive review...

John

>
>
> --
> 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 http://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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Please review global docstring/test change #16746

2014-09-23 Thread Jeroen Demeyer

On 2014-09-23 14:54, John Cremona wrote:

I took a quick look and was daunted by the large number of changes,
many in files I never normally look at.


As I already said on the ticket, I checked those many changes and they 
are ok. What I have not checked is the actual code related to the 
displayhook.


--
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Please review global docstring/test change #16746

2014-09-23 Thread Volker Braun
Trust me, I  know what I'm doing ;-)

The big piece is commit b579b92... which is mostly auto-generated changes 
to the existing doctests for the new output format. Its long but not really 
that exciting. You can see it with

git show b579b92

The main work was done before that, to switch the doctesting framework 
around. To see the diff up to b579b92, you'd use

git diff 6.4.beta3...b579b92~

(note: tilde = parent commit), which isn't all that much. After that there 
are a few fixups to issues raised on the ticket, which you can summarize 
with 

git diff 1a2b1cf...7de159a


$ git log --oneline --graph trac/u/vbraun/sort_dicts_in_doctests
* 7de159a Fix more random test failures
* b362aa6 Display trailing newline in __repr__() output
* 3922ed5 Reduce doctest precision
* a9271f0 Fix doctests that have dictionary keys without stable order
* fbf83eb Show output of the lonely generic_graph doctest
* 48a2320 Also call graphics.show() in doctest mode
* 1a2b1cf Add IPython formatting to the reference manual
* b579b92 Update doctests that depended on the old displayhook
* eb6a66b Refactor our displayhook IPython integration
* a246e17 Fix printing of types
*   bdbdd5b Merge #16992 (Directly apply --fixdoctests) branch
|\  
| * 1b99c68 Also fix the cmdline doctest
| * e397b3e Add newline at end of file and fix cmdline help
| * da59f20 call git directly and from the right directory
| * 8c5f2b0 Directly overwrite with fixed doctests
| * 325da8b Updated Sage version to 6.4.beta3




On Tuesday, September 23, 2014 1:55:00 PM UTC+1, John Cremona wrote:
>
> I took a quick look and was daunted by the large number of changes, 
> many in files I never normally look at.  What's the best strategy -- 
> apart from trusting you completely? 
> Divide up the files and get a few people to look at them instead of just 
> one? 
>
> John 
>
> On 23 September 2014 13:36, Volker Braun > 
> wrote: 
> > bump 
> > 
> > On Thursday, September 18, 2014 9:27:18 PM UTC+1, Jeroen Demeyer wrote: 
> >> 
> >> On 2014-09-18 20:30, Volker Braun wrote: 
> >> > I would like to merge the ticket asap 
> >> > and then release the next beta. So please review ;-) 
> >> I'm not convinced that you should postpone the next beta for this. If 
> >> you think you have a candidate "next beta" now, just release it... 
> > 
> > 
> > I'm not dying to release the next beta right now, but it'll be easier 
> for 
> > other developers if there is a release with the ticket asap. 
> > 
> > -- 
> > 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 http://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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Please review global docstring/test change #16746

2014-09-23 Thread John Cremona
I took a quick look and was daunted by the large number of changes,
many in files I never normally look at.  What's the best strategy --
apart from trusting you completely?
Divide up the files and get a few people to look at them instead of just one?

John

On 23 September 2014 13:36, Volker Braun  wrote:
> bump
>
> On Thursday, September 18, 2014 9:27:18 PM UTC+1, Jeroen Demeyer wrote:
>>
>> On 2014-09-18 20:30, Volker Braun wrote:
>> > I would like to merge the ticket asap
>> > and then release the next beta. So please review ;-)
>> I'm not convinced that you should postpone the next beta for this. If
>> you think you have a candidate "next beta" now, just release it...
>
>
> I'm not dying to release the next beta right now, but it'll be easier for
> other developers if there is a release with the ticket asap.
>
> --
> 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 http://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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Please review global docstring/test change #16746

2014-09-23 Thread Volker Braun
bump

On Thursday, September 18, 2014 9:27:18 PM UTC+1, Jeroen Demeyer wrote:
>
> On 2014-09-18 20:30, Volker Braun wrote: 
> > I would like to merge the ticket asap 
> > and then release the next beta. So please review ;-) 
> I'm not convinced that you should postpone the next beta for this. If 
> you think you have a candidate "next beta" now, just release it... 
>

I'm not dying to release the next beta right now, but it'll be easier for 
other developers if there is a release with the ticket asap. 

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Failing doctests in sage/dev if $HOME/.sage is a symlink with trailing slash

2014-09-23 Thread Christian Nassau

On 09/23/2014 12:23 PM, Clemens Heuberger wrote:

My $HOME/.sage is a symbolic link with a trailing slash:

~ $ ls -ld .sage
lrwxrwxrwx 1 cheuberg lsci 11 Sep 23 10:25 .sage -> /tmp/.sage/

When running make ptestlong (sage 6.4.beta3) with this configuration, I get
quite a number of failing doctests (see below for details) and several files are
created or overwritten (see below for details).


I'm not sure if this observation helps or is related, but I too was once 
struck by a leading slash problem:

   http://trac.sagemath.org/ticket/14018

My solution[*] was to change the link from "/whatever" to "///whatever": 
I'd be curious to know if this "fix" also works for you.


HTH,
Christian

[*] this is based on this quote from IEEE Std 1003.1, 2004 Edition:

   A pathname consisting of a single slash shall resolve to the root
   directory of the process. A null pathname shall not be successfully
   resolved. A pathname that begins with two successive slashes may be
   interpreted in an implementation-defined manner, although more than
   two leading slashes shall be treated as a single slash.

​ 
http://pubs.opengroup.org/onlinepubs/95399/basedefs/xbd_chap04.html#tag_04_11


Somewhere my "/whatever" became "//whatever" and that, being 
"implementation defined" was no longer recognized as "/whatever".


--
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Failing doctests in sage/dev if $HOME/.sage is a symlink with trailing slash

2014-09-23 Thread Clemens Heuberger
My $HOME/.sage is a symbolic link with a trailing slash:

~ $ ls -ld .sage
lrwxrwxrwx 1 cheuberg lsci 11 Sep 23 10:25 .sage -> /tmp/.sage/

When running make ptestlong (sage 6.4.beta3) with this configuration, I get
quite a number of failing doctests (see below for details) and several files are
created or overwritten (see below for details).

The problem disappears when removing the trailing slash from the symbolic link,
so this is the obvious work-around.

Nevertheless, I post this; perhaps, this is easily fixable and may safe someone
else the time to find out what the problem is.

Details:

sage -t --long src/sage/dev/cmd_line_interface.py  # 24 doctests failed
sage -t --long src/sage/dev/config.py  # 52 doctests failed
sage -t --long src/sage/dev/git_interface.py  # 202 doctests failed
sage -t --long src/sage/dev/misc.py  # 2 doctests failed
sage -t --long src/sage/dev/patch.py  # 78 doctests failed
sage -t --long src/sage/dev/sagedev.py  # 751 doctests failed
sage -t --long src/sage/dev/sagedev_instance.py  # 2 doctests failed
sage -t --long src/sage/dev/sagedev_wrapper.py  # 20 doctests failed
sage -t --long src/sage/dev/saving_dict.py  # 17 doctests failed
sage -t --long src/sage/dev/test/config.py  # 3 doctests failed
sage -t --long src/sage/dev/test/sagedev.py  # 11 doctests failed
sage -t --long src/sage/dev/test/server_proxy.py  # 61 doctests failed
sage -t --long src/sage/dev/test/trac_interface.py  # 15 doctests failed
sage -t --long src/sage/dev/test/trac_server.py  # 2 doctests failed
sage -t --long src/sage/dev/test/user_interface.py  # 15 doctests failed
sage -t --long src/sage/dev/trac_interface.py  # 129 doctests failed
sage -t --long src/sage/dev/user_interface.py  # 25 doctests failed
sage -t --long src/sage/misc/temporary_file.py  # 1 doctest failed

(Logfile is at
http://wwwu.uni-klu.ac.at/cheuberg/ptestlong.log
[1.9MB]; I removed all non-failing doctests for convenience)

After running all doctests, .gitignore is overwritten. After
git checkout -- .gitignore,
git status still shows changed files:

 $ LANG=C git status
# On branch develop
# Your branch is up-to-date with 'trac/develop'.
#
# Untracked files:
#   (use "git add ..." to include in what will be committed)
#
#   alice1
#   alice2
#   alices_file
#   another_file
#   bobs_file
#   bobs_other_file
#   file
#   ignored
#   ignored_dir/
#   merge
#   ticket1
#   ticket2
#   ticket3
#   tracked
#   tracked2
#   tracked3
#   tracked4
#   untracked
#   untracked_dir/
#
nothing added to commit but untracked files present (use "git add" to track)

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: help testing Maple interface fix

2014-09-23 Thread Volker Braun
IMHO we don't need to wait for somebody to test optional interfaces with 
all combinations of OS and Maple. Read the code! He proposed an obvious 
improvement over what we have, using some of the maple command line 
switches to simplify output. Should have been merged a year ago...

On Tuesday, September 23, 2014 8:54:58 AM UTC+1, kcrisman wrote:
>
> See http://trac.sagemath.org/ticket/12295 - esp. if someone is on Mac. 
>  It seems to work fine, just can't have the author be the reviewer :)
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] help testing Maple interface fix

2014-09-23 Thread kcrisman
See http://trac.sagemath.org/ticket/12295 - esp. if someone is on Mac.  It 
seems to work fine, just can't have the author be the reviewer :)

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.