Skip to content

Commit

Permalink
Merge branch 'master' into devel_docs
Browse files Browse the repository at this point in the history
Conflicts:
	VERSION_HISTORY.md
	doc/api/about.rst
  • Loading branch information
crantila committed Oct 15, 2015
2 parents 2769779 + 9333115 commit b1d71e1
Show file tree
Hide file tree
Showing 45 changed files with 1,781 additions and 510 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[run]
source = vis
omit = vis/tests/*,vis/analyzers/*/template*,*/__init__*
omit = vis/tests/*,vis/analyzers/*/template*,vis/scripts/*,*/__init__*
15 changes: 8 additions & 7 deletions .travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Configuration File for Travis-CI

sudo: false
addons:
apt:
packages:
- liblapack-dev
- gfortran
language: python
python:
- "2.7"
- "3.3"
- "3.4"

install: pip install -r vis/requirements.txt

install: travis_wait pip install -r vis/travis_requirements.txt
script: coverage run run_tests.py

after_success: coveralls
after_success: coveralls
16 changes: 9 additions & 7 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ The VIS Framework

The VIS Framework for Music Analysis

[![Build Status](https://travis-ci.org/ELVIS-Project/vis.svg?branch=master)](https://travis-ci.org/ELVIS-Project/vis-framework)
[![Coverage Status](https://img.shields.io/coveralls/ELVIS-Project/vis.svg)](https://coveralls.io/r/ELVIS-Project/vis-framework)
[![Latest Version](https://pypip.in/version/vis-framework/badge.svg?text=version)](https://pypi.python.org/pypi/vis-framework/)
[![License](https://pypip.in/license/vis-framework/badge.svg)](https://www.gnu.org/licenses/agpl-3.0.html)
[![Build Status](https://travis-ci.org/ELVIS-Project/vis-framework.svg?branch=master)](https://travis-ci.org/ELVIS-Project/vis-framework)
[![Coverage Status](https://coveralls.io/repos/ELVIS-Project/vis-framework/badge.svg?branch=master&service=github)](https://coveralls.io/github/ELVIS-Project/vis-framework?branch=master)
[![Latest Version](https://img.shields.io/pypi/v/vis-framework.svg)](https://pypi.python.org/pypi/vis-framework/)
[![License](https://img.shields.io/badge/license-AGPL%203.0-blue.svg)](https://www.gnu.org/licenses/agpl-3.0.html)

The VIS Framework is a Python package that uses the music21 and pandas libraries to build a ridiculously flexible and preposterously easy system for writing computer music analysis programs.

Expand All @@ -23,16 +23,18 @@ The VIS Framework uses many software libraries to help with analysis. These are
- Python 2.7
- music21
- pandas
- mock (for testing)
- coverage (for testing)
- python-coveralls (to for automated coverage with coveralls.io)

These are recommended dependencies:

- numexpr (improved performance for pandas)
- Bottleneck (improved performance for pandas)
- tables (HDF5 output for pandas)
- openpyxl (Excel output for pandas)
- mock (for testing)
- coverage (for testing)
- python-coveralls (to for automated coverage with coveralls.io)
- matplotlib (plotting)
- scipy (plotting)

Citation
========
Expand Down
15 changes: 12 additions & 3 deletions VERSION_HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ VERSION HISTORY
This file records version-to-version changes in the VIS Framework. The most recent versions are at
the top of the file.


* 2.2.0 (pending release):
- Python 3 compatibility.
* 2.3.0 (pending release):
- Importing no longer uses/stores cached pickle files.
- WorkflowManager.output() produces many table-format results if "count frequency" is False.
- WorkflowManager.output() changes the column name for table-like outputs, according to the experiment.
- Greatly improved API documentation.
* 2.2.1:
- set music21 version to 2.1.2 exclusively
* 2.2.0:
- Python 3 compatibility.
- New: hierarchical clustering and dendrogram graphical output with dendrogram.py
- Refactoring/rewrite: update make_return() method in indexer.py to greatly enhance performance when creating dataframes. Uses pandas.concat() instead of pandas.DataFrame()
- Refactoring: simplified the way several indexers and experimenters internally set their settings to make their init methods easier to read. Uses .update() instead of making piecemeal changes.
- Tests: includes 15 new tests in a test suite for the dendrogram.py file and comments out 2 tests in offset.py because they are incompatible with the new version of make_return() as they pass magic mock objects to a be concatenated by pandas.concat().
- Automated test and code coverage fix
- cleanup of dependencies/requirements (big thanks to maxalbert, https://github.com/maxalbert)
- 'scripts' directory for helpful scripts
* 2.1.3
- can turn on/off multiprocessing
- fixed issue with Pandas converting strings to floats (or, rather, hacked a solution)
Expand Down
8 changes: 7 additions & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Filename: run_tests.py
# Purpose: Run automated tests for the VIS Framework.
#
# Copyright (C) 2012, 2013, 2014 Jamie Klassen, Christopher Antila, Ryan Bannon
# Copyright (C) 2012, 2013, 2014 Jamie Klassen, Christopher Antila, Ryan Bannon, Alexander Morgan
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
Expand All @@ -33,13 +33,16 @@
from vis.tests import test_indexer
from vis.tests import test_duration_indexer
from vis.tests import test_note_beat_strength_indexer
from vis.tests import test_measure_indexer
from vis.tests import test_note_rest_indexer
from vis.tests import test_ngram
from vis.tests import test_dissonance_indexer
from vis.tests import test_repeat
from vis.tests import test_interval_indexer
from vis.tests import test_frequency_experimenter
from vis.tests import test_aggregator
from vis.tests import test_barchart
from vis.tests import test_dendrogram
from vis.tests import test_offset
from vis.tests import test_lilypond
from vis.tests import test_indexed_piece
Expand All @@ -61,12 +64,14 @@
test_note_rest_indexer.NOTE_REST_INDEXER_SUITE,
test_duration_indexer.DURATION_INDEXER_SUITE,
test_note_beat_strength_indexer.NOTE_BEAT_STRENGTH_INDEXER_SUITE,
test_measure_indexer.MEASURE_INDEXER_SUITE,
test_interval_indexer.INTERVAL_INDEXER_SHORT_SUITE,
test_interval_indexer.INTERVAL_INDEXER_LONG_SUITE,
test_interval_indexer.INT_IND_INDEXER_SUITE,
test_interval_indexer.HORIZ_INT_IND_LONG_SUITE,
test_repeat.REPEAT_INDEXER_SUITE,
test_ngram.NGRAM_INDEXER_SUITE,
test_dissonance_indexer.DISSONANCE_INDEXER_SUITE,
test_offset.OFFSET_INDEXER_SINGLE_SUITE,
test_offset.OFFSET_INDEXER_MULTI_SUITE,
test_lilypond.ANNOTATION_SUITE,
Expand All @@ -77,6 +82,7 @@
test_frequency_experimenter.FREQUENCY_SUITE,
test_aggregator.COLUMN_AGGREGATOR_SUITE,
test_barchart.R_BAR_CHART_SUITE,
test_dendrogram.DENDROGRAM_SUITE,
# IndexedPiece and AggregatedPieces
test_indexed_piece.INDEXED_PIECE_SUITE_A,
test_indexed_piece.INDEXED_PIECE_SUITE_B,
Expand Down
15 changes: 4 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,13 @@
platforms = 'any',
keywords = ['music', 'music analysis', 'music theory', 'counterpoint'],
requires = [
# NB: keep this in sync with vis/requirements.txt and vis/optional_requirements.txt
# NB2: I left out the optional requirements and mock, since they aren't *required*
'music21 (>=2.0.3, <2.1)',
'pandas (>=0.14.1, <0.16)',
'music21 (== 2.1.2)',
'pandas (>= 0.14.1, < 0.17)'
],
install_requires = [
'music21 >= 2.0.3, <2.1',
'pandas >=0.14.1, <0.16',
'music21 == 2.1.2',
'pandas >= 0.14.1, < 0.17'
],
dependency_links = [
# music21 2.0.3 has not been released to PyPl yet (2015-05-20).
# This particular commit fixes an issue with exporting fermatas on rests.
"https://github.com/cuthbertLab/music21/archive/3fb33def708602485eadc1a655ede2fe22acb766.zip#egg=music21-2.0.3"
],
packages = [
'vis',
'vis.models',
Expand Down
4 changes: 2 additions & 2 deletions vis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_MAJOR = 2
_MINOR = 1
_PATCH = 3
_MINOR = 2
_PATCH = 1
__version__ = '{}.{}.{}'.format(_MAJOR, _MINOR, _PATCH)
29 changes: 6 additions & 23 deletions vis/analyzers/experimenters/barchart.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,15 @@ def __init__(self, index, settings=None):
if 'pathname' not in settings:
raise RuntimeError(RBarChart._MISSING_SETTINGS)

self._settings = {'pathname': settings['pathname']}

# set 'type' ensuring it is valid
# Make sure 'type' is valid
if 'type' in settings:
if settings['type'] in RBarChart.OUTPUT_TYPES:
self._settings['type'] = settings['type']
else:
if settings['type'] not in RBarChart.OUTPUT_TYPES:
raise RuntimeError(RBarChart._INVALID_TYPE.format(settings['type']))
else:
self._settings['type'] = RBarChart.default_settings['type']

# set the other settings
if 'column' in settings:
self._settings['column'] = settings['column']
else:
self._settings['column'] = RBarChart.default_settings['column']

if 'token' in settings:
self._settings['token'] = settings['token']
else:
self._settings['token'] = RBarChart.default_settings['token']

if 'nr_pieces' in settings:
self._settings['nr_pieces'] = str(settings['nr_pieces'])
else:
self._settings['nr_pieces'] = RBarChart.default_settings['nr_pieces']
self._settings = RBarChart.default_settings.copy()
self._settings.update(settings)
if self._settings['nr_pieces'] is not None:
self._settings['nr_pieces'] = str(self._settings['nr_pieces'])

# set the path to the script
self._r_bar_chart_path = path.join(vis.__path__[0], 'scripts', 'R_bar_chart.r')
Expand Down
Loading

0 comments on commit b1d71e1

Please sign in to comment.