Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alternate AnnotationData backend #149

Merged
merged 32 commits into from
May 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
182894e
working on alternate AnnotationData backend
bmcfee May 9, 2017
d0196f8
fixing up tests
bmcfee May 10, 2017
67a74f1
ported over nsconvert
bmcfee May 10, 2017
19aeb2a
fixed slicing
bmcfee May 10, 2017
cc5b4f2
fixed display and sonification
bmcfee May 10, 2017
e3ec170
allow importing annotationdata as Observations as well as dicts
bmcfee May 10, 2017
52a970b
purged jamsframe
bmcfee May 10, 2017
21f8d7d
moved pop_data to annotation
bmcfee May 10, 2017
05c99d2
simplified add_observation
bmcfee May 10, 2017
1d9be64
added dataframe export
bmcfee May 10, 2017
a5efa99
docstrings, repr_html
bmcfee May 10, 2017
6df7535
tests pass again
bmcfee May 13, 2017
99a4f42
linting
bmcfee May 13, 2017
18363eb
Removed validation-on-add from annotations
bmcfee May 13, 2017
1c403ef
added type check to observation container index
bmcfee May 13, 2017
b499c30
removed container check
bmcfee May 13, 2017
7cc38dc
removed annotation.__len__ override
bmcfee May 13, 2017
aaeb321
removed nottest from beat tracking eval
bmcfee May 13, 2017
fa81d8e
added Annotation.to_event_values
bmcfee May 13, 2017
a67f0b3
switched pattern eval to event_values
bmcfee May 13, 2017
92cdaa0
Merge branch 'master' into drop-pandas
bmcfee May 13, 2017
8e49244
recovering from merge weirdness
bmcfee May 13, 2017
039fce0
getting test coverage up
bmcfee May 13, 2017
05f6460
getting test coverage up
bmcfee May 13, 2017
f852a4a
fixed a type output error in to_interval_values
bmcfee May 15, 2017
61147ac
linting
bmcfee May 15, 2017
6aa4460
linting and style
bmcfee May 15, 2017
b965a31
removed timedelta_to_float
bmcfee May 15, 2017
cf81444
removed dangling entry from util docstring index
bmcfee May 15, 2017
c483fcc
upgrading docs
bmcfee May 15, 2017
55c2cd5
cleaning up docstring examples
bmcfee May 15, 2017
f41f717
more cleaning of docs
bmcfee May 15, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,188 changes: 819 additions & 369 deletions docs/examples/example_beat_output.jams

Large diffs are not rendered by default.

584 changes: 292 additions & 292 deletions docs/examples/example_chord.jams

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions docs/examples/example_chord_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
import jams
import sys


def import_chord_jams(infile, outfile):

# import_lab returns a new jams object,
# and a handle to the newly created annotation
jam, chords = jams.util.import_lab('chord', infile)

# Infer the track duration from the end of the last annotation
duration = (chords.data['time'] + chords.data['duration']).max()
duration = max([obs.time + obs.duration for obs in chords])

# this timing will be in pandas timedelta.
# calling duration.total_seconds() converts to float
jam.file_metadata.duration = duration.total_seconds()
jam.file_metadata.duration = duration

chords.time = 0
chords.duration = duration.total_seconds()
chords.duration = duration

# save to disk
jam.save(outfile)
Expand All @@ -27,4 +26,3 @@ def import_chord_jams(infile, outfile):

infile, outfile = sys.argv[1:]
import_chord_jams(infile, outfile)

7 changes: 4 additions & 3 deletions jams/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python
"""Top-level module for JAMS"""

import os
from pkg_resources import resource_filename

# Import the necessary modules
from .exceptions import *
from . import util
Expand All @@ -12,15 +15,13 @@
from .core import *
from .nsconvert import convert

# Populate the namespace mapping
from pkg_resources import resource_filename

# Populate the namespace mapping
for _ in util.find_with_extension(resource_filename(__name__, schema.NS_SCHEMA_DIR),
'json'):
schema.add_namespace(_)

# Populate local namespaces
import os

try:
for _ in util.find_with_extension(os.environ['JAMS_SCHEMA_DIR'], 'json'):
Expand Down
Loading