Skip to content

Commit

Permalink
Merge pull request #1738 from cuthbertLab/remove_ellipses
Browse files Browse the repository at this point in the history
Remove tons of ellipses
  • Loading branch information
mscuthbert authored Oct 29, 2024
2 parents 6235b41 + b92727d commit 4e90bfc
Show file tree
Hide file tree
Showing 165 changed files with 959 additions and 911 deletions.
4 changes: 3 additions & 1 deletion .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions dist/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
# Authors: Christopher Ariza
# Michael Scott Asato Cuthbert
#
# Copyright: Copyright © 2010-2023 Michael Scott Asato Cuthbert
# Copyright: Copyright © 2010-2024 Michael Scott Asato Cuthbert
# License: BSD, see license.txt
# ------------------------------------------------------------------------------
'''
Builds various kinds of music21 distribution files and uploads them to PyPI and GoogleCode.
To do a release,
1. update the VERSION in _version.py and the single test cases in base.py.
1. update the VERSION in _version.py and the single test case in base.py.
2. run `corpus.corpora.CoreCorpus().cacheMetadata()`.
for a major change that affects parsing run corpus.corpora.CoreCorpus().rebuildMetadataCache()
(20 min on IntelMacbook Air) -- either of these MAY change a
Expand Down Expand Up @@ -57,7 +57,7 @@
15. PR and Commit to GitHub at this point w/ commit comment of the new version,
then don't change anything until the next step is done.
(.gitignore will avoid uploading the large files created here...)
(.gitignore will avoid uploading the large files created here.)
16. Switch back to master/main branch
Expand All @@ -71,7 +71,7 @@
Drag in this order: .tar.gz, -docs.zip, no-corpus.tar.gz
Finish this before doing the next step, even though it looks like it could be done in parallel.
20. Upload the new file to PyPI with "twine upload music21-7.3.5a2.tar.gz", and same for the
whl file (but NOT no corpus) [*]
Expand All @@ -87,7 +87,7 @@
username:your_username
password:your_password
21. Delete the two .tar.gz files and .whl file in dist...
21. Delete the two .tar.gz files and .whl file in dist.
22. For starting a new major release create a GitHub branch for the old one.
Expand Down
4 changes: 2 additions & 2 deletions documentation/docbuild/documenters.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def inheritedDocAttrMapping(self):
'''
# if one of the _DOC_ATTRs is exactly the same as the previous base class,
# only show it once.
# TODO: do this on an attribute by attribute basis...
# TODO: do this on an attribute by attribute basis
seenBaseClassDocAttrs = []

if self._inheritedDocAttrMapping is None:
Expand Down Expand Up @@ -1501,7 +1501,7 @@ def run(self):
result.extend(self.makeHeading(self.headingText, 1))
result.extend(self.rstEditingWarningFormat)
result.extend(self.rstCorpusIntroductionFormat)
# TODO: use... common.getCorpusContentDirs to make sure nothing is missed.
# TODO: use common.getCorpusContentDirs to make sure nothing is missed.
for directoryInformation in corpus.corpora.CoreCorpus().getWorkReferences():
result.extend(self.getRstComposerDictFormat(directoryInformation))
return result
Expand Down
2 changes: 1 addition & 1 deletion documentation/docbuild/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
eval "${SCRIPT}";
Otherwise just contact MSC...
Otherwise just contact MSAC.
'''
from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion documentation/docbuild/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def write(self, filePath, rst):
shouldWrite = False
else:
pass
# # uncomment for help in figuring out why a file keeps being different...
# # uncomment for help in figuring out why a file keeps being different
# import difflib
# print(common.relativepath(filePath))
# print('\n'.join(difflib.ndiff(rst.split('\n'), oldRst.split('\n'))))
Expand Down
2 changes: 1 addition & 1 deletion documentation/source/about/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Licensing and Copyright
The `music21` Toolkit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Music21 is Copyright © 2006-2023 Michael Scott Asato Cuthbert.
Music21 is Copyright © 2006-2024 Michael Scott Asato Cuthbert.
Music21 code (excluding content encoded in the corpus) is
free and open-source software, licensed under the BSD License.

Expand Down
2 changes: 1 addition & 1 deletion documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
project = 'music21'
# pylint: disable=redefined-builtin
# noinspection PyShadowingBuiltins
copyright = '2006-2023 Michael Scott Asato Cuthbert'
copyright = '2006-2024 Michael Scott Asato Cuthbert'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
4 changes: 2 additions & 2 deletions documentation/testDocumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# Authors: Michael Scott Asato Cuthbert
#
# Copyright: Copyright © 2010-2023 Michael Scott Asato Cuthbert
# Copyright: Copyright © 2010-2024 Michael Scott Asato Cuthbert
# License: BSD, see license.txt
# ------------------------------------------------------------------------------
'''
Expand Down Expand Up @@ -169,7 +169,7 @@ def getDocumentationFiles(runOne=False):
fullModulePath = os.path.join(root, module)
if not module.endswith('.rst'):
continue
if module.startswith('module'): # we have this already...
if module.startswith('module'): # we have this already
continue
if module in skipModules:
continue
Expand Down
4 changes: 2 additions & 2 deletions music21/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
'''
The music21 Framework is Copyright © 2006-2023 Michael Scott Asato Cuthbert.
The music21 Framework is Copyright © 2006-2024 Michael Scott Asato Cuthbert.
Some Rights Reserved
Released under the BSD (3-clause) license. See license.txt.
Expand Down Expand Up @@ -83,7 +83,7 @@
'mainTest',

'prebase', # before all
'base', # top...
'base', # top
'sites', # important

# sub folders
Expand Down
6 changes: 3 additions & 3 deletions music21/abcFormat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def getMetronomeMarkObject(self) -> tempo.MetronomeMark|None:
else: # this is an error case
environLocal.printDebug(['incorrectly encoded / unparsable duration:', dur])
n, d = '1', '1'
# n and d might be strings...
# n and d might be strings
referent += (float(n) / float(d)) * 4
else: # assume we just have a quarter definition, e.g., Q:90
number = float(nonText)
Expand Down Expand Up @@ -2323,7 +2323,7 @@ def tokenize(self, strSrc: str) -> None:
self.skipAhead = j - self.pos # not + 1
break
j += 1
# not found, continue...
# not found, continue
continue

# get slurs, ensuring that they're not confused for tuplets
Expand Down Expand Up @@ -3013,7 +3013,7 @@ def splitByVoice(self) -> list[ABCHandler]:
'D3', 'D3', '|', 'D6', '|',
'D3', 'D3', '|', 'D6', '||']
Then later the metadata can be merged at the start of each voice...
Then later the metadata can be merged at the start of each voice:
>>> mergedTokens = tokenColls[0] + tokenColls[1]
>>> mergedTokens
Expand Down
11 changes: 5 additions & 6 deletions music21/abcFormat/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
# Michael Scott Asato Cuthbert
# Dylan Nagler
#
# Copyright: Copyright © 2010-2023 Michael Scott Asato Cuthbert and the music21
# Project
# Copyright: Copyright © 2010-2024 Michael Scott Asato Cuthbert
# License: BSD, see license.txt
# -----------------------------------------------------------------------------
'''
Expand Down Expand Up @@ -231,7 +230,7 @@ def abcToStreamPart(
try:
p.makeBeams(inPlace=True)
except (meter.MeterException, stream.StreamException) as e:
environLocal.warn(f'Error in beaming...ignoring: {e}')
environLocal.warn(f'Error in beaming. Ignoring: {e}')

# copy spanners into topmost container; here, a part
rm = []
Expand Down Expand Up @@ -371,7 +370,7 @@ def parseABCNote(
n.tie.style = 'normal'
elif t.tie == 'stop':
n.tie = tie.Tie(t.tie)
# Was: Extremely Slow for large Opus files... why?
# Was: Extremely Slow for large Opus files. Why?
# Answer: some pieces didn't close all their spanners, so
# everything was in a Slur/Diminuendo, etc.
for span in t.applicableSpanners:
Expand Down Expand Up @@ -587,7 +586,7 @@ def reBar(music21Part, *, inPlace=False):
to the last time signature, in this case 2/4. The default is to reBar in place.
The measure numbers are updated accordingly.
(NOTE: reBar is called automatically in abcToStreamPart, hence not demonstrated below...)
(NOTE: reBar is called automatically in abcToStreamPart, hence not demonstrated below.)
The key signature and clef are assumed to be the same in the second measure after the
split, so both are omitted. If the time signature is not the same in the second measure,
Expand Down Expand Up @@ -1157,7 +1156,7 @@ def testTiesTranslate(self):
def xtestMergeScores(self):
from music21 import corpus
unused = corpus.parse('josquin/laDeplorationDeLaMorteDeJohannesOckeghem')
# this was getting incorrect Clefs...
# this was getting incorrect Clefs


if __name__ == '__main__':
Expand Down
3 changes: 1 addition & 2 deletions music21/alpha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#
# Authors: Michael Scott Asato Cuthbert
#
# Copyright: Copyright © 2009-2015 Michael Scott Asato Cuthbert and the music21
# Project
# Copyright: Copyright © 2009-2024 Michael Scott Asato Cuthbert
# License: BSD, see license.txt
# -----------------------------------------------------------------------------
'''
Expand Down
6 changes: 3 additions & 3 deletions music21/analysis/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,9 +1009,9 @@ def getPitchSpan(self, subStream) -> tuple[pitch.Pitch, pitch.Pitch]|None:
For a given subStream, return a tuple consisting of the two pitches
with the minimum and maximum pitch space value.
This public method may be used by other classes.
This public method may be used by other classes. It ignores ChordSymbol objects.
ignores ChordSymbol objects...
Demonstration:
>>> s = corpus.parse('bach/bwv66.6')
>>> p = analysis.discrete.Ambitus()
Expand Down Expand Up @@ -1362,7 +1362,7 @@ def analysisClassFromMethodName(method: str) -> type[DiscreteAnalysis]|None:
>>> acfmn('span')
<class 'music21.analysis.discrete.Ambitus'>
This one is fundamentally important...
This one is fundamentally important:
>>> acfmn('key')
<class 'music21.analysis.discrete.AardenEssen'>
Expand Down
2 changes: 1 addition & 1 deletion music21/analysis/floatingKey.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class KeyAnalyzer:
<music21.key.Key of b minor>, <music21.key.Key of C# major>,
<music21.key.Key of F# major>, <music21.key.Key of b minor>]
Major smoothing...
Major smoothing:
>>> ka.windowSize = ka.numMeasures // 2
>>> ka.run() # only the pickup seems to be in A major by this approach
Expand Down
2 changes: 1 addition & 1 deletion music21/analysis/reduceChords.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def reduceMeasureToNChords(
if currentGreedyChord is not None:
currentGreedyChord.quarterLength = currentGreedyChordNewLength
currentGreedyChordNewLength = 0.0
# even chord lengths...
# even chord lengths
for i in range(1, len(measureObject)):
c = measureObject[i]
cOffsetCurrent = c.offset
Expand Down
4 changes: 2 additions & 2 deletions music21/analysis/reduceChordsOld.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self):
self.positionInMeasure = None
self.numberOfElementsInMeasure = None

# for working...
# for working
self._lastPitchedObject = None
self._lastTs = None

Expand Down Expand Up @@ -136,7 +136,7 @@ def reduceMeasureToNChords(self,
currentGreedyChord.quarterLength = currentGreedyChordNewLength
currentGreedyChordNewLength = 0.0

# even chord lengths...
# even chord lengths
for i in range(1, len(mObj)):
c = mObj[i]
cOffsetCurrent = c.offset
Expand Down
6 changes: 3 additions & 3 deletions music21/analysis/windowed.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def analyze(self, windowSize, windowType='overlap'):
try:
data[i], color[i] = self.processor.process(current)
except DiscreteAnalysisException:
# current might have no notes...all rests?
# current might have no notes: all rests?
data[i], color[i] = (None, None, 0), '#ffffff'

elif windowType == 'noOverlap':
Expand All @@ -203,7 +203,7 @@ def analyze(self, windowSize, windowType='overlap'):
try:
data[i], color[i] = self.processor.process(current)
except DiscreteAnalysisException:
# current might have no notes...all rests?
# current might have no notes: all rests?
data[i], color[i] = (None, None, 0), '#ffffff'

start = end
Expand Down Expand Up @@ -232,7 +232,7 @@ def analyze(self, windowSize, windowType='overlap'):
try:
data[i], color[i] = self.processor.process(current)
except DiscreteAnalysisException:
# current might have no notes...all rests?
# current might have no notes: all rests?
data[i], color[i] = (None, None, 0), '#ffffff'

return data, color
Expand Down
4 changes: 2 additions & 2 deletions music21/articulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class Spiccato(Staccato, Accent):
def __init__(self, **keywords):
Staccato.__init__(self)
with tempAttribute(self, 'lengthShift'):
Accent.__init__(self) # order matters...
Accent.__init__(self) # order matters!


class Tenuto(LengthArticulation):
Expand Down Expand Up @@ -405,7 +405,7 @@ class TechnicalIndication(Articulation):

class Harmonic(TechnicalIndication):
'''
A general harmonic indicator -- StringHarmonic is probably what you want...
A general harmonic indicator -- StringHarmonic is probably what you want.
'''

class Bowing(TechnicalIndication):
Expand Down
12 changes: 6 additions & 6 deletions music21/audioSearch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def autocorrelationFunction(recordedSignal, recordSampleRateIn):
+ f'numpy installed (scipy recommended). Missing {base._missingImport}')
import numpy
try:
with warnings.catch_warnings(): # scipy.signal gives ImportWarning...
with warnings.catch_warnings(): # scipy.signal gives ImportWarning
warnings.simplefilter('ignore', ImportWarning)
# numpy warns scipy that oldnumeric will be dropped soon.
warnings.simplefilter('ignore', DeprecationWarning)
Expand Down Expand Up @@ -351,7 +351,7 @@ def getFrequenciesFromMicrophone(length=10.0, storeWaveFilename=None):
Returns a list of frequencies detected.
TODO -- find a way to test... or at least demo
TODO -- find a way to test or at least demo
'''
if 'numpy' in base._missingImport:
raise AudioSearchException(
Expand Down Expand Up @@ -436,7 +436,7 @@ def getFrequenciesFromPartialAudioFile(waveFilenameOrHandle='temp', length=10.0,
>>> print(currentSample) # should be near 44100, but probably not exact
44032
Now read the next 1 second...
Now read the next 1 second:
>>> fTup = audioSearch.getFrequenciesFromPartialAudioFile(pachelbelFileHandle, length=1.0,
... startSample=currentSample)
Expand Down Expand Up @@ -534,7 +534,7 @@ def smoothFrequencies(
Smooths the shape of the signal in order to avoid false detections in the fundamental
frequency. Takes in a list of ints or floats.
The second pitch below is obviously too low. It will be smoothed out...
The second pitch below is obviously too low. It will be smoothed out:
>>> inputPitches = [440, 220, 440, 440, 442, 443, 441, 470, 440, 441, 440,
... 442, 440, 440, 440, 397, 440, 440, 440, 442, 443, 441,
Expand Down Expand Up @@ -971,11 +971,11 @@ def decisionProcess(
countdown = countdown + 1
elif dist > 20 and countdown == 0:
countdown += 1
environLocal.printDebug(f'Excessive distance....? {dist=}')
environLocal.printDebug(f'Excessive distance? {dist=}')

elif dist > 30 and countdown == 1:
countdown += 1
environLocal.printDebug(f'Excessive distance....? {dist=}')
environLocal.printDebug(f'Excessive distance? {dist=}')

elif ((firstNotePage is not None and lastNotePage is not None)
and ((positionBeginningData < firstNotePage
Expand Down
Loading

0 comments on commit 4e90bfc

Please sign in to comment.