-
Notifications
You must be signed in to change notification settings - Fork 111
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
input_output.load_time_series() -- allow "value" column to support strings? #35
Comments
At the moment the code specifically loads both columns as floats: Can you use np.loadtxt to load columns of different datatypes? It seems as though you have to specify a type and all columns are expected to be of that type. I wrote this loader with melody in mind - it acts as a first check to ensure the data is of the correct type before proceeding. If you make this function return values that are not necessarily floats, you'd have to add a new check for the melody eval code or it could break... |
I believe that yes, you can load different datatypes using that function. The docstring has this example:
One, it's overkill for what I'm asking, but I think you could massage it to behave as intended. Two, while convenient, there's nothing that strictly says it's necessary to use this function (np.loadtxt) versus iterating over a file handle; it's what the rest of the loaders do anyways. Sure, format assertions are always good, and we'd need a different one if the implementation changes. |
I think lists of strings are saner than np.arrays of strings, so I'd prefer that it just dealt with list-like objects of any type. Feel free to change at will. |
So, currently there are @bmcfee 's functions for loading annotations (ranges)/events: Similarly, Is everyone comfortable with me trying to merge all of this functionality? |
Sure.
Agreed, but I'm not sure of an elegant way to do this right now. The |
We still need to merge the loaders. |
OK, the changes proposed above @bmcfee @ejhumphrey @urinieto Important - |
for convenience: https://github.com/craffel/mir_eval/blob/master/mir_eval/input_output.py#L229
Is there any strong opposition to extending this function such that the second column could be strings / labels? The docstring for np.loadtxt makes it look like this would be a simple fix...
The text was updated successfully, but these errors were encountered: