Skip to content

Commit 501e13d

Browse files
authored
Merge pull request #1811 from cuthbertLab/num-dot
1. -> 1.0
2 parents f0d6d78 + dce5f7f commit 501e13d

File tree

13 files changed

+25
-22
lines changed

13 files changed

+25
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ And to install, see:
1515
https://www.music21.org/music21docs/usersGuide/usersGuide_01_installing.html
1616

1717
`Music21` runs on Python 3.10+. (Use version 4 on Python 2 or Py3.4, version 5
18-
on Py3.5, version 6 on Py3.6, version 7 on Py3.7, version 8 on Py3.8/Py3.9.)
18+
on Py3.5, version 6 on Py3.6, version 7 on Py3.7, version 8 on Py3.8/Py3.9)
1919

2020
Released under the BSD (3-clause) license. See LICENSE.
2121
Externally provided software (including the MIT-licensed Lilypond/MusicXML test Suite) and

documentation/source/testsAndInProgress/devTest_widgets.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@
124124
],
125125
"source": [
126126
"@widgets.interact_manual(\n",
127-
" color=['blue', 'red', 'green'], lw=(1., 10.))\n",
128-
"def plot(freq=1., color='blue', lw=2, grid=True):\n",
129-
" t = np.linspace(-1., +1., 1000)\n",
127+
" color=['blue', 'red', 'green'], lw=(1.0, 10.0))\n",
128+
"def plot(freq=1.0, color='blue', lw=2, grid=True):\n",
129+
" t = np.linspace(-1.0, 1.0, 1000)\n",
130130
" fig, ax = plt.subplots(1, 1, figsize=(8, 6))\n",
131131
" ax.plot(t, np.sin(2 * np.pi * freq * t),\n",
132132
" lw=lw, color=color)\n",
@@ -157,8 +157,8 @@
157157
],
158158
"source": [
159159
"freq_slider = widgets.FloatSlider(\n",
160-
" value=2.,\n",
161-
" min=1.,\n",
160+
" value=2.0,\n",
161+
" min=1.0,\n",
162162
" max=10.0,\n",
163163
" step=0.1,\n",
164164
" description='Frequency:',\n",

music21/alpha/analysis/aligner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ def testChordSimilarityStream(self):
10491049

10501050
sa = StreamAligner(target, source)
10511051
sa.align()
1052-
self.assertEqual(sa.similarityScore, 1.)
1052+
self.assertEqual(sa.similarityScore, 1.0)
10531053

10541054
def testShowInsertion(self):
10551055
'''

music21/common/numberTools.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def mixedNumeral(expr: numbers.Real,
401401
'2 1/10000000'
402402
'''
403403
if not isinstance(expr, Fraction):
404-
quotient, remainder = divmod(float(expr), 1.)
404+
quotient, remainder = divmod(float(expr), 1.0)
405405
remainderFrac = Fraction(remainder).limit_denominator(limitDenominator)
406406
if quotient < -1:
407407
quotient += 1
@@ -824,7 +824,10 @@ def approximateGCD(values: Collection[int|float|Fraction], grain: float = 1e-4)
824824
return lowest
825825

826826
# assume that one of these divisions will match
827-
divisors = (1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.)
827+
divisors = (
828+
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0,
829+
9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0,
830+
)
828831
divisions = [] # a list of lists, one for each entry
829832
uniqueDivisions = set()
830833
for index in values:

music21/instrument.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2426,7 +2426,7 @@ def fromString(instrumentString: str,
24262426
(an honorary 'language' for these purposes).
24272427
24282428
Alternatively, you can specify the language to search using the `language`
2429-
argument. (New in v7.3.)
2429+
argument. (New in v7.3)
24302430
24312431
>>> t12 = instrument.fromString('Klarinette', language=instrument.SearchLanguage.GERMAN)
24322432
>>> t12

music21/meter/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ class TimeSignature(TimeSignatureBase):
381381
>>> [thisNote.beatStr for thisNote in m3.notes]
382382
['1', '2', '3', '4', '5', '6']
383383
384-
As of v7., 3/8 also defaults to fast 3/8, that is, one beat:
384+
As of v7, 3/8 also defaults to fast 3/8, that is, one beat:
385385
386386
>>> meter.TimeSignature('3/8').beatCount
387387
1
@@ -1310,7 +1310,7 @@ def _setDefaultAccentWeights(self, depth: int = 3) -> None:
13101310

13111311
maxInt = max(weightInts)
13121312
weightValues = {} # reference dictionary
1313-
# minimum value, something like 1/16., to be multiplied by powers of 2
1313+
# minimum value, something like 1/16, to be multiplied by powers of 2
13141314
weightValueMin = 1 / pow(2, maxInt - 1)
13151315
for x in range(maxInt):
13161316
# multiply base value (0.125) by 1, 2, 4

music21/musicxml/m21ToXml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5247,7 +5247,7 @@ def expressionToXml(self, expression: expressions.Expression) -> Element:
52475247
>>> MEX.dump(mxExpression)
52485248
<inverted-turn placement="above" />
52495249
5250-
>>> invDelayedTurn = expressions.InvertedTurn(delay=1.)
5250+
>>> invDelayedTurn = expressions.InvertedTurn(delay=1.0)
52515251
>>> invDelayedTurn.placement = 'below'
52525252
>>> MEX = musicxml.m21ToXml.MeasureExporter()
52535253
>>> mxExpression = MEX.expressionToXml(invDelayedTurn)

music21/musicxml/test_m21ToXml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ def test_writeFromSpannerAnchorsGetsMeasureEndOffsetRight(self):
747747
currOffsetQL = common.opFrac(currOffsetQL - durQL)
748748
else:
749749
currOffsetQL = common.opFrac(currOffsetQL + durQL)
750-
self.assertEqual(currOffsetQL, 4.)
750+
self.assertEqual(currOffsetQL, 4.0)
751751

752752
def testOutOfBoundsExpressionDoesNotCreateForward(self):
753753
'''

music21/musicxml/test_xmlToM21.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ def testPedalMarks(self):
11341134
self.assertEqual(pm.pedalType, expressions.PedalType.Sustain)
11351135
spElements = pm.getSpannedElements()
11361136
self.assertEqual(len(spElements), 4)
1137-
expectedOffsets = [0., 1., 1., 2.]
1137+
expectedOffsets = [0.0, 1.0, 1.0, 2.0]
11381138
for i, (el, expectedOffset) in enumerate(zip(spElements, expectedOffsets)):
11391139
if i == 1:
11401140
self.assertIsInstance(el, expressions.PedalBounce)
@@ -1152,7 +1152,7 @@ def testPedalMarks(self):
11521152
self.assertEqual(pm.pedalType, expressions.PedalType.Sustain)
11531153
spElements = pm.getSpannedElements()
11541154
self.assertEqual(len(spElements), 3)
1155-
expectedOffsets = [0., 1., 1.]
1155+
expectedOffsets = [0.0, 1.0, 1.0]
11561156
for i, (el, expectedOffset) in enumerate(zip(spElements, expectedOffsets)):
11571157
if i == 1:
11581158
self.assertIsInstance(el, expressions.PedalBounce)
@@ -1189,7 +1189,7 @@ def testPedalMarks(self):
11891189
self.assertEqual(pm.pedalType, expressions.PedalType.Sustain)
11901190
spElements = pm.getSpannedElements()
11911191
self.assertEqual(len(spElements), 5)
1192-
expectedOffsets = [1.5, 1.75, 0., 0.75, 1.0]
1192+
expectedOffsets = [1.5, 1.75, 0.0, 0.75, 1.0]
11931193
for i, (el, expectedOffset) in enumerate(zip(spElements, expectedOffsets)):
11941194
self.assertIsInstance(el, note.Note)
11951195
self.assertEqual(el.nameWithOctave, 'A3')

music21/pitch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def _convertPsToOct(ps: int|float) -> int:
308308
'''
309309
# environLocal.printDebug(['_convertPsToOct: input', ps])
310310
ps = round(ps, PITCH_SPACE_SIG_DIGITS)
311-
return int(math.floor(ps / 12.)) - 1
311+
return int(math.floor(ps / 12)) - 1
312312

313313

314314
def _convertPsToStep(

0 commit comments

Comments
 (0)