marl / jams

A JSON Annotated Music Specification for Reproducible MIR Research
ISC License
186 stars 27 forks source link

Efficiency improvements for namespace conversion #156

Closed bmcfee closed 7 years ago

bmcfee commented 7 years ago

This affects sonification, eval, and display as well.

The current method for automatic namespace conversion does a brute-force check over all potential namespaces until one provides a positive hit. Hit checking is done by coercion followed by validation, which can be exceedingly slow for dense, structured namespaces (eg, pitch_contour).

This could potentially be accelerated by exposing a validate= flag to sonify, which allows a user to bypass the validation check if the data is known to be clean. Additionally, we could first check if the annotation in question already exists in the target namespace and bypass coercion entirely. However, the latter should be baked into the conversion system from the ground up so that it's fast whenever it can be.

bmcfee commented 7 years ago

Upon further reflection, bypassing validation is dangerous since it would break the fall-back ordered dictionary algorithm for coercion. I think we can skip this for now.