{"action":"opened","issue":{"url":"https://api.github.com/repos/bmcfee/librosa/issues/141","labels_url":"https://api.github.com/repos/bmcfee/librosa/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/bmcfee/librosa/issues/141/comments","events_url":"https://api.github.com/repos/bmcfee/librosa/issues/141/events","html_url":"https://github.com/bmcfee/librosa/issues/141","id":53408766,"number":141,"title":"The great refactor: modules -> submodules","user":{"login":"bmcfee","id":1190540,"avatar_url":"https://avatars.githubusercontent.com/u/1190540?v=3","gravatar_id":"","url":"https://api.github.com/users/bmcfee","html_url":"https://github.com/bmcfee","followers_url":"https://api.github.com/users/bmcfee/followers","following_url":"https://api.github.com/users/bmcfee/following{/other_user}","gists_url":"https://api.github.com/users/bmcfee/gists{/gist_id}","starred_url":"https://api.github.com/users/bmcfee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmcfee/subscriptions","organizations_url":"https://api.github.com/users/bmcfee/orgs","repos_url":"https://api.github.com/users/bmcfee/repos","events_url":"https://api.github.com/users/bmcfee/events{/privacy}","received_events_url":"https://api.github.com/users/bmcfee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bmcfee","id":1190540,"avatar_url":"https://avatars.githubusercontent.com/u/1190540?v=3","gravatar_id":"","url":"https://api.github.com/users/bmcfee","html_url":"https://github.com/bmcfee","followers_url":"https://api.github.com/users/bmcfee/followers","following_url":"https://api.github.com/users/bmcfee/following{/other_user}","gists_url":"https://api.github.com/users/bmcfee/gists{/gist_id}","starred_url":"https://api.github.com/users/bmcfee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmcfee/subscriptions","organizations_url":"https://api.github.com/users/bmcfee/orgs","repos_url":"https://api.github.com/users/bmcfee/repos","events_url":"https://api.github.com/users/bmcfee/events{/privacy}","received_events_url":"https://api.github.com/users/bmcfee/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/bmcfee/librosa/milestones/5","labels_url":"https://api.github.com/repos/bmcfee/librosa/milestones/5/labels","id":665904,"number":5,"title":"0.4","description":"","creator":{"login":"bmcfee","id":1190540,"avatar_url":"https://avatars.githubusercontent.com/u/1190540?v=3","gravatar_id":"","url":"https://api.github.com/users/bmcfee","html_url":"https://github.com/bmcfee","followers_url":"https://api.github.com/users/bmcfee/followers","following_url":"https://api.github.com/users/bmcfee/following{/other_user}","gists_url":"https://api.github.com/users/bmcfee/gists{/gist_id}","starred_url":"https://api.github.com/users/bmcfee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmcfee/subscriptions","organizations_url":"https://api.github.com/users/bmcfee/orgs","repos_url":"https://api.github.com/users/bmcfee/repos","events_url":"https://api.github.com/users/bmcfee/events{/privacy}","received_events_url":"https://api.github.com/users/bmcfee/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":6,"state":"open","created_at":"2014-05-21T15:55:46Z","updated_at":"2015-01-05T15:44:25Z","due_on":"2014-12-31T08:00:00Z","closed_at":null},"comments":0,"created_at":"2015-01-05T15:44:25Z","updated_at":"2015-01-05T15:44:25Z","closed_at":null,"body":"A tally of the current line counts (in the development branch) shows certain modules getting a bit unwieldy:\r\n\r\n```\r\n[~/git/librosa/librosa⚡:develop]➔ wc -l *.py |sort -n\r\n    24 __init__.py\r\n    49 cache.py\r\n   151 chord.py\r\n   205 effects.py\r\n   214 output.py\r\n   221 onset.py\r\n   242 decompose.py\r\n   291 segment.py\r\n   355 beat.py\r\n   412 display.py\r\n   461 filters.py\r\n   825 util.py\r\n  1386 feature.py\r\n  1800 core.py\r\n  6636 total\r\n```\r\n\r\nEspecially `util`, `feature` and `core` are quite large.  We should factor out common functionality into submodules that get *-imported (to preserve the namespace).\r\n\r\nMore concretely, for `core`,  we can have the following structure\r\n```\r\ncore/__init__.py       # top-level\r\ncore/audio.py          # load, resample, to_mono\r\ncore/transforms.py     # stft, istft, ifgram, cqt,\r\ncore/frequency.py      # converters, *_frequencies()\r\ncore/pv.py             # phase vocoder\r\ncore/core.py           # remaining functionality\r\n```\r\n\r\nfor `feature`:\r\n```\r\nfeature/__init__.py   # top-level\r\nfeature/spectral.py   # centroid, bandwidth, contrast, rolloff, rms, poly\r\nfeature/pitch.py      # pitch and tuning, chroma, logfs\r\nfeature/timbre.py     # mel, mfcc\r\nfeature/util.py       # delta, stack, sync\r\n```\r\n\r\nand for `util`:\r\n```\r\nutil/__init__.py\r\nutil/feature_extractor.py  # pull out the sklearn integrator\r\nutil/util.py\r\n```\r\n\r\nAdditional refactoring items:\r\n- [ ] all functions under the heading \"-- UTILITIES --\" in `core` should be moved into `util`\r\n- [ ] remove the `chord` module"}}