Skip to main content

Getting sound/vibration data simply

Project description

odat

Tools to access raw and prepared sound/vibration data.

Modules for prepping data, on a per data/project basis, keeping modules self-contained as much as possible.

Examples

A dacc is a data-accessor. It has methods that provide you with data, ready to use.

List the daccs you have access to

>>> from odat import daccs  # if code changed (e.g. modules added), need to restart kernel to get new daccs
>>> list(daccs)
['xe', 'iatis', 'conveyor_belts_01']

Note: If a dataset doesn't show up, it's the there was an error loading the dataset module. Most of the time the error is that you don't have the credentials. But it could be our fault too! See the Troubleshooting section below for more information.

Print the list, with descriptions

>>> print(*(f"{name}\n\t{info.get('description', 'no description')}" for name, info in daccs.items()), sep='\n')
xe
	Fridge compressor data
iatis
	Over 5 million tagged sounds
conveyor_belts_01
	Conveyor belts

Get a dacc

>>> daccs['xe']
{'name': 'xe',
 'description': 'Fridge compressor data',
 'mk_dacc': <function odat.mdat.xe.mk_dacc(...)>}

So I get a mk_dacc, that apparently is a function to actually get the dacc for me:

>>> mk_dacc = daccs['xe']['mk_dacc']
>>> dacc = mk_dacc()  # most of the time all args have defaults for ease of use, but can be configured

What can I do with a dacc

Well let's see what attributes it has:

>>> dacc = daccs['iatis']['mk_dacc']()
>>> from odat import print_attrs
>>> print_attrs(dacc)
- cache_sref_tag_df:
	bool(x) -> bool Returns True when the argument x is true, False otherwis...
- data_rootdir:
	str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str...
- djoin
- fv_mgc_store:
	Local files store for text dataData is assumed to be a JSON string, and i...
- random_wfsrs_tagged
- sref_tag_bytes_gen
- sref_tag_df:
	Two-dimensional, size-mutable, potentially heterogeneous tabular data....
- sref_tag_store
- sref_tag_wfsr_gen
- tag_counts:
	One-dimensional ndarray with axis labels (including time series). La...
- tag_wf_gen
- tagged_fvs_of_users
- wf_tag_gen:
	Get a (wf, tag) pairs iterator for given tags

Note that if no docs is given for an attribute, you'll get something more like this:

>>> dacc = daccs['se']['mk_dacc']()
>>> from odat import print_attrs
>>> print_attrs(dacc)
- chk_tag_gen
- chk_tag_pairs
- fv_tag_pairs
- key_chks_gen
- key_filt
- key_fvs_gen
- key_snips_gen
- key_tag_chks_gen
- key_tag_fvs_gen
- key_tag_snips_gen
- key_tag_wf_gen
- key_to_tag
- key_wf_gen
- kv_store
- wf_tag_gen

That wf_tag_gen is quite common. It gives us an iterator of (wf, tag) pairs where wf is a waveform (as a numerical array), and tag is an annotation, or label, describing some aspect of that waveform.

You usually use it in this form:

for wf, tag in dacc.wf_tag_gen():  # here the wf_tag_gen takes no arguments (but sometimes args are required)
    # do something cool

Troubleshooting

When you don't see a dacc you expect

You want to see why some of the modules didn't show up in your daccs dict:

>>> from odat import dacc_info_gen
>>> _ = list(dacc_info_gen(on_error='print'))  # or on_error='raise' if you want to blow up on the first error and see stacktrace
Error with odat.mdat.sa: 'context.csv'

You want more details on a specific module (here, the sa module) that has errors:

>>> from odat.mdat import sa
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
...
KeyError: 'context.csv'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odat-0.0.9.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odat-0.0.9-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file odat-0.0.9.tar.gz.

File metadata

  • Download URL: odat-0.0.9.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for odat-0.0.9.tar.gz
Algorithm Hash digest
SHA256 37d829b55e68ebb86ed2a29eb802af2b4557ff96f42c119ce401ef688c861c01
MD5 e3f92c8525327ed4dad976207c341fcf
BLAKE2b-256 e054fa862eb8955a3537237fc721cef5e4e04dabec75a42b5841a70ff55a9f2d

See more details on using hashes here.

File details

Details for the file odat-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: odat-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for odat-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 a0550543fb873fcae5fd9fa8ac24d8e4b5d0846846f8571808fb26962b374498
MD5 267d91b24098d8baf129035b04c53266
BLAKE2b-256 a02fc9d1cd8873100b627bcaa5854b32916d8cbc5edfc72c4a377b829f3d0b82

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page