Re: [sage-devel] About SetPartition.to_permutation

2015-12-18 Thread Nathann Cohen
Yo, Please excuse my sarcastic responses before. I find it hard to deal with > being told off when trying to contribute. > Don't take it bad, it is the same for all of us here. Wanna know how many tickets I opened just to give them up two days later, because people did not like them

Re: [sage-devel] About SetPartition.to_permutation

2015-12-18 Thread 'Martin R' via sage-devel
I tried to point out a possible improvement to the SetPartition code in http://trac.sagemath.org/ticket/19737, because I used this code. I also provided a patch. I was told that the original code is nonsensical. I disagree. In fact, from a recent experience with sage now disallowing empty ro

Re: [sage-devel] About SetPartition.to_permutation

2015-12-18 Thread Dima Pasechnik
On Friday, 18 December 2015 09:23:55 UTC, Martin R wrote: > > > > Am Freitag, 18. Dezember 2015 09:39:57 UTC+1 schrieb Dima Pasechnik: >> >> >> >> On Friday, 18 December 2015 08:33:05 UTC, Martin R wrote: >>> >>> Actually, I propose to delete all code from sage, because it doesn't >>> work in al

Re: [sage-devel] About SetPartition.to_permutation

2015-12-18 Thread 'Martin R' via sage-devel
Am Freitag, 18. Dezember 2015 09:39:57 UTC+1 schrieb Dima Pasechnik: > > > > On Friday, 18 December 2015 08:33:05 UTC, Martin R wrote: >> >> Actually, I propose to delete all code from sage, because it doesn't work >> in all circumstances. >> >> It might be useful for some people (not all that m

Re: [sage-devel] About SetPartition.to_permutation

2015-12-18 Thread Dima Pasechnik
On Friday, 18 December 2015 08:33:05 UTC, Martin R wrote: > > Actually, I propose to delete all code from sage, because it doesn't work > in all circumstances. > > It might be useful for some people (not all that many), but we are > actually doing them a favour because we save them from using s

Re: [sage-devel] About SetPartition.to_permutation

2015-12-18 Thread 'Martin R' via sage-devel
Actually, I propose to delete all code from sage, because it doesn't work in all circumstances. It might be useful for some people (not all that many), but we are actually doing them a favour because we save them from using software in circumstances where it doesn't apply. Thus, by deleting sa

Re: [sage-devel] About SetPartition.to_permutation

2015-12-17 Thread Nathann Cohen
Yo, > It is perfectly valid for a method to raise an error if the current instance > does not meet certain criteria. I feel a double standard here with > multiedges and loops... If you consider it my responsibility to write, fix and manage the loops/mutiedges code for graphs we have a problem. It

Re: [sage-devel] About SetPartition.to_permutation

2015-12-17 Thread Travis Scrimshaw
Hey Nathann, On Thursday, December 17, 2015 at 8:33:48 PM UTC-6, Nathann Cohen wrote: > > > That would completely over-engineer things, be backwards incompatible, > and > > would make users hate us. This is why we have exceptions. > > Stick to that "would make users hate us" thought and look at

Re: [sage-devel] About SetPartition.to_permutation

2015-12-17 Thread Nathann Cohen
> That would completely over-engineer things, be backwards incompatible, and > would make users hate us. This is why we have exceptions. Stick to that "would make users hate us" thought and look at what we have: - A method that "sometimes work, and sometimes does not", because it does not apply t

Re: [sage-devel] About SetPartition.to_permutation

2015-12-17 Thread Travis Scrimshaw
> > > How can we check that the ground set is totally ordered? > > No idea. Furthermore, a set could be "totally ordered" because Python > compares the elements according to their memory address. That's a > total order, but totally unreliable as well. > There is sort of a way to do this i

Re: [sage-devel] About SetPartition.to_permutation

2015-12-17 Thread Nathann Cohen
Hello, > How can we check that the ground set is totally ordered? No idea. Furthermore, a set could be "totally ordered" because Python compares the elements according to their memory address. That's a total order, but totally unreliable as well. > Given such a > check, we could simply raise an

Re: [sage-devel] About SetPartition.to_permutation

2015-12-17 Thread 'Martin R' via sage-devel
Am Donnerstag, 17. Dezember 2015 14:12:06 UTC+1 schrieb Nathann Cohen: > > > If you have an *ordered set* there is a canonical way to define one > > permutation from a partition. You make it so that the atom of the > partitions > > are your cycles. > > Yeah, sort everything. Wonder when somet

Re: [sage-devel] About SetPartition.to_permutation

2015-12-17 Thread Nathann Cohen
> If you have an *ordered set* there is a canonical way to define one > permutation from a partition. You make it so that the atom of the partitions > are your cycles. Yeah, sort everything. Wonder when something like that can be useful. This being said, this class does not assume that the ground

Re: [sage-devel] About SetPartition.to_permutation

2015-12-17 Thread Vincent Delecroix
If you have an *ordered set* there is a canonical way to define one permutation from a partition. You make it so that the atom of the partitions are your cycles. And you order the cycle given by your order. As an example sage: p = SetPartition([[1,2,4],[3,5]]).to_permutation() sage: p [2, 4, 5