-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor event classes: make meaning more explicit
This is the largest class refactor since the initialization of 'mutwo'. Let's pray it will be last one. Summarized it refactors: SimpleEvent => Chronon SequentialEvent => Consecution SimultaneousEvent => Concurrence TempoEvent => TempoChronon Why? 'SequentialEvent' and 'SimultaneousEvent' are meaningless names: an event is sequential to what? An event is simultaneous to what? What is actually meant is: the events inside the event are happening simultaneously / sequentially. Therefore it would be more precise to describe 'SequentialEvent' as 'SequencedEvents' (suggested by @mdedwards) or 'EventSequence'. But these names stress out too much the children of the object and don't emphasize enough that a 'SequentialEvent' is an event itself. The name 'Event' may not be necessary: the context is already clear from the 'core_events' module. Similarity in 'mutwos' early days converters were named 'XConverter', but later simplified and renamed more explicit to 'X_To_Y' (see #18). So alternative names could be: (1) Sequence or Consecution for 'SequentialEvent' (2) Simultaneity or Concurrence for 'SimultaneousEvent' Regarding (1): 'Sequence' already has a different meaning in Python [1], [2]. Therefore it may be wiser to use 'Consecution'. According to stackexchange 'consecutive' rather emphasizes that successive events aren't interrupted [3]. This is true in 'mutwo', as mutwo events don't know entry delays. Regarding (2): Stackexchange says simultaneous events have a stronger connection to each other than concurrent events (which are more 'random') [4]. Since randomness is a super set of intention (and I'm a Cage advocate) I'd prefer 'Concurrence'. Finally when choosing more explicit, descriptive names for the complex events, we could also choose a more explicit name for 'SimpleEvent'. Initially I thought of 'Atom', because a 'SimpleEvent' isn't describable by smaller elements, but is already the smallest element itself. But there is even a more beautiful word: Chronon [5], a discrete unit of the floating time. This is exactly what a 'SimpleEvent' (or 'NoteLike') denotes: a discrete passing of time. [1] https://docs.python.org/3/c-api/sequence.html [2] https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence [3] https://english.stackexchange.com/questions/490293/is-consecutive-a-subset-of-sequential [4] https://ell.stackexchange.com/questions/297831/difference-between-simultaneously-concurrently-and-at-the-same-time [5] https://en.wikipedia.org/wiki/Chronon --- In order to refactor fellow-up 'mutwo' projects an ugly, but effective bash script may be used: ``` d=$1 find $d -type f | xargs -I {} sed -i 's/SimpleEvent/Chronon/g' {} find $d -type f | xargs -I {} sed -i 's/SequentialEvent/Consecution/g' {} find $d -type f | xargs -I {} sed -i 's/SimultaneousEvent/Concurrence/g' {} find $d -type f | xargs -I {} sed -i 's/TempoEvent/TempoChronon/g' {} find $d -type f | xargs -I {} sed -i 's/tempo_event/tempo_chronon/g' {} find $d -type f | xargs -I {} sed -i 's/simple_event/chronon/g' {} find $d -type f | xargs -I {} sed -i 's/simple\ event/chronon/g' {} find $d -type f | xargs -I {} sed -i 's/sequential_event/consecution/g' {} find $d -type f | xargs -I {} sed -i 's/sequential\ event/consecution/g' {} find $d -type f | xargs -I {} sed -i 's/simultaneous\ event/concurrence/g' {} ```
- Loading branch information
1 parent
51cf21f
commit 8c54bb1
Showing
19 changed files
with
875 additions
and
873 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.