Skip to content

Commit

Permalink
Merge pull request #45 from bmcfee/010-documentation
Browse files Browse the repository at this point in the history
doc updates toward 0.1.0
  • Loading branch information
bmcfee committed Mar 18, 2017
2 parents b1976b5 + 853374f commit b928ce2
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2016, Brian McFee
Copyright (c) 2016, 2017-, Brian McFee

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ The goal of this package is to make it easy to convert pairs of `(audio, jams)`
be easily consumed by statistical algorithms. Some desired features:

- Converting tags to sparse encoding vectors
- Sampling `(start, end, label)` to frame-level annotations at a specific sampling rate
- Extracting first-level features (eg, Mel spectra or CQT) from audio
- Aligning and storing the results in a simple data structure (npz, hdf5)
- Sampling `(start, end, label)` to frame-level annotations at a specific frame rate
- Extracting input features (eg, Mel spectra or CQT) from audio
- Converting between annotation spaces for a given task
- Helper variables for semi-supervised learning

## Example usage

Expand All @@ -41,8 +39,9 @@ be easily consumed by statistical algorithms. Some desired features:
>>> p_beat = pumpp.task.BeatTransformer(sr=sr, hop_length=hop_length)
>>> p_chord = pumpp.task.SimpleChordTransformer(sr=sr, hop_length=hop_length)

>>> # Collect the operators
>>> # Collect the operators in a pump
>>> P = pumpp.Pump(p_cqt, p_beat, p_chord)

>>> # Apply the extractors to generate training data
>>> data = P.transform(audio_f, jams_f)

Expand Down
3 changes: 3 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

.. automodule:: pumpp.core
:members:
:noindex:

.. automodule:: pumpp.feature
:members:
Expand All @@ -13,4 +14,6 @@

.. automodule:: pumpp.sampler
:members:
:special-members:
:noindex:

2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,5 @@
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
'librosa': ('https://librosa.github.io/librosa/', None),
'jams': ('https://jams.readthedocs.io/en/latest/', None)}

numpydoc_show_class_members = False
3 changes: 2 additions & 1 deletion pumpp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Pump(object):
Examples
--------
Create a CQT and chord transformer
>>> p_cqt = pumpp.feature.CQT('cqt', sr=44100, hop_length=1024)
>>> p_chord = pumpp.task.ChordTagTransformer(sr=44100, hop_length=1024)
>>> pump = pumpp.Pump(p_cqt, p_chord)
Expand Down Expand Up @@ -151,7 +152,7 @@ def sampler(self, n_samples, duration):
See Also
--------
pumpp.Sampler
pumpp.sampler.Sampler
'''

return Sampler(n_samples, duration, *self.ops)
Expand Down
6 changes: 3 additions & 3 deletions pumpp/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Sampler(object):
duration : int > 0
the duration (in frames) of each sample
*ops : one or more pumpp.feature.FeatureExtractor or pumpp.task.BaseTaskTransformer
ops : one or more pumpp.feature.FeatureExtractor or pumpp.task.BaseTaskTransformer
The operators to include when sampling data.
Expand Down Expand Up @@ -124,8 +124,8 @@ def __call__(self, data):
data : dict
As produced by pumpp.transform
Generates
---------
Yields
------
data_sample : dict
A sequence of patch samples from `data`,
as parameterized by the sampler object.
Expand Down
2 changes: 1 addition & 1 deletion pumpp/task/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, name, namespace, labels=None, sr=22050, hop_length=512):
self.encoder = MultiLabelBinarizer()
self.encoder.fit([labels])
self._classes = set(self.encoder.classes_)

self.register('tags', [None, len(self._classes)], np.bool)

def empty(self, duration):
Expand Down
4 changes: 2 additions & 2 deletions pumpp/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# -*- coding: utf-8 -*-
"""Version info"""

short_version = '0.0'
version = '0.0.0pre'
short_version = '0.1'
version = '0.1.0'

0 comments on commit b928ce2

Please sign in to comment.