Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop' into public/refactor_integer_vectors-12453
Browse files Browse the repository at this point in the history
* develop: (206 commits)
  Updated Sage version to 6.1.beta2
  fix latex
  fix documentation
  minor typography
  Trac 13101: mark doctest as "long time"
  trac 13101 better doctest
  Trac 13101: Fix bug in enumerate_totallyreal_fields_all
  #9706: review patch.
  trac 9706: Propose new class structure
  Symbolic Chebyshev polynomials: reviewer patch
  trac 9706: Collective patch. Bugfixes, extensions, optimizations, documentation, doctests for chebyshev_T, chebyshev_U and base class for ortho polys
  Updated Sage version to 6.1.beta1
  Fixing Whitespace errors
  Use bash as SHELL for build/Makefile
  allow numpy arrays in list_plot, line, points
  Run Jmol from current directory
  Trac #12322: Add a doctest for the correct behavior introduced in trac #12737.
  Trac #14186 coerce_binop errors with keyword arguments
  trac #15553: Broken links in the doc of graph/ and numerical/
  bug fix : importing BooleanPolynomialRing at the top-level prevents sage from starting
  ...
  • Loading branch information
Travis Scrimshaw committed Dec 23, 2013
2 parents ef2ddce + 036984d commit eb793cc
Show file tree
Hide file tree
Showing 245 changed files with 17,941 additions and 7,844 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Sage version 6.1.beta0, released 2013-12-19
Sage version 6.1.beta2, released 2013-12-23
36 changes: 20 additions & 16 deletions build/deps
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ all-sage: \
$(INST)/$(NCURSES) \
$(INST)/$(ZLIB) \
$(INST)/$(ZNPOLY) \
scripts \
sage \
csage \
extcode
$(INST)/sage \
$(INST)/csage \
$(EXTCODE) \
$(SCRIPTS)

# TOOLCHAIN consists of dependencies determined by build/install,
# including for example the GCC package.
Expand All @@ -133,7 +133,7 @@ toolchain-deps:

# Everything needed to start up Sage using "./sage". Of course, not
# every part of Sage will work. It does not include Maxima for example.
SAGERUNTIME = scripts sage $(INST)/$(SAGENB) $(INST)/$(IPYTHON) $(INST)/$(GAP)
SAGERUNTIME = $(SCRIPTS) $(INST)/sage $(INST)/$(SAGENB) $(INST)/$(IPYTHON)

###############################################################################
# Building the base system
Expand Down Expand Up @@ -308,7 +308,7 @@ $(INST)/$(SQLITE): $(INST)/$(READLINE)
+$(PIPE) "$(SAGE_SPKG) $(SQLITE) 2>&1" "tee -a $(SAGE_LOGS)/$(SQLITE).log"

# To build SageTeX, you just need Python, but to test (SAGE_CHECK=yes)
# SageTeX, you actually need to run sage, produce plots,...
# SageTeX, you actually need to run Sage, produce plots,...
$(INST)/$(SAGETEX): $(INST)/$(PYTHON) \
$(SAGERUNTIME) $(INST)/$(MAXIMA) $(INST)/$(SCIPY) \
$(INST)/$(MATPLOTLIB) $(INST)/$(PIL) $(INST)/$(TACHYON)
Expand Down Expand Up @@ -418,7 +418,7 @@ $(INST)/$(PYGMENTS): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS)
# on the one hand, programs needed for the build/install process of the
# Sage library (e.g. JINJA2), and on the
# other hand all dependencies for Cython files (e.g. PARI, NTL, MPIR).
sage: \
$(INST)/sage: \
$(INST)/$(ATLAS) \
$(INST)/$(CEPHES) \
$(INST)/$(CLIQUER) \
Expand Down Expand Up @@ -456,21 +456,25 @@ sage: \
$(INST)/$(SINGULAR) \
$(INST)/$(SYMMETRICA) \
$(INST)/$(ZNPOLY) \
csage
$(PIPE) '{ if [ -z "$(SAGE_INSTALL_FETCH_ONLY)" ]; then cd $(SAGE_SRC) && . ./bin/sage-env && time python setup.py install; fi; } 2>&1' 'tee -a $(SAGE_LOGS)/sage-$(SAGE_VERSION).log'

scripts: $(SCRIPT_TARGETS)

extcode: $(EXTCODE_TARGETS)

csage: $(INST)/$(SCONS) \
$(INST)/csage
if [ -z "$$SAGE_INSTALL_FETCH_ONLY" ]; then \
cd $(SAGE_SRC) && source bin/sage-env && \
$(PIPE) 'time python setup.py install 2>&1' 'tee -a $(SAGE_LOGS)/sage-$(SAGE_VERSION).log' && \
touch $@; \
fi

$(INST)/csage: $(INST)/$(SCONS) \
$(INST)/$(MPIR) \
$(INST)/$(NTL) \
$(INST)/$(PARI) \
$(INST)/$(POLYBORI) \
$(INST)/$(PYNAC) \
$(INST)/$(PYTHON)
$(PIPE) '{ if [ -z "$(SAGE_INSTALL_FETCH_ONLY)" ]; then cd $(SAGE_SRC)/c_lib && . ../bin/sage-env && time scons -Q install; fi; } 2>&1' 'tee -a $(SAGE_LOGS)/csage-$(SAGE_VERSION).log'
if [ -z "$$SAGE_INSTALL_FETCH_ONLY" ]; then \
cd $(SAGE_SRC) && source bin/sage-env && cd c_lib && \
$(PIPE) 'time scons -Q install 2>&1' 'tee -a $(SAGE_LOGS)/csage-$(SAGE_VERSION).log' && \
touch $@; \
fi

$(INST)/ccache: $(BASE) $(INST)/$(ZLIB)
+$(PIPE) "$(SAGE_SPKG) ccache 2>&1" "tee -a $(SAGE_LOGS)/ccache.log"
Expand Down
9 changes: 7 additions & 2 deletions build/install
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ cat >&3 <<EOF
EOF

# Use bash as shell for the Makefile (bash obviously exists, since
# this build/install script runs under bash).
echo >&3 "SHELL = `command -v bash`"
echo >&3

# If the user (or the Makefile) has set SAGE_PARALLEL_SPKG_BUILD=no,
# then turn off parallel building: disable just building multiple
# packages at the same time. Individual packages can still be built
Expand Down Expand Up @@ -490,7 +495,7 @@ for file in "$SAGE_SRC/bin/"*; do
echo >&3 " \$(SAGE_SRC)${file#$SAGE_SRC} \\"
done
echo >&3
echo >&3 'SCRIPT_TARGETS = \'
echo >&3 'SCRIPTS = \'
for file in "$SAGE_SRC/bin/"*; do
echo >&3 " \$(SAGE_LOCAL)${file#$SAGE_SRC} \\"
done
Expand All @@ -500,7 +505,7 @@ for file in `find "$SAGE_SRC"/ext -type f`; do
echo >&3 " \$(SAGE_SRC)${file#$SAGE_SRC} \\"
done
echo >&3
echo >&3 'EXTCODE_TARGETS = \'
echo >&3 'EXTCODE = \'
for file in `find "$SAGE_SRC"/ext -type f`; do
echo >&3 " \$(SAGE_EXTCODE)${file#$SAGE_SRC/ext} \\"
done
Expand Down
20 changes: 20 additions & 0 deletions build/pkgs/cython/patches/gdbout.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- src.orig/Cython/Compiler/CmdLine.py 2013-05-11 07:46:55.000000000 +0200
+++ src/Cython/Compiler/CmdLine.py 2013-06-04 19:09:59.000000000 +0200
@@ -28,6 +28,7 @@ Options:
-w, --working <directory> Sets the working directory for Cython (the directory modules
are searched from)
--gdb Output debug information for cygdb
+ --gdb-outdir <directory> Specify gdb debug information output directory. Implies --gdb.

-D, --no-docstrings Strip docstrings from the compiled module.
-a, --annotate Produce a colorized HTML version of the source.
@@ -138,6 +125,9 @@ def parse_command_line(args):
elif option == "--gdb":
options.gdb_debug = True
options.output_dir = os.curdir
+ elif option == "--gdb-outdir":
+ options.gdb_debug = True
+ options.output_dir = pop_arg()
elif option == '-2':
options.language_level = 2
elif option == '-3':
2 changes: 1 addition & 1 deletion src/bin/sage-banner
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.1.beta0, Release Date: 2013-12-19
│ Sage Version 6.1.beta2, Release Date: 2013-12-23
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
Expand Down
4 changes: 2 additions & 2 deletions src/bin/sage-version.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sage version information for shell scripts
# This file is auto-generated by the sage-update-version script, do not edit!
SAGE_VERSION='6.1.beta0'
SAGE_RELEASE_DATE='2013-12-19'
SAGE_VERSION='6.1.beta2'
SAGE_RELEASE_DATE='2013-12-23'
7 changes: 0 additions & 7 deletions src/c_lib/include/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,6 @@ static inline void _sig_off_(const char* file, int line)
#define sig_str(message) _sig_on_(message)
#define sig_off() _sig_off_(__FILE__, __LINE__)

/* These deprecated macros provide backwards compatibility with
* sage-4.6 and earlier */
#define _sig_on {if (!_sig_on_(NULL)) return 0;}
#define _sig_str(s) {if (!_sig_on_(s)) return 0;}
#define _sig_off {_sig_off_(__FILE__, __LINE__);}


/* sig_check() should be functionally equivalent to sig_on(); sig_off();
* but much faster. Essentially, it checks whether we missed any
* interrupts.
Expand Down
12 changes: 10 additions & 2 deletions src/c_lib/src/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,11 @@ void sage_signal_handler(int sig)


/* This calls the externally defined function _signals.raise_exception
* to actually raise the exception. It may only be called synchronously
* with the Global Interpreter Lock held. */
* to actually raise the exception. Since it uses the Python API, the
* GIL needs to be acquired first. */
static void do_raise_exception(int sig)
{
PyGILState_STATE gilstate_save = PyGILState_Ensure();
#if ENABLE_DEBUG_INTERRUPT
struct timeval raisetime;
if (sage_interrupt_debug_level >= 2) {
Expand All @@ -235,6 +236,8 @@ static void do_raise_exception(int sig)
_signals.raise_exception(sig, _signals.s);
assert(PyErr_Occurred());
}

PyGILState_Release(gilstate_save);
}


Expand Down Expand Up @@ -268,7 +271,12 @@ void _sig_off_warning(const char* file, int line)
{
char buf[320];
snprintf(buf, sizeof(buf), "sig_off() without sig_on() at %s:%i", file, line);

/* Raise a warning with the Python GIL acquired */
PyGILState_STATE gilstate_save = PyGILState_Ensure();
PyErr_WarnEx(PyExc_RuntimeWarning, buf, 2);
PyGILState_Release(gilstate_save);

print_backtrace();
}

Expand Down
36 changes: 18 additions & 18 deletions src/c_lib/src/mpn_pylong.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
* Date: March 2006
* License: GPL v2 or later
*
* the code to change the base to 2^SHIFT is based on the function
* the code to change the base to 2^PyLong_SHIFT is based on the function
* mpn_get_str from GNU MP, but the new bugs are mine
*
* this is free software: if it breaks, you get to keep all the pieces
*/

#include "mpn_pylong.h"

/* This code assumes that SHIFT < GMP_NUMB_BITS */
#if SHIFT >= GMP_NUMB_BITS
/* This code assumes that PyLong_SHIFT < GMP_NUMB_BITS */
#if PyLong_SHIFT >= GMP_NUMB_BITS
#error "Python limb larger than GMP limb !!!"
#endif

Expand Down Expand Up @@ -61,15 +61,15 @@ pylong_sizebits(digit *digits, py_size_t size) {
unsigned long cnt;
digit x;
if (size==0) return 0;
cnt = (size - 1) * SHIFT;
cnt = (size - 1) * PyLong_SHIFT;
x = digits[size - 1];
#if SHIFT > 32
#if PyLong_SHIFT > 32
if ((x >> 32) != 0) { x >>= 32; cnt += 32; }
#endif
#if SHIFT > 16
#if PyLong_SHIFT > 16
if ((x >> 16) != 0) { x >>= 16; cnt += 16; }
#endif
#if SHIFT > 8
#if PyLong_SHIFT > 8
if ((x >> 8) != 0) { x >>= 8; cnt += 8; }
#endif
return cnt + ((x & 0x80) ? 8 : __sizebits_tab[x]);
Expand All @@ -81,7 +81,7 @@ pylong_sizebits(digit *digits, py_size_t size) {
int
mpn_pylong_size (mp_ptr up, mp_size_t un)
{
return (mpn_sizebits(up, un) + SHIFT - 1) / SHIFT;
return (mpn_sizebits(up, un) + PyLong_SHIFT - 1) / PyLong_SHIFT;
}

/* this is based from GMP code in mpn/get_str.c */
Expand All @@ -106,19 +106,19 @@ mpn_get_pylong (digit *digits, py_size_t size, mp_ptr up, mp_size_t un)

i = un - 1;
n1 = up[i];
bit_pos = size * SHIFT - i * GMP_NUMB_BITS;
bit_pos = size * PyLong_SHIFT - i * GMP_NUMB_BITS;

for (;;)
{
bit_pos -= SHIFT;
bit_pos -= PyLong_SHIFT;
while (bit_pos >= 0)
{
*--s = (n1 >> bit_pos) & MASK;
bit_pos -= SHIFT;
*--s = (n1 >> bit_pos) & PyLong_MASK;
bit_pos -= PyLong_SHIFT;
}
if (i == 0)
break;
n0 = (n1 << -bit_pos) & MASK;
n0 = (n1 << -bit_pos) & PyLong_MASK;
n1 = up[--i];
bit_pos += GMP_NUMB_BITS;
*--s = n0 | (n1 >> bit_pos);
Expand Down Expand Up @@ -150,22 +150,22 @@ mpn_set_pylong (mp_ptr up, mp_size_t un, digit *digits, py_size_t size)

i = un - 1;
n1 = 0;
bit_pos = size * SHIFT - i * GMP_NUMB_BITS;
bit_pos = size * PyLong_SHIFT - i * GMP_NUMB_BITS;

for (;;)
{
bit_pos -= SHIFT;
bit_pos -= PyLong_SHIFT;
while (bit_pos >= 0)
{
d = (mp_limb_t) *--s;
n1 |= (d << bit_pos) & GMP_NUMB_MASK;
bit_pos -= SHIFT;
bit_pos -= PyLong_SHIFT;
}
if (i == 0)
break;
d = (mp_limb_t) *--s;
/* add some high bits of d; maybe none if bit_pos=-SHIFT */
up[i--] = n1 | (d & MASK) >> -bit_pos;
/* add some high bits of d; maybe none if bit_pos=-PyLong_SHIFT */
up[i--] = n1 | (d & PyLong_MASK) >> -bit_pos;
bit_pos += GMP_NUMB_BITS;
n1 = (d << bit_pos) & GMP_NUMB_MASK;
}
Expand Down
8 changes: 4 additions & 4 deletions src/c_lib/src/mpz_pylong.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mpz_get_pylong(mpz_srcptr z)
{
mpn_get_pylong(l->ob_digit, size, z->_mp_d, abs(z->_mp_size));
if (z->_mp_size < 0)
l->ob_size = -(l->ob_size);
Py_SIZE(l) = -Py_SIZE(l);
}

return (PyObject *) l;
Expand Down Expand Up @@ -68,13 +68,13 @@ mpz_set_pylong(mpz_ptr z, PyObject * ll)
return -1;
}

size = mpn_size_from_pylong(l->ob_digit, abs(l->ob_size));
size = mpn_size_from_pylong(l->ob_digit, abs(Py_SIZE(l)));

if (z->_mp_alloc < size)
_mpz_realloc (z, size);

mpn_set_pylong(z->_mp_d, size, l->ob_digit, abs(l->ob_size));
z->_mp_size = l->ob_size < 0 ? -size : size;
mpn_set_pylong(z->_mp_d, size, l->ob_digit, abs(Py_SIZE(l)));
z->_mp_size = Py_SIZE(l) < 0 ? -size : size;

return size;
}
Expand Down
8 changes: 4 additions & 4 deletions src/c_lib/src/stdsage.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ void init_global_empty_tuple(void) {
/*
This function gets called whenever NTL calls Error().
s is the error message generated by NTL.
We just copy the error message into a global buffer, and then abort() to run
the usual interrupt machinery.
We raise a RuntimeError and then call sig_error() such that the
exception will be seen by sig_on().
*/
void global_NTL_error_callback(const char* s, void* context)
{
set_sage_signal_handler_message(s);
abort();
PyErr_SetString(PyExc_RuntimeError, s);
sig_error();
}


Expand Down
12 changes: 6 additions & 6 deletions src/doc/en/constructions/linear_codes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Sage can compute Hamming codes

::

sage: C = HammingCode(3,GF(3))
sage: C = codes.HammingCode(3,GF(3))
sage: C
Linear code of length 13, dimension 10 over Finite Field of size 3
sage: C.minimum_distance()
Expand All @@ -46,7 +46,7 @@ the four Golay codes

::

sage: C = ExtendedTernaryGolayCode()
sage: C = codes.ExtendedTernaryGolayCode()
sage: C
Linear code of length 12, dimension 6 over Finite Field of size 3
sage: C.minimum_distance()
Expand Down Expand Up @@ -74,7 +74,7 @@ a check matrix, and the dual code:

::

sage: C = HammingCode(3,GF(2))
sage: C = codes.HammingCode(3,GF(2))
sage: Cperp = C.dual_code()
sage: C; Cperp
Linear code of length 7, dimension 4 over Finite Field of size 2
Expand All @@ -90,7 +90,7 @@ a check matrix, and the dual code:
[0 0 0 1 1 1 1]
sage: C.dual_code()
Linear code of length 7, dimension 3 over Finite Field of size 2
sage: C = HammingCode(3,GF(4,'a'))
sage: C = codes.HammingCode(3,GF(4,'a'))
sage: C.dual_code()
Linear code of length 21, dimension 3 over Finite Field in a of size 2^2

Expand All @@ -102,7 +102,7 @@ implemented.

::

sage: C = HammingCode(3,GF(2))
sage: C = codes.HammingCode(3,GF(2))
sage: MS = MatrixSpace(GF(2),1,7)
sage: F = GF(2); a = F.gen()
sage: v1 = [a,a,F(0),a,a,F(0),a]
Expand All @@ -120,7 +120,7 @@ can use the matplotlib package included with Sage:

::

sage: C = HammingCode(4,GF(2))
sage: C = codes.HammingCode(4,GF(2))
sage: C
Linear code of length 15, dimension 11 over Finite Field of size 2
sage: w = C.weight_distribution(); w
Expand Down
Loading

0 comments on commit eb793cc

Please sign in to comment.