Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge sage's numpy.pxd with the cython numpy.pxd #4571

Closed
jasongrout opened this issue Nov 20, 2008 · 19 comments
Closed

merge sage's numpy.pxd with the cython numpy.pxd #4571

jasongrout opened this issue Nov 20, 2008 · 19 comments

Comments

@jasongrout
Copy link
Member

[15:53] <robertwb> yep, we should merge them

CC: @robertwb @sagetrac-dagss

Component: numerical

Author: Robert Bradshaw, Dag Sverre Seljebotn

Reviewer: Robert Bradshaw, Dag Sverre Seljebotn, Minh Van Nguyen

Merged: Sage 4.1.1.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/4571

@robertwb
Copy link
Contributor

comment:1

See http://trac.cython.org/cython_trac/ticket/339

@robertwb
Copy link
Contributor

Attachment: 4571-numpy-pxd.patch.gz

@robertwb
Copy link
Contributor

comment:3

Preliminary patch, need a new Cython spkg for it to work all the way.

@sagetrac-dagss
Copy link
Mannequin

sagetrac-dagss mannequin commented Jul 7, 2009

comment:4

Attachment: 4571-more-fixes.patch.gz

Here are some more fixes. With this, and the latest state of the

http://hg.cython.org/cython

repo, all the relevant tests seem to pass. I do get two failures (due to Cython upgrade? something else?), see test.log in

/home/dagss/sage-4.0.2-sage.math.washington.edu-x86_64-Linux

Once this works let's tag http://hg.cython.org/cython as 0.11.2.1 for #6438?

@sagetrac-dagss
Copy link
Mannequin

sagetrac-dagss mannequin commented Jul 7, 2009

comment:5

Note (re: discussion on Cython ML) that shape in numpy.pxd is still a field, long story (well, it is performance critical), and I shouldn't change it.

@sagetrac-dagss
Copy link
Mannequin

sagetrac-dagss mannequin commented Jul 7, 2009

comment:6

Another quick comment: With this, full Cython/NumPy functionality is available from the notebook and works well.

@robertwb
Copy link
Contributor

robertwb commented Jul 9, 2009

comment:7

Those errors seem completely unrelated, I'll see if I get them too. Other than that, it looks really good.

I've used Cython + NumPy from the notebook before, as long as you weren't in sage.ext then "cimport numpy" worked as expected (though there was a point where it didn't).

@robertwb
Copy link
Contributor

comment:8

Hmm... I also got

The following tests failed:

        sage -t -long devel/sage-main/sage/rings/polynomial/polynomial_template.pxi # 1 doctests failed
        sage -t -long devel/sage-main/sage/interfaces/sage0.py # 1 doctests failed

@robertwb
Copy link
Contributor

comment:9

Looks good. The single doctest failure was minor, fixed in #6438.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 22, 2009

Reviewer: Robert Bradshaw, Dag Sverre Seljebotn

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 22, 2009

Author: Robert Bradshaw, Dag Sverre Seljebotn

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 22, 2009

comment:11

Replying to @sagetrac-dagss:

Here are some more fixes. With this, and the latest state of the

The patch 4571-more-fixes.patch doesn't contain a commit message and your username is not on the patch. Your username should follow the format:

Full Name <email@somewhere.com>

The username makes it easy to identify the patch, when it is committed, as your contribution.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 23, 2009

comment:12

With both patches applied in the following order:

  1. 4571-numpy-pxd.patch
  2. 4571-more-fixes.patch
    I see the following build failure:
[mvngu@sage sage-4.1.1.alpha0]$ ./sage -br main

----------------------------------------------------------
sage: Building and installing modified Sage library files.


Installing c_lib
scons: `install' is up to date.
Updating Cython code....
Building modified file sage/finance/time_series.pyx.
Building modified file sage/matrix/change_ring.pyx.
Building modified file sage/matrix/matrix_complex_double_dense.pyx.
Building modified file sage/matrix/matrix_double_dense.pyx.
Building modified file sage/matrix/matrix_real_double_dense.pyx.
Building modified file sage/modules/vector_complex_double_dense.pyx.
Building modified file sage/modules/vector_double_dense.pyx.
Building modified file sage/modules/vector_real_double_dense.pyx.
Building sage/rings/polynomial/real_roots.pyx because it depends on sage/modules/vector_double_dense.pxd.
Building sage/stats/hmm/chmm.pyx because it depends on sage/matrix/matrix_double_dense.pxd.
Building sage/stats/hmm/hmm.pyx because it depends on sage/matrix/matrix_double_dense.pxd.
python `which cython` --embed-positions --incref-local-binop -I/scratch/mvngu/release/sage-4.1.1.alpha0/devel/sage-main -o sage/finance/time_series.c sage/finance/time_series.pyx
warning: /scratch/mvngu/release/sage-4.1.1.alpha0/devel/sage-main/sage/finance/time_series.pyx:1722:24: cdef variable 'j' declared after it is used

Error converting Pyrex file to C:
------------------------------------------------------------
...
            [20.0000, -3.0000, 4.5000, -2.0000]
        """
        cnumpy.import_array() #This must be called before using the numpy C/api or you will get segfault
        cdef cnumpy.npy_intp dims[1]
        dims[0] = self._length
        cdef cnumpy.ndarray n = cnumpy.PyArray_SimpleNewFromData(1, dims, cnumpy.NPY_DOUBLE, self._values)
                                                                       ^
------------------------------------------------------------

/scratch/mvngu/release/sage-4.1.1.alpha0/devel/sage-main/sage/finance/time_series.pyx:1862:72: Cannot convert 'numpy.npy_intp [1]' to Python object

Error converting Pyrex file to C:
------------------------------------------------------------
...
            [20.0000, -3.0000, 4.5000, -2.0000]
        """
        cnumpy.import_array() #This must be called before using the numpy C/api or you will get segfault
        cdef cnumpy.npy_intp dims[1]
        dims[0] = self._length
        cdef cnumpy.ndarray n = cnumpy.PyArray_SimpleNewFromData(1, dims, cnumpy.NPY_DOUBLE, self._values)
                                                                                                ^
------------------------------------------------------------

/scratch/mvngu/release/sage-4.1.1.alpha0/devel/sage-main/sage/finance/time_series.pyx:1862:97: Cannot convert 'double *' to Python object
Error running command, failed with status 256.
sage: There was an error installing modified sage library code.

@robertwb
Copy link
Contributor

comment:13

Looks like it'll have to be rebased, worked fine on vanilla 4.1. Where's the .tar on sage.math?

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 23, 2009

comment:14

Replying to @robertwb:

Looks like it'll have to be rebased, worked fine on vanilla 4.1. Where's the .tar on sage.math?

Source and binary versions are up at

http://sage.math.washington.edu/home/mvngu/release/sage-4.1.1.alpha0.tar

http://sage.math.washington.edu/home/mvngu/release/sage-4.1.1.alpha0-sage.math.washignton.edu-x86_64-Linux.tar.gz

@robertwb
Copy link
Contributor

comment:15

Works fine form me. sage-4.1.1.alpha0-sage.math.washignton.edu-x86_64-Linux.tar.gz + #6438 + #4571. Are you sure applied the latest Cython spkg first? 4.1.1.alpha0 doesn't seem to have it.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 25, 2009

Changed reviewer from Robert Bradshaw, Dag Sverre Seljebotn to Robert Bradshaw, Dag Sverre Seljebotn, Minh Van Nguyen

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 25, 2009

comment:17

dagss: The patch 4571-more-fixes.patch doesn't contain your username. I'm committing it in your name. Merged in this order

  1. the SPKG at Upgrade to Cython 0.11.2 #6438
  2. 4571-numpy-pxd.patch
  3. 4571-more-fixes.patch

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 25, 2009

Merged: Sage 4.1.1.alpha1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants