Thread: [Pythonsound-devel] Bug fixes against latest CVS
Status: Beta
Brought to you by:
mupuxeddu
|
From: Paul W. <sli...@ya...> - 2001-10-10 19:06:52
Attachments:
pw_10102001.patch
|
Hi Maurizio, Attached are more doctests and bugfixes against current CVS. (Wed Oct 10 19:04:17 UTC 2001) Notes: - updated everything, including doctests, to use foo.onset() and foo.duration() as methods instead of attributes. - Changed several ArgumentError (which is undefined) to ValueError - Changed disjoint() to not lengthen durations if they were already short enough. - Aggregate.duration() was calling Aggregate.move_absolute_forward() which was broken - it doesn't work to just inherit this from Event. So I added Aggregate.move_absolute_forward(). In my interpretation, this should scale the durations of all sub-events by the same ratio, and adjust their onset times relative to onset of the Aggregate. See the test examples for an idea of what this does. - TO DO: look at other move_ methods for Aggregate and see if they work. - changed Aggregate to cache end time; it caches onset and duration, so it seemed consistent to do the same with end. - fixed Aggregate.extend (various errors) - still haven't tested serialize(). - Aggregate.unwind: changed "unwinded_list" to "unwound" ... isn't English fun? :-/ - I assume flatten() is supposed to do the same thing as unwind()? - changed sort_by_attr to work with new onset0 and duration0 attributes (but not visible to the user). We should be able to sort by end() as well, but I haven't looked at that yet so it raises an error now. -- ................ paul winkler ................ custom calendars: http://www.calendargalaxy.com A member of ARMS: http://www.reacharms.com home page: http://www.slinkp.com |
|
From: Maurizio U. P. <um...@ti...> - 2001-10-10 21:02:02
|
On Wed, 10 Oct 2001, Paul Winkler wrote: > Hi Maurizio, > > Attached are more doctests and bugfixes against current CVS. > (Wed Oct 10 19:04:17 UTC 2001) Thank you very much. I commited almost everything. > - changed Aggregate to cache end time; it caches onset and duration, > so it seemed consistent to do the same with end. Well, I don't know... I mean, it's just adding complexity. Anyway I commited it. > - I assume flatten() is supposed to do the same thing as unwind()? It makes the Aggregate flat and returns nothing. Do you have a SourceForge account? Maurizio Umberto Puxeddu. |
|
From: Paul W. <sli...@ya...> - 2001-10-11 02:58:52
|
On Wed, Oct 10, 2001 at 10:59:10PM +0200, Maurizio Umberto Puxeddu wrote: > > - changed Aggregate to cache end time; it caches onset and duration, > > so it seemed consistent to do the same with end. > Well, I don't know... I mean, it's just adding complexity. Anyway I > commited it. Not a big deal - all this cache stuff is just an optimization anyway, and it's still early to be doing that. I'd consider making cached_onset and its friends semi-private, e.g. self._cached_onset. The Aggregate's namespace is getting pretty crowded, and those are attributes that the user should probably not touch directly. > > - I assume flatten() is supposed to do the same thing as unwind()? > > It makes the Aggregate flat and returns nothing. Aha, so it's like an in-place unwind(). Done. > Do you have a SourceForge account? Now that you mention it, I do - I'd forgotten about it! user ID: 38329 login name: slinkp Guess I'll have to get more familiar with CVS. It's silly to be emailing patches like this. -- ................ paul winkler ................ custom calendars: http://www.calendargalaxy.com A member of ARMS: http://www.reacharms.com home page: http://www.slinkp.com |
|
From: Maurizio U. P. <um...@ti...> - 2001-10-11 12:23:08
|
On Wed, 10 Oct 2001, Paul Winkler wrote: > I'd consider making cached_onset and its friends semi-private, e.g. > self._cached_onset. The Aggregate's namespace is getting pretty > crowded, and those are attributes that the user should probably not > touch directly. I agree. I turned self.*0 in self._* etc and self.cached_* in self._cached_*. > > > - I assume flatten() is supposed to do the same thing as unwind()? > > > > It makes the Aggregate flat and returns nothing. > > Aha, so it's like an in-place unwind(). Done. I added it when committing your patch. > login name: slinkp I added slinkp to the team. You can still send me patches if you feel more comfortable. Also when doing large scale changes it is better to send me a patch at the moment. For small bugs fixes and doctest you can directly commit them to the repository. Why do you like a = 1; b = 2 instead of a, b = 1, 2 ? If you really don't like multiple assignments, let's use a = 1 b = 2 ok? Thank you. Maurizio Umberto Puxeddu. |
|
From: Paul W. <sli...@ya...> - 2001-10-11 17:18:13
|
On Thu, Oct 11, 2001 at 02:20:21PM +0200, Maurizio Umberto Puxeddu wrote: > I agree. I turned self.*0 in self._* etc and self.cached_* in > self._cached_*. Sounds good. > I added slinkp to the team. > You can still send me patches if you feel more comfortable. Also when > doing large scale changes it is better to send me a patch at the moment. > For small bugs fixes and doctest you can directly commit them to the > repository. OK. For anything large, I will want to check with you anyway. > Why do you like > > a = 1; b = 2 > > instead of > > a, b = 1, 2 > > ? It's an unnecessary optimization. Feel free to ignore it. Got the idea from a comp.lang.py post: http://groups.google.com/groups?q=fastest+group:comp.lang.python&hl=en&as_qdr=m&rnum=2&selm=2261322.7AAxBmiTta%40lunix.schabi.de Looking at the timings in that post again, there's not enough speed difference (maybe 10%) to warrant it, unless we actually reach a point where such tiny improvements are worthwhile. I should follow my own advice and not optimize until it's clearly necessary. -- ................ paul winkler ................ custom calendars: http://www.calendargalaxy.com A member of ARMS: http://www.reacharms.com home page: http://www.slinkp.com |