[sage-devel] Re: Lollipop vs. Barbell

2017-02-03 Thread David Coudert


Le mardi 29 novembre 2016 17:42:51 UTC+1, Peleg Michaeli a écrit :
>
> Dear list members,
>
> I was wondering what really makes the difference between the graph 
> generators in `basic.py` and those in `families.py`.
>

When we created the directory `generators` to split a big file with plenty 
of generators into smaller files, we planed to put in `basic.py` graphs 
without parameters (HouseGraph, PetersenGraph, etc.) and graphs like path, 
cycle, clique, grids, etc. so basic graphs, and in `families.py` more 
complex graphs. Now we have `smallgraphs.py`. So we could now move graphs 
without parameter from basic to into `smallgraphs.py`,  the others from 
basic to families, and to remove file basic.py.

 

>
> For one concrete example, I was wondering why `LollipopGraph` appears in 
> `basic.py` and `BarbellGraph` appears in `families.py`. These two graphs 
> are very similar.
>
> Added at different period of time, so we need to reorganize these files.

 

> I ask this for a practical reason: I would like to add a couple of graph 
> families, including the Tadpole graph (which is very similar to the 
> Lollipop graph and the Barbell graph) and the Dipole graph (which is one of 
> the simplest multigraphs).
>

Good !.

Concerning the problem with range, as said by others, the simple fix is 
list(range(...)).

Best (and welcome).
 

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


Re: [sage-devel] Re: Lollipop vs. Barbell

2016-12-07 Thread Travis Scrimshaw
Minor note, Cython code will still use xrange, but it can (often?) optimize 
calls to range.

Best,
Travis


On Wednesday, December 7, 2016 at 5:00:56 AM UTC-6, Thierry 
(sage-googlesucks@xxx) wrote:
>
> On Wed, Dec 07, 2016 at 01:05:47AM -0800, Peleg Michaeli wrote: 
> > I can wrap it with list indeed. I know that six.moves.range is an 
> iterator 
> > - in Python 2, it is simply xrange. But I was thinking that perhaps 
> Graph's 
> > constructor should be able to understand xrange (or rather, iterators in 
> > general) instead of lists when the data is a dictionary of neighbours. 
> > Perhaps it may even be more efficient in some cases. What do you think? 
>
> +1. I faced this problem during a workshop last month, where i had to deal 
> with a dict of sets and not a dict of lists (and the students were not at 
> ease with dict comprehension). 
>
> Ciao, 
> Thierry 
>
>
>
>
> > On Tuesday, 6 December 2016 22:41:31 UTC+2, Frédéric Chapoton wrote: 
> > > 
> > > The new (python3 or six) range is an iterator. You just have to wrap 
> it 
> > > with list( ) to get back to the python2 behaviour if needed. 
> > > 
> > > 
> > > Le mardi 6 décembre 2016 17:31:20 UTC+1, Frédéric Chapoton a écrit : 
> > >> 
> > >> DO NOT TOUCH the import of range from six.moves ! This is part of our 
> > >> general move toward python3 ! 
> > >> 
> > >> And do never use xrange, this is now forbidden. 
> > >> 
> > >> Frederic 
> > >> 
> > >> Le mardi 6 décembre 2016 16:26:12 UTC+1, Peleg Michaeli a écrit : 
> > >>> 
> > >>> I actually think that this is an unwanted behaviour of `six`. 
> > >>> 
> > >>> Anyway, we may let `Graph` handle xrange lists of neighbours if we 
> want 
> > >>> to keep it that way. 
> > >>> 
> > >>> On Tuesday, 6 December 2016 17:18:29 UTC+2, Peleg Michaeli wrote: 
> >  
> >  I have tried to move LollipopGraph into families, but there was a 
> >  problem. In families, there's the following import: 
> >  
> >  from six.moves import range 
> >  
> >  This overrides Python's range. I don't know why. The original 
> >  implementation of Lollipop graph uses Python's range, and when it 
> tries to 
> >  use the new (six.moves) range it fails (with "This input cannot be 
> turned 
> >  into a graph"). 
> >  
> >  I can clearly fix this, by setting something like python_range = 
> range 
> >  before the six.moves import, but it is not very elegant. I can also 
> use 
> >  networkx's implementation of LollipopGraph (as done with 
> BarbellGraph), but 
> >  I am not sure you consider this as the right direction to go. 
> >  
> >  What do you think? 
> >  
> >  On Wednesday, 30 November 2016 00:40:21 UTC+2, Dima Pasechnik 
> wrote: 
> > > 
> > > 
> > > 
> > > On Tuesday, November 29, 2016 at 4:42:51 PM UTC, Peleg Michaeli 
> wrote: 
> > >> 
> > >> Dear list members, 
> > >> 
> > >> I was wondering what really makes the difference between the 
> graph 
> > >> generators in `basic.py` and those in `families.py`. 
> > >> 
> > >> For one concrete example, I was wondering why `LollipopGraph` 
> appears 
> > >> in `basic.py` and `BarbellGraph` appears in `families.py`. These 
> two graphs 
> > >> are very similar. 
> > >> 
> > >> I ask this for a practical reason: I would like to add a couple 
> of 
> > >> graph families, including the Tadpole graph (which is very 
> similar to the 
> > >> Lollipop graph and the Barbell graph) and the Dipole graph (which 
> is one of 
> > >> the simplest multigraphs). 
> > >> 
> > >> What do you think? 
> > >> 
> > > 
> > > I think all of them could go into families.py 
> > >   
> > > 
> > >> 
> > >> 
> > >> Best, 
> > >> Peleg. 
> > >> 
> > > 
> > 
> > -- 
> > 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+...@googlegroups.com . 
> > To post to this group, send email to sage-...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sage-devel. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>

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


Re: [sage-devel] Re: Lollipop vs. Barbell

2016-12-07 Thread Thierry
On Wed, Dec 07, 2016 at 01:05:47AM -0800, Peleg Michaeli wrote:
> I can wrap it with list indeed. I know that six.moves.range is an iterator 
> - in Python 2, it is simply xrange. But I was thinking that perhaps Graph's 
> constructor should be able to understand xrange (or rather, iterators in 
> general) instead of lists when the data is a dictionary of neighbours. 
> Perhaps it may even be more efficient in some cases. What do you think?

+1. I faced this problem during a workshop last month, where i had to deal
with a dict of sets and not a dict of lists (and the students were not at
ease with dict comprehension).

Ciao,
Thierry




> On Tuesday, 6 December 2016 22:41:31 UTC+2, Frédéric Chapoton wrote:
> >
> > The new (python3 or six) range is an iterator. You just have to wrap it 
> > with list( ) to get back to the python2 behaviour if needed.
> >
> >
> > Le mardi 6 décembre 2016 17:31:20 UTC+1, Frédéric Chapoton a écrit :
> >>
> >> DO NOT TOUCH the import of range from six.moves ! This is part of our 
> >> general move toward python3 !
> >>
> >> And do never use xrange, this is now forbidden.
> >>
> >> Frederic
> >>
> >> Le mardi 6 décembre 2016 16:26:12 UTC+1, Peleg Michaeli a écrit :
> >>>
> >>> I actually think that this is an unwanted behaviour of `six`.
> >>>
> >>> Anyway, we may let `Graph` handle xrange lists of neighbours if we want 
> >>> to keep it that way.
> >>>
> >>> On Tuesday, 6 December 2016 17:18:29 UTC+2, Peleg Michaeli wrote:
> 
>  I have tried to move LollipopGraph into families, but there was a 
>  problem. In families, there's the following import:
> 
>  from six.moves import range
> 
>  This overrides Python's range. I don't know why. The original 
>  implementation of Lollipop graph uses Python's range, and when it tries 
>  to 
>  use the new (six.moves) range it fails (with "This input cannot be 
>  turned 
>  into a graph").
> 
>  I can clearly fix this, by setting something like python_range = range 
>  before the six.moves import, but it is not very elegant. I can also use 
>  networkx's implementation of LollipopGraph (as done with BarbellGraph), 
>  but 
>  I am not sure you consider this as the right direction to go.
> 
>  What do you think?
> 
>  On Wednesday, 30 November 2016 00:40:21 UTC+2, Dima Pasechnik wrote:
> >
> >
> >
> > On Tuesday, November 29, 2016 at 4:42:51 PM UTC, Peleg Michaeli wrote:
> >>
> >> Dear list members,
> >>
> >> I was wondering what really makes the difference between the graph 
> >> generators in `basic.py` and those in `families.py`.
> >>
> >> For one concrete example, I was wondering why `LollipopGraph` appears 
> >> in `basic.py` and `BarbellGraph` appears in `families.py`. These two 
> >> graphs 
> >> are very similar.
> >>
> >> I ask this for a practical reason: I would like to add a couple of 
> >> graph families, including the Tadpole graph (which is very similar to 
> >> the 
> >> Lollipop graph and the Barbell graph) and the Dipole graph (which is 
> >> one of 
> >> the simplest multigraphs).
> >>
> >> What do you think?
> >>
> >
> > I think all of them could go into families.py
> >  
> >
> >>
> >>
> >> Best,
> >> Peleg.
> >>
> >
> 
> -- 
> 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 https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

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


[sage-devel] Re: Lollipop vs. Barbell

2016-12-07 Thread Dima Pasechnik
It would be great to let Graph accept iterators. You are most welcome to work 
on this.

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


[sage-devel] Re: Lollipop vs. Barbell

2016-12-07 Thread Peleg Michaeli
I can wrap it with list indeed. I know that six.moves.range is an iterator 
- in Python 2, it is simply xrange. But I was thinking that perhaps Graph's 
constructor should be able to understand xrange (or rather, iterators in 
general) instead of lists when the data is a dictionary of neighbours. 
Perhaps it may even be more efficient in some cases. What do you think?

On Tuesday, 6 December 2016 22:41:31 UTC+2, Frédéric Chapoton wrote:
>
> The new (python3 or six) range is an iterator. You just have to wrap it 
> with list( ) to get back to the python2 behaviour if needed.
>
>
> Le mardi 6 décembre 2016 17:31:20 UTC+1, Frédéric Chapoton a écrit :
>>
>> DO NOT TOUCH the import of range from six.moves ! This is part of our 
>> general move toward python3 !
>>
>> And do never use xrange, this is now forbidden.
>>
>> Frederic
>>
>> Le mardi 6 décembre 2016 16:26:12 UTC+1, Peleg Michaeli a écrit :
>>>
>>> I actually think that this is an unwanted behaviour of `six`.
>>>
>>> Anyway, we may let `Graph` handle xrange lists of neighbours if we want 
>>> to keep it that way.
>>>
>>> On Tuesday, 6 December 2016 17:18:29 UTC+2, Peleg Michaeli wrote:

 I have tried to move LollipopGraph into families, but there was a 
 problem. In families, there's the following import:

 from six.moves import range

 This overrides Python's range. I don't know why. The original 
 implementation of Lollipop graph uses Python's range, and when it tries to 
 use the new (six.moves) range it fails (with "This input cannot be turned 
 into a graph").

 I can clearly fix this, by setting something like python_range = range 
 before the six.moves import, but it is not very elegant. I can also use 
 networkx's implementation of LollipopGraph (as done with BarbellGraph), 
 but 
 I am not sure you consider this as the right direction to go.

 What do you think?

 On Wednesday, 30 November 2016 00:40:21 UTC+2, Dima Pasechnik wrote:
>
>
>
> On Tuesday, November 29, 2016 at 4:42:51 PM UTC, Peleg Michaeli wrote:
>>
>> Dear list members,
>>
>> I was wondering what really makes the difference between the graph 
>> generators in `basic.py` and those in `families.py`.
>>
>> For one concrete example, I was wondering why `LollipopGraph` appears 
>> in `basic.py` and `BarbellGraph` appears in `families.py`. These two 
>> graphs 
>> are very similar.
>>
>> I ask this for a practical reason: I would like to add a couple of 
>> graph families, including the Tadpole graph (which is very similar to 
>> the 
>> Lollipop graph and the Barbell graph) and the Dipole graph (which is one 
>> of 
>> the simplest multigraphs).
>>
>> What do you think?
>>
>
> I think all of them could go into families.py
>  
>
>>
>>
>> Best,
>> Peleg.
>>
>

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


[sage-devel] Re: Lollipop vs. Barbell

2016-12-06 Thread Sébastien Labbé
Frédéric, Peleg is a new contributor to Sage that we met in recent Sage 
Days 79. I am sure he can understand the general move toward Python 3 if we 
are pedagogical. So thanks for your second reply that  appeared while I am 
writting this.

I know that you have been working hard on the -> Python 3 move. Is there a 
wiki page that gathers the road map for that move and all the stuff we have 
to change in our habits of coding with Python 2?

Sébastien

On Tuesday, December 6, 2016 at 5:31:20 PM UTC+1, Frédéric Chapoton wrote:
>
> DO NOT TOUCH the import of range from six.moves ! This is part of our 
> general move toward python3 !
>
> And do never use xrange, this is now forbidden.
>
> Frederic
>
> Le mardi 6 décembre 2016 16:26:12 UTC+1, Peleg Michaeli a écrit :
>>
>> I actually think that this is an unwanted behaviour of `six`.
>>
>> Anyway, we may let `Graph` handle xrange lists of neighbours if we want 
>> to keep it that way.
>>
>> On Tuesday, 6 December 2016 17:18:29 UTC+2, Peleg Michaeli wrote:
>>>
>>> I have tried to move LollipopGraph into families, but there was a 
>>> problem. In families, there's the following import:
>>>
>>> from six.moves import range
>>>
>>> This overrides Python's range. I don't know why. The original 
>>> implementation of Lollipop graph uses Python's range, and when it tries to 
>>> use the new (six.moves) range it fails (with "This input cannot be turned 
>>> into a graph").
>>>
>>> I can clearly fix this, by setting something like python_range = range 
>>> before the six.moves import, but it is not very elegant. I can also use 
>>> networkx's implementation of LollipopGraph (as done with BarbellGraph), but 
>>> I am not sure you consider this as the right direction to go.
>>>
>>> What do you think?
>>>
>>> On Wednesday, 30 November 2016 00:40:21 UTC+2, Dima Pasechnik wrote:



 On Tuesday, November 29, 2016 at 4:42:51 PM UTC, Peleg Michaeli wrote:
>
> Dear list members,
>
> I was wondering what really makes the difference between the graph 
> generators in `basic.py` and those in `families.py`.
>
> For one concrete example, I was wondering why `LollipopGraph` appears 
> in `basic.py` and `BarbellGraph` appears in `families.py`. These two 
> graphs 
> are very similar.
>
> I ask this for a practical reason: I would like to add a couple of 
> graph families, including the Tadpole graph (which is very similar to the 
> Lollipop graph and the Barbell graph) and the Dipole graph (which is one 
> of 
> the simplest multigraphs).
>
> What do you think?
>

 I think all of them could go into families.py
  

>
>
> Best,
> Peleg.
>


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


[sage-devel] Re: Lollipop vs. Barbell

2016-12-06 Thread Frédéric Chapoton
The new (python3 or six) range is an iterator. You just have to wrap it 
with list( ) to get back to the python2 behaviour if needed.


Le mardi 6 décembre 2016 17:31:20 UTC+1, Frédéric Chapoton a écrit :
>
> DO NOT TOUCH the import of range from six.moves ! This is part of our 
> general move toward python3 !
>
> And do never use xrange, this is now forbidden.
>
> Frederic
>
> Le mardi 6 décembre 2016 16:26:12 UTC+1, Peleg Michaeli a écrit :
>>
>> I actually think that this is an unwanted behaviour of `six`.
>>
>> Anyway, we may let `Graph` handle xrange lists of neighbours if we want 
>> to keep it that way.
>>
>> On Tuesday, 6 December 2016 17:18:29 UTC+2, Peleg Michaeli wrote:
>>>
>>> I have tried to move LollipopGraph into families, but there was a 
>>> problem. In families, there's the following import:
>>>
>>> from six.moves import range
>>>
>>> This overrides Python's range. I don't know why. The original 
>>> implementation of Lollipop graph uses Python's range, and when it tries to 
>>> use the new (six.moves) range it fails (with "This input cannot be turned 
>>> into a graph").
>>>
>>> I can clearly fix this, by setting something like python_range = range 
>>> before the six.moves import, but it is not very elegant. I can also use 
>>> networkx's implementation of LollipopGraph (as done with BarbellGraph), but 
>>> I am not sure you consider this as the right direction to go.
>>>
>>> What do you think?
>>>
>>> On Wednesday, 30 November 2016 00:40:21 UTC+2, Dima Pasechnik wrote:



 On Tuesday, November 29, 2016 at 4:42:51 PM UTC, Peleg Michaeli wrote:
>
> Dear list members,
>
> I was wondering what really makes the difference between the graph 
> generators in `basic.py` and those in `families.py`.
>
> For one concrete example, I was wondering why `LollipopGraph` appears 
> in `basic.py` and `BarbellGraph` appears in `families.py`. These two 
> graphs 
> are very similar.
>
> I ask this for a practical reason: I would like to add a couple of 
> graph families, including the Tadpole graph (which is very similar to the 
> Lollipop graph and the Barbell graph) and the Dipole graph (which is one 
> of 
> the simplest multigraphs).
>
> What do you think?
>

 I think all of them could go into families.py
  

>
>
> Best,
> Peleg.
>


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


[sage-devel] Re: Lollipop vs. Barbell

2016-12-06 Thread Frédéric Chapoton
DO NOT TOUCH the import of range from six.moves ! This is part of our 
general move toward python3 !

And do never use xrange, this is now forbidden.

Frederic

Le mardi 6 décembre 2016 16:26:12 UTC+1, Peleg Michaeli a écrit :
>
> I actually think that this is an unwanted behaviour of `six`.
>
> Anyway, we may let `Graph` handle xrange lists of neighbours if we want to 
> keep it that way.
>
> On Tuesday, 6 December 2016 17:18:29 UTC+2, Peleg Michaeli wrote:
>>
>> I have tried to move LollipopGraph into families, but there was a 
>> problem. In families, there's the following import:
>>
>> from six.moves import range
>>
>> This overrides Python's range. I don't know why. The original 
>> implementation of Lollipop graph uses Python's range, and when it tries to 
>> use the new (six.moves) range it fails (with "This input cannot be turned 
>> into a graph").
>>
>> I can clearly fix this, by setting something like python_range = range 
>> before the six.moves import, but it is not very elegant. I can also use 
>> networkx's implementation of LollipopGraph (as done with BarbellGraph), but 
>> I am not sure you consider this as the right direction to go.
>>
>> What do you think?
>>
>> On Wednesday, 30 November 2016 00:40:21 UTC+2, Dima Pasechnik wrote:
>>>
>>>
>>>
>>> On Tuesday, November 29, 2016 at 4:42:51 PM UTC, Peleg Michaeli wrote:

 Dear list members,

 I was wondering what really makes the difference between the graph 
 generators in `basic.py` and those in `families.py`.

 For one concrete example, I was wondering why `LollipopGraph` appears 
 in `basic.py` and `BarbellGraph` appears in `families.py`. These two 
 graphs 
 are very similar.

 I ask this for a practical reason: I would like to add a couple of 
 graph families, including the Tadpole graph (which is very similar to the 
 Lollipop graph and the Barbell graph) and the Dipole graph (which is one 
 of 
 the simplest multigraphs).

 What do you think?

>>>
>>> I think all of them could go into families.py
>>>  
>>>


 Best,
 Peleg.

>>>

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


[sage-devel] Re: Lollipop vs. Barbell

2016-12-06 Thread Peleg Michaeli
I actually think that this is an unwanted behaviour of `six`.

Anyway, we may let `Graph` handle xrange lists of neighbours if we want to 
keep it that way.

On Tuesday, 6 December 2016 17:18:29 UTC+2, Peleg Michaeli wrote:
>
> I have tried to move LollipopGraph into families, but there was a problem. 
> In families, there's the following import:
>
> from six.moves import range
>
> This overrides Python's range. I don't know why. The original 
> implementation of Lollipop graph uses Python's range, and when it tries to 
> use the new (six.moves) range it fails (with "This input cannot be turned 
> into a graph").
>
> I can clearly fix this, by setting something like python_range = range 
> before the six.moves import, but it is not very elegant. I can also use 
> networkx's implementation of LollipopGraph (as done with BarbellGraph), but 
> I am not sure you consider this as the right direction to go.
>
> What do you think?
>
> On Wednesday, 30 November 2016 00:40:21 UTC+2, Dima Pasechnik wrote:
>>
>>
>>
>> On Tuesday, November 29, 2016 at 4:42:51 PM UTC, Peleg Michaeli wrote:
>>>
>>> Dear list members,
>>>
>>> I was wondering what really makes the difference between the graph 
>>> generators in `basic.py` and those in `families.py`.
>>>
>>> For one concrete example, I was wondering why `LollipopGraph` appears in 
>>> `basic.py` and `BarbellGraph` appears in `families.py`. These two graphs 
>>> are very similar.
>>>
>>> I ask this for a practical reason: I would like to add a couple of graph 
>>> families, including the Tadpole graph (which is very similar to the 
>>> Lollipop graph and the Barbell graph) and the Dipole graph (which is one of 
>>> the simplest multigraphs).
>>>
>>> What do you think?
>>>
>>
>> I think all of them could go into families.py
>>  
>>
>>>
>>>
>>> Best,
>>> Peleg.
>>>
>>

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


[sage-devel] Re: Lollipop vs. Barbell

2016-12-06 Thread Peleg Michaeli
I have tried to move LollipopGraph into families, but there was a problem. 
In families, there's the following import:

from six.moves import range

This overrides Python's range. I don't know why. The original 
implementation of Lollipop graph uses Python's range, and when it tries to 
use the new (six.moves) range it fails (with "This input cannot be turned 
into a graph").

I can clearly fix this, by setting something like python_range = range 
before the six.moves import, but it is not very elegant. I can also use 
networkx's implementation of LollipopGraph (as done with BarbellGraph), but 
I am not sure you consider this as the right direction to go.

What do you think?

On Wednesday, 30 November 2016 00:40:21 UTC+2, Dima Pasechnik wrote:
>
>
>
> On Tuesday, November 29, 2016 at 4:42:51 PM UTC, Peleg Michaeli wrote:
>>
>> Dear list members,
>>
>> I was wondering what really makes the difference between the graph 
>> generators in `basic.py` and those in `families.py`.
>>
>> For one concrete example, I was wondering why `LollipopGraph` appears in 
>> `basic.py` and `BarbellGraph` appears in `families.py`. These two graphs 
>> are very similar.
>>
>> I ask this for a practical reason: I would like to add a couple of graph 
>> families, including the Tadpole graph (which is very similar to the 
>> Lollipop graph and the Barbell graph) and the Dipole graph (which is one of 
>> the simplest multigraphs).
>>
>> What do you think?
>>
>
> I think all of them could go into families.py
>  
>
>>
>>
>> Best,
>> Peleg.
>>
>

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


[sage-devel] Re: Lollipop vs. Barbell

2016-11-29 Thread Dima Pasechnik


On Tuesday, November 29, 2016 at 4:42:51 PM UTC, Peleg Michaeli wrote:
>
> Dear list members,
>
> I was wondering what really makes the difference between the graph 
> generators in `basic.py` and those in `families.py`.
>
> For one concrete example, I was wondering why `LollipopGraph` appears in 
> `basic.py` and `BarbellGraph` appears in `families.py`. These two graphs 
> are very similar.
>
> I ask this for a practical reason: I would like to add a couple of graph 
> families, including the Tadpole graph (which is very similar to the 
> Lollipop graph and the Barbell graph) and the Dipole graph (which is one of 
> the simplest multigraphs).
>
> What do you think?
>

I think all of them could go into families.py
 

>
>
> Best,
> Peleg.
>

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