1. 05 Nov, 2018 3 commits
• Trac #26639: use PEP 289 generator expressions in geometry/cone.py. · 7b512897
Michael Orlitzky authored
```A generator expression in Python is a more general version of a list
comprehension. The problem with list comprehensions is that, well,
they create lists. And often, we don't need the list for anything
other than to traverse it. In that case, an iterator would be more
efficient, although the list comprehension syntax is pretty convenient.

That's where generator expressions come in. The following code creates
a list of unit-norm generators for the cone K, and then sums its entries:

sage: K = Cone([(2,0), (0,2)])
sage: sum([ vector(QQbar,g).normalized() for g in K ])

However, we don't need that list: we just want the sum. In a generator
expression, the list brackets are replaced by parentheses, and an
iterator (as opposed to a list) is returned. In many cases, this is a
more efficient drop-in replacement for a list comprehension. For
example,

sage: K = Cone([(2,0), (0,2)])
sage: sum(( vector(QQbar,g).normalized() for g in K ))

This commit fixes a few "easy" cases where list comprehensions were
used, but where generator expressions should work too.```
• Trac #26639: add two missing set_random_seed() calls to geometry/cone.py. · 5fa22d55
Michael Orlitzky authored
```The set_random_seed() function needs to be called before every test
that uses randomness. Two were overlooked at some point in the past;
• Trac #26639: use future-proof range() iterator in geometry/cone.py · e63b0ce8
Michael Orlitzky authored
```The python-2.x version of range() always returns a list. This can be
inefficient, if, for example, you're using it to sum a bunch of numbers:

sage: sum(range(10))
45

The code above constructs the entire list [0,1,...,9], and *then* sums
its entries. Storing the list wastes memory; an iterator that lets us
consider each element one-at-a-time (without storing the whole list)
would be more efficient.

In python-2.x, the xrange() function does what we want. But in
python-3.x, there is no xrange() -- it's been replaced by a smarter
version of range()! We don't want to leave the list-building range()
calls in there for python-2.x, but we can't "upgrade" them to xrange()
without creating problems for the python-3.x migration down the road.

So what to do? Fortunately, python-2.6 has the new version of the
range() function, but it's hidden by default. We gain access to it with

from six.moves import range

at the top of geometry/cone.py. This automatically affects all library
code and doctests in that file, converting their uses of range() to
iterators. The code has been inspected to make sure that this is
semantically correct (that is, nothing is really expecting range() to
return a list).```
2. 04 Nov, 2018 1 commit
3. 01 Nov, 2018 1 commit
4. 31 Oct, 2018 10 commits
• Trac #26510: Py3: Fix combinat.subset.py for python3 · 9b129780
Release Manager authored
```Some small fixes.

URL: https://trac.sagemath.org/26510
Reported by: vklein
Ticket author(s): Vincent Klein
Reviewer(s): Frédéric Chapoton```
• Trac #26460: Modify the banner for Python3-based Sage · 2e236951
Release Manager authored
```This ticket is about modifying the banner for Python3-based Sage, if
others agree.

For example, if the SageNB notebook does not work in Python3-based Sage,
we could replace
{{{
Type "notebook()" for the browser-based notebook interface.
}}}
by
{{{
}}}

URL: https://trac.sagemath.org/26460
Reported by: slelievre
Ticket author(s): Frédéric Chapoton
Reviewer(s): Jeroen Demeyer```
• Trac #26610: py3: fix most doctests in combinat/species · 0f9f9e96
Release Manager authored
```URL: https://trac.sagemath.org/26610
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Travis Scrimshaw```
• Trac #26609: remove deprecated stuff in manifolds · d8f545fa
Release Manager authored
```after #18783 and #19209

URL: https://trac.sagemath.org/26609
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Eric Gourgoulhon```
• Trac #26602: remove cephes package · 3ec2d4a2
Release Manager authored
```cephes at the moment is only installed on FreeBSD, to fix its lacking
(on versions less than 12) libm, and it's far from working anyway.

The good news are that the latest FreeBSD 12.0 (already in beta, to be
released by the Dec 2018) has fixed its libm so that cephes is no longer
needed. POC may be found on
https://github.com/lwhsu/sagemath/tree/freebsd
(work in progress, builds, runs, fails ~30 tests as of 2018/10/30).

URL: https://trac.sagemath.org/26602
Reported by: dimpase
Ticket author(s): Dima Pasechnik
Reviewer(s): Frédéric Chapoton```
• Trac #26585: Calling openblas_set_num_threads in the main process of Sage can lead to segfaults · f552783c
Release Manager authored
```Note: This does not happen currently in Sage, but does result from

Multiplying a 1000x1000 matrix over GF(11) causes a segfault on a 32
core server.

{{{
sage: a=random_matrix(GF(11),1000)
sage: b = a*a
Erreur de segmentation
}}}

gdb says it comes from OpenBLAS thread manager.
{{{
[Switching to Thread 0x7fe738c31700 (LWP 18829)]
from /home/pernet/sage/local/lib/libopenblas.so.0
(gdb) where
from /home/pernet/sage/local/lib/libopenblas.so.0
#2  0x00007ffff7b08f0f in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

}}}

but in valgrind mode, everything works just fine.

**Upstream PR:** https://github.com/xianyi/OpenBLAS/pull/1837/files

URL: https://trac.sagemath.org/26585
Reported by: cpernet
Ticket author(s): Erik Bray
Reviewer(s): Erik Bray```
• Trac #25084: change _invert_unit to inverse_of_unit on integer matrices · 3095556e
Release Manager authored
```Inverting a ring element usually produces an element in its fraction
field.

When the ring element is invertible in its parent ring, it can be
convenient
to obtain the inverse as an element in the same ring.

For consistency with other rings in Sage, the matrix ring method
`_invert_unit` should be renamed `inverse_of_unit`.

URL: https://trac.sagemath.org/25084
Reported by: vdelecroix
Ticket author(s): Vincent Delecroix
Reviewer(s): Frédéric Chapoton```
• trac 26610 reviewer's request · 8c6353a9
Frédéric Chapoton authored
• remove deprecated stuff in manifolds · 52217e8d
Frédéric Chapoton authored
5. 30 Oct, 2018 25 commits