-
Notifications
You must be signed in to change notification settings - Fork 58
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
What information can be abstracted to the track.Track object? #224
Comments
Thank you for raising this. Yes, all of this is correct. Here are some details:
*
def validate(self):
missing_files = []
invalid_checksums = []
for track_tuple in self.track_index.values():
track_path, checksum = track_tuple
# validate that the file exists on disk
if not os.path.exists(track_path):
missing_files.append(track_path)
# validate that the checksum matches
elif utils.md5(track_path) != checksum:
invalid_checksums.append(track_path)
return missing_files, invalid_checksums Long-term, i would love to implement a "safe" mode of mirdata where we'd validate the track automatically before accessing the audio property, and raises an error if a checksum is invalid. This safe mode could be a flag in the Track constructor. In this way, users wouldn't need to run validate manually to be warned of a problem: they would just load stuff and access it with peace of mind.
Yes. In fact, i could see three stage of "loading" a Track: At the moment, mirdata does (3) splendidly, (2) inelegantly (copying over values from the |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
The generic
mirdata.track.Track
object provides a simple abstraction in order to automate the__repr__
method which we used to write manually for each dataset's module.In #219 @lostanlen experimented with what other information we could abstract in order to simplify each module's Track object. He proposed to have the following live as attributes/properties/methods of the new Track object:
audio
which loads an attribute in the track index called audioduration
(pulling from either the metadata or from audio)from_jams
method which instantiates mirdata objects from a jams objectload_metadata
method, which would live at the track-level rather than the module levelto_jams
method by programatically parsing the track attributesvalidate
method, which would live at the track-level rather than the module levelAny thoughts about each of these abstractions?
(@lostanlen correct any of this if I got the details wrong)
The text was updated successfully, but these errors were encountered: