Skip to content

Commit

Permalink
Merge pull request #129 from sertansenturk/marter0-master
Browse files Browse the repository at this point in the history
Marter0 master
  • Loading branch information
Sertan Şentürk committed Mar 19, 2021
2 parents 10e94bc + 131a3e5 commit 2d6b94c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
8 changes: 5 additions & 3 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Andrés Ferraro aferraro AT dcodesoft DOT com
- SymbTr score format conversions, code styling & development suggestions
Miguel García Casado miguel DOT garciac AT upf DOT edu
- bug fixes
Mogens Lundholm mogens AT lundholm.org
- mu2 to musicXML conversion binaries
- mu2 to musicXML conversion binaries
Miguel García Casado miguel DOT garciac AT upf DOT edu
Marina Nieto marina DOT nieto01 AT estudiant DOT upf DOT edu
Teresa Pelinski teresa DOT pelinski01 AT estudiant DOT upf DOT edu
- bug fixes
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## tomato v0.14.2

- Fix `theoretical_pitch` unit in `NoteModel` class (Pull request [#128](https://github.com/sertansenturk/tomato/pull/128))
- Minor linting improvements (Pull request [#129](https://github.com/sertansenturk/tomato/pull/129))

## tomato v0.14.1

- Bump lxml from 4.4.2 to 4.6.2 (Pull request [#127](https://github.com/sertansenturk/tomato/pull/127))
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def get_version():
mo = re.search(exp, init_contents, re.M)
if mo:
return mo.group(1)
else:
raise ValueError("Unable to find version string in %s." % (f,))

raise ValueError("Unable to find version string in %s." % (f,))


def get_long_description():
Expand Down
2 changes: 1 addition & 1 deletion src/tomato/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.14.1"
__version__ = "0.14.2"
10 changes: 5 additions & 5 deletions src/tomato/audio/notemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _stable_pitches_to_notes(self, stable_pitches_hz,
"theoretical_interval": {"value": note_cent,
"unit": "cent"},
"theoretical_pitch": {"value": theoretical_pitch,
"unit": "cent"},
"unit": "Hz"},
"stable_pitch": {"value": stable_pitch_hz,
"unit": "Hz"}}
break
Expand Down Expand Up @@ -115,8 +115,8 @@ def _get_theoretical_intervals_to_search(self, makam):
try:
key_signature = self._get_extended_key_signature(
makam_dict[makam]["key_signature"], note_dict)
except KeyError:
raise KeyError('Unknown makam')
except KeyError as err:
raise KeyError('Unknown makam') from err
natural_notes = self._get_natural_notes(key_signature, note_dict)

# Remove the notes neighboring the scale notes
Expand Down Expand Up @@ -181,8 +181,8 @@ def _get_extended_key_signature(self, key_sig_in, note_dict):
key_signature = deepcopy(key_sig_in)
for note in list(note_dict.keys()): # extend the key signature to
# octaves
if any([self._is_same_pitch_class(note, ks)
for ks in key_signature]):
if any(self._is_same_pitch_class(note, ks)
for ks in key_signature):
key_signature.append(note)

return list(set(key_signature))
Expand Down
5 changes: 3 additions & 2 deletions src/tomato/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,5 +241,6 @@ def change_file_encoding_to_utf8(cls, filepath):
+ " -t UTF-8 " + filepath + " > tmp.txt "
"&& mv -f tmp.txt " + filepath)
subprocess.check_output(commandstr, shell=True)
except IndexError: # mac
raise OSError('Call this method in Linux for reliable results.')
except IndexError as err: # mac
raise OSError(
'Call this method in Linux for reliable results.') from err
5 changes: 3 additions & 2 deletions src/tomato/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ def _parse_makam(makam_in):
makam = makam_in['mb_attribute']
if not makam:
raise ValueError('MusicBrainz attribute is empty.')
except (KeyError, ValueError):
except (KeyError, ValueError) as err:
try: # attempt to get the name in mu2
makam = makam_in['mu2_name']
if not makam:
raise ValueError('MusicBrainz attribute is empty.')
raise ValueError(
'MusicBrainz attribute is empty.') from err
except (KeyError, ValueError): # use the slug in symbtr name
makam = makam_in['symbtr_slug']
except TypeError: # string
Expand Down

0 comments on commit 2d6b94c

Please sign in to comment.