Collections set/get_offsets method

Hi,

As promised, here's a short patch to add get_offsets() and set_offsets() to the Collections() base class. I tried to make it do the right thing with regard to _offsets vs. _uniform_offsets, depending on whether _uniform_offsets is None. I also had tried to make __init__ use set_offsets, but that proved to be too much of a hassle for too little code reuse.

Comments?

Ryan

collections_offsets.diff (1.19 KB)

···

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Ryan May wrote:

Hi,

As promised, here's a short patch to add get_offsets() and set_offsets() to the Collections() base class. I tried to make it do the right thing with regard to _offsets vs. _uniform_offsets, depending on whether _uniform_offsets is None. I also had tried to make __init__ use set_offsets, but that proved to be too much of a hassle for too little code reuse.

Comments?

I have applied this patch along with entries in API_CHANGES and CHANGELOG. It looks correct in the context of the present code, and since it is completely new functionality it can't hurt.

Overall, however, the handling of offsets is pretty confusing. I suspect this is my fault; it probably results from my wanting to make it easy to use the LineCollection for waterfall plots. I looked to see whether it could be simplified by using an appropriate offsetTransform, but this is at best not straightforward or obvious.

Eric

Eric Firing wrote:

Ryan May wrote:

Hi,

As promised, here's a short patch to add get_offsets() and set_offsets() to the Collections() base class. I tried to make it do the right thing with regard to _offsets vs. _uniform_offsets, depending on whether _uniform_offsets is None. I also had tried to make __init__ use set_offsets, but that proved to be too much of a hassle for too little code reuse.

Comments?

I have applied this patch along with entries in API_CHANGES and CHANGELOG. It looks correct in the context of the present code, and since it is completely new functionality it can't hurt.

Rats! I see I fouled up the commit message. I don't know how I came up with "Ryan Kraus"! Sorry... I should have just left the commit to you.

Eric

Eric Firing wrote:

Eric Firing wrote:

Ryan May wrote:

Hi,

As promised, here's a short patch to add get_offsets() and set_offsets() to the Collections() base class. I tried to make it do the right thing with regard to _offsets vs. _uniform_offsets, depending on whether _uniform_offsets is None. I also had tried to make __init__ use set_offsets, but that proved to be too much of a hassle for too little code reuse.

Comments?

I have applied this patch along with entries in API_CHANGES and CHANGELOG. It looks correct in the context of the present code, and since it is completely new functionality it can't hurt.

Rats! I see I fouled up the commit message. I don't know how I came up with "Ryan Kraus"! Sorry... I should have just left the commit to you.

Don't worry about it. It's not a big deal, even though I am only doing open source for the credit, and the fame, fortune and women.....I still get those right?

Ryan "Kraus" May

···

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma