Re: [sage-devel] Re: SchemeMorphism inherits from Element ?!

2013-11-10 Thread Nicolas M. Thiery
Hi!

On Fri, Nov 08, 2013 at 09:47:08AM +, Simon King wrote:
> On 2013-11-08, Vincent Delecroix <20100.delecr...@gmail.com> wrote:
> > I was working with #15378 and I wondered why SchemeMorphism inherits
> > from Element and not from Morphism as they should.
> 
> It *should* in fact inherit from both. In fact, some time ago, I tried
> to provide both Morphism and Element as base classes for SchemeMorphism.
>
> The problem is: Python allows you to use both base classes (it believes
> that both base classes have a compatible layout), but then some cdef
> attribute of Element gets confused with some cdef attribute of Morphism.
> 
> Hence, in fact these two base classes do *not* have compatible layout,
> and it is a bug that Python does not raise an error when you try to
> create a class that uses both base classes at the same time.

I am a bit confused, since Morphism already inherits from Element:

sage: from sage.categories.morphism import Morphism
sage: Morphism.mro()
[sage.categories.morphism.Morphism, sage.categories.map.Map,
 sage.structure.element.Element, ...]

Anyway, I am going to widen a bit the scope of the discussion. On a
similar note, we have a long waiting need for implementing parents
that are also elements. No longer than Wednesday, that was requested
again by Eric during his description of his sage-manifold library. So
this might be a good time to think about how to implement this
feature.

> So, in this case, multiple inheritance is a no-op, and thus the
> category framework is your friend...

Well, up to one detail: the category framework somewhat assumes that
parents inherit from Parent, elements from Element, and morphisms from
Morphism. Namely I guess in theory you could construct a parent not
inheriting from Parent, but it would have to duplicate the logic for
setting the class properly to inherit from categories, and there might
be some minor glitches elsewhere where some code does sanity checks
like:

assert isinstance(p, Parent)

I guess that, to move forward, we should implement two classes:

class ElementAndParent(...):

(and maybe variants like ParentAndMorphism, CategoryAndParent ...)

I guess it's all fine if those classes are Python classes, at least
for now; that's more for more advanced objects where pure speed is not
as critical as for basic arithmetic elements.

Then we have two options:

- Either there is a way to make ElementAndParent inherit both from
  Parent and Element by changing the layout of the base classes to be
  compatible (this sounds unlikely, but I am not an expert).

- Or we should fix the category framework so that everything that
  quacks like an Element is accepted as an Element, and hopefully with
  minimal duplication of the inheritance-from-category handling.

Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

-- 
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/groups/opt_out.


[sage-devel] New Orthogonal Polynomials - The second try

2013-11-10 Thread maldun
Hi!

after some years and finishing my Phd, I finally found some time and the 
need to implement a new version of orthogonal polynomials.
Over the time I have many valuable lessons learned, and I now want to make 
the whole development trough.

I posted a new patch on http://trac.sagemath.org/ticket/9706 and ask for 
review.
but this time I don't want to add all polys at once, but only add the 
chebyshev polys first, and when this patch works and has positive review I 
add the next classes.
I hope this way it is less frustrating, for me and the reviewer, because it 
is a whole bunch of code, and its tiring to test and look through about 
2000 lines of code.

Hope this approach is ok for you, but I think it is better the get new 
polys every few version, instead of getting no new classes.

cheers maldun 


-- 
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/groups/opt_out.


[sage-devel] Re: SchemeMorphism inherits from Element ?!

2013-11-10 Thread Simon King
Hi Nicolas,

On 2013-11-10, Nicolas M. Thiery  wrote:
> I am a bit confused, since Morphism already inherits from Element:

Yes, sorry, I meant to say: "ModuleElement".

> Anyway, I am going to widen a bit the scope of the discussion. On a
> similar note, we have a long waiting need for implementing parents
> that are also elements. No longer than Wednesday, that was requested
> again by Eric during his description of his sage-manifold library. So
> this might be a good time to think about how to implement this
> feature.

In one way this would be easier than a parent that at the same time is a
category. Namely, parents and categories have features that are called
the same but have a totally different meaning, such as:
Parent.element_class versus Category.element_class. For Parent versus
Element, I think different features are called differently.

However, Python knows that the base classes are incompatible:
  sage: from sage.structure.element import Element
  sage: from sage.structure.parent import Parent
  sage: class C(Parent, Element): pass
  Traceback (most recent call last):
  ...
  TypeError: Error when calling the metaclass bases
  multiple bases have instance lay-out conflict


> I guess that, to move forward, we should implement two classes:
>
>   class ElementAndParent(...):
>
> (and maybe variants like ParentAndMorphism, CategoryAndParent ...)

Modulo lay-out conflicts...

> - Either there is a way to make ElementAndParent inherit both from
>   Parent and Element by changing the layout of the base classes to be
>   compatible (this sounds unlikely, but I am not an expert).
>
> - Or we should fix the category framework so that everything that
>   quacks like an Element is accepted as an Element, and hopefully with
>   minimal duplication of the inheritance-from-category handling.

The latter sounds easier (but slower) to me.

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


[sage-devel] compile sage from github

2013-11-10 Thread Ralf Hemmecke
Hello!

I've cloned from git://github.com/sagemath/sage.git
(094712a Merge in bug fixes for the dev scripts)
and typed "make" on a (relatively minimal) Debian 7 Installation.

I didn't know whether such a step would actually succeed, since I
haven't yet been able to find a description that such a simple "make"
would work. So I didn't expect success.

But I am somewhat surprised that the build fails at building git (see
below). :-(

My Debian system says:
  git version 1.7.10.4
and Sage wants to build 1.7.12.2.

Is there really any reason why Sage wouldn't be satisfied with a smaller
version number. What super features are used when building/developing
sage that justify the need for 1.7.12.2?

What actually surprises me is that Sage must build git at all. Wouldn't
it make sense to restrict build and development scripts to use features
of a git version number that is usually satisfied by current major
stable distributions and build git only when this is not fuflilled for
some very old distribution. Note that git must have been installed,
since I have (successfully) cloned sage from github.

Ralf

=

Manifying blib/man3/Git.3pm
make[5]: Leaving directory
`/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/perl'
make[4]: Leaving directory
`/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/perl'
make[4]: Entering directory
`/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/git_remote_helpers'
make[4]: Leaving directory
`/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/git_remote_helpers'
make[4]: Entering directory
`/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/templates'
make[4]: Leaving directory
`/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/templates'
MSGFMT po/build/locale/da/LC_MESSAGES/git.mo
/bin/sh: 1: msgfmt: not found
make[3]: *** [po/build/locale/da/LC_MESSAGES/git.mo] Error 127
make[3]: Leaving directory
`/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src'
Error building git.

real1m20.508s
user1m2.884s
sys 0m7.028s

Error installing package git-1.7.12.2.p0

Please email sage-devel (http://groups.google.com/group/sage-devel)
explaining the problem and including the relevant part of the log file
  /home/me/v/git/sage/logs/pkgs/git-1.7.12.2.p0.log
Describe your computer, operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0 and type
'make' or whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
  (cd '/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0' &&
'/home/me/v/git/sage/sage' --sh)
When you are done debugging, you can type "exit" to leave the subshell.

make[2]: ***
[/home/me/v/git/sage/local/var/lib/sage/installed/git-1.7.12.2.p0] Error 1
make[2]: Leaving directory `/home/me/v/git/sage/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/me/v/git/sage/build'

real159m35.587s
user120m8.078s
sys 8m16.735s
***
Error building Sage.

The following package(s) may have failed to build:

package: git-1.7.12.2.p0
log file: /home/me/v/git/sage/logs/pkgs/git-1.7.12.2.p0.log
build directory:
/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0

The build directory may contain configuration files and other potentially
helpful information. WARNING: if you now run 'make' again, the build
directory will, by default, be deleted. Set the environment variable
SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.

make: *** [build] Error 1

-- 
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/groups/opt_out.


Re: [sage-devel] compile sage from github

2013-11-10 Thread Vincent Delecroix
Hi,

The part of the log you paste is not long enough. I guess you need to
install msgfmt which is not part of standard debain. The name of the
package is gettext.

Does anybody know why git is a standard spkg ? It is likely that
anybody has his/her own git...

Vincent


2013/11/10, Ralf Hemmecke :
> Hello!
>
> I've cloned from git://github.com/sagemath/sage.git
> (094712a Merge in bug fixes for the dev scripts)
> and typed "make" on a (relatively minimal) Debian 7 Installation.
>
> I didn't know whether such a step would actually succeed, since I
> haven't yet been able to find a description that such a simple "make"
> would work. So I didn't expect success.
>
> But I am somewhat surprised that the build fails at building git (see
> below). :-(
>
> My Debian system says:
>   git version 1.7.10.4
> and Sage wants to build 1.7.12.2.
>
> Is there really any reason why Sage wouldn't be satisfied with a smaller
> version number. What super features are used when building/developing
> sage that justify the need for 1.7.12.2?
>
> What actually surprises me is that Sage must build git at all. Wouldn't
> it make sense to restrict build and development scripts to use features
> of a git version number that is usually satisfied by current major
> stable distributions and build git only when this is not fuflilled for
> some very old distribution. Note that git must have been installed,
> since I have (successfully) cloned sage from github.
>
> Ralf
>
> =
>
> Manifying blib/man3/Git.3pm
> make[5]: Leaving directory
> `/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/perl'
> make[4]: Leaving directory
> `/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/perl'
> make[4]: Entering directory
> `/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/git_remote_helpers'
> make[4]: Leaving directory
> `/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/git_remote_helpers'
> make[4]: Entering directory
> `/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/templates'
> make[4]: Leaving directory
> `/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src/templates'
> MSGFMT po/build/locale/da/LC_MESSAGES/git.mo
> /bin/sh: 1: msgfmt: not found
> make[3]: *** [po/build/locale/da/LC_MESSAGES/git.mo] Error 127
> make[3]: Leaving directory
> `/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0/src'
> Error building git.
>
> real  1m20.508s
> user  1m2.884s
> sys   0m7.028s
> 
> Error installing package git-1.7.12.2.p0
> 
> Please email sage-devel (http://groups.google.com/group/sage-devel)
> explaining the problem and including the relevant part of the log file
>   /home/me/v/git/sage/logs/pkgs/git-1.7.12.2.p0.log
> Describe your computer, operating system, etc.
> If you want to try to fix the problem yourself, *don't* just cd to
> /home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0 and type
> 'make' or whatever is appropriate.
> Instead, the following commands setup all environment variables
> correctly and load a subshell for you to debug the error:
>   (cd '/home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0' &&
> '/home/me/v/git/sage/sage' --sh)
> When you are done debugging, you can type "exit" to leave the subshell.
> 
> make[2]: ***
> [/home/me/v/git/sage/local/var/lib/sage/installed/git-1.7.12.2.p0] Error 1
> make[2]: Leaving directory `/home/me/v/git/sage/build'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/home/me/v/git/sage/build'
>
> real  159m35.587s
> user  120m8.078s
> sys   8m16.735s
> ***
> Error building Sage.
>
> The following package(s) may have failed to build:
>
> package: git-1.7.12.2.p0
> log file: /home/me/v/git/sage/logs/pkgs/git-1.7.12.2.p0.log
> build directory:
> /home/me/v/git/sage/local/var/tmp/sage/build/git-1.7.12.2.p0
>
> The build directory may contain configuration files and other potentially
> helpful information. WARNING: if you now run 'make' again, the build
> directory will, by default, be deleted. Set the environment variable
> SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.
>
> make: *** [build] Error 1
>
> --
> 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/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsu

[sage-devel] ggplot and L. Wilkinson's "Grammar of Graphics"

2013-11-10 Thread Ursin Solèr
Hello all!

I was just wondering whether it could be a good idea to include ggplot
[1] with SAGE. What do you think about that? Was it already discussed once?

[1] https://github.com/yhat/ggplot/

Thanks a lot and Greetings
Ursin Solèr

-- 
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/groups/opt_out.


Re: [sage-devel] compile sage from github

2013-11-10 Thread Felix Salfelder
On Sun, Nov 10, 2013 at 04:56:58PM +0100, Ralf Hemmecke wrote:
> What actually surprises me is that Sage must build git at all. Wouldn't
> it make sense to restrict build and development scripts to use features
> of a git version number that is usually satisfied by current major
> stable distributions and build git only when this is not fuflilled for
> some very old distribution. Note that git must have been installed,
> since I have (successfully) cloned sage from github.

Hi Ralf.

I have addressed this problem within my gsoc project. the solution is a
configurable toplevel build system that allows to choose between "build
stuff shipped with sage (the distribution)" and "fallback to already
installed software" on a per-package basis. see [1] for instructions on
how to build a demo sage (the distribution) on top of debian.

if this is of any use, you may want to help to integrate a proper build
system for sagelib [2], and eventually finish the toplevel build system
described above [3].

good luck
felix

[1] https://wiki.debian.org/DebianScience/Sage
[2] http://trac.sagemath.org/ticket/14807
[3] http://trac.sagemath.org/ticket/14796

-- 
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/groups/opt_out.


Re: [sage-devel] compile sage from github

2013-11-10 Thread Ralf Hemmecke
> The part of the log you paste is not long enough. I guess you need to
> install msgfmt which is not part of standard debain. The name of the
> package is gettext.

Thanks. I'd probably found that myself. But of course, that was not my
point.

> Does anybody know why git is a standard spkg ? It is likely that
> anybody has his/her own git...

That comes closer. Wouldn't it make sense to let (sage-)configure test
whether the features of an installed git are already sufficient? I
personally would get confused if sage used its own git.

Ralf

-- 
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/groups/opt_out.


Re: [sage-devel] compile sage from github

2013-11-10 Thread Vincent Delecroix
2013/11/10, Felix Salfelder :
> On Sun, Nov 10, 2013 at 04:56:58PM +0100, Ralf Hemmecke wrote:
>> What actually surprises me is that Sage must build git at all. Wouldn't
>> it make sense to restrict build and development scripts to use features
>> of a git version number that is usually satisfied by current major
>> stable distributions and build git only when this is not fuflilled for
>> some very old distribution. Note that git must have been installed,
>> since I have (successfully) cloned sage from github.
>
> Hi Ralf.
>
> I have addressed this problem within my gsoc project. the solution is a
> configurable toplevel build system that allows to choose between "build
> stuff shipped with sage (the distribution)" and "fallback to already
> installed software" on a per-package basis. see [1] for instructions on
> how to build a demo sage (the distribution) on top of debian.
>
> if this is of any use, you may want to help to integrate a proper build
> system for sagelib [2], and eventually finish the toplevel build system
> described above [3].
>
> good luck
> felix
>
> [1] https://wiki.debian.org/DebianScience/Sage
> [2] http://trac.sagemath.org/ticket/14807
> [3] http://trac.sagemath.org/ticket/14796

Hi Felix,

I guess that it is one solution but not necessarily the solution ;-) I
am also convinced that it is the best one. I would be happy to be part
of that project but I am wondering if it is worth it. As it is
mentioned on the debian wiki, some of the sage packages are patched.
This implies that you can not really use the system versions. If there
is no obligation of having non-patched spkg I do not see how this
project can work. I do really think that this is the best of what can
happen for Sage but I also think that we need an agreement of all Sage
developers that spkg can not be patched...

All best,
Vincent

-- 
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/groups/opt_out.


Re: [sage-devel] compile sage from github

2013-11-10 Thread Felix Salfelder
On Sun, Nov 10, 2013 at 01:02:30PM -0500, Vincent Delecroix wrote:

> I do really think that this is the best of what can
> happen for Sage but I also think that we need an agreement of all Sage
> developers that spkg can not be patched...

actually, it's the other way around. if there were no patched/bleeding
edge packages within sage-the-distribution, there was no need for that
toplevel build system -- you could just run standalone sagelib on top of
anything you like.

the idea is to run sage (the distribution) on top of (e.g.) debian. and
only compile packages that deviate from upstream or the (e.g.) debian
package. particularly, this enables you to *develop* sage within
sage-the-distrition on top of any other software distribution without
unnecessarily compiling hundreds of spkgs (like git).

regards
felix

-- 
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/groups/opt_out.


[sage-devel] "Installation tree has moved"---no it hasn't!

2013-11-10 Thread Simon King
Hi!

I was building Sage from scratch following the instructions on
http://wiki.sagemath.org/TentativeConventions

When I started Sage for the first time after running "make -j4", it says
  The Sage installation tree has moved
  from /mnt/local/king/SAGE/sage-git/SAGE_ROOT=/mnt/local/king/SAG
to /mnt/local/king/SAGE/sage-git
  Updating various hardcoded paths...

But that's odd. The Sage installation tree has *not* moved. I have cloned
the git repository into /mnt/local/king/SAGE/sage-git, built everything
there, and did not change a thing afterwards.

Do you have any idea of what might have happened here?

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