IPS-LMU / emuR

The main R package for the EMU Speech Database Management System (EMU-SDMS)
http://ips-lmu.github.io/EMU.html
23 stars 15 forks source link

More helpful error message when trying to add the same track to different trackDefinitions #241

Closed FredrikKarlssonSpeech closed 3 years ago

FredrikKarlssonSpeech commented 3 years ago

I just noticed (by the mistake myself in some test code) that you get a not very helpful error message when you try to do this:

path2demoData = file.path(tempdir(),"emuR_demoData")
unlink(path2demoData, recursive = TRUE)

emuR::create_emuRdemoData()

ae <- emuR::load_emuDB(file.path(path2demoData,"ae_emuDB"))

add_trackDefinition(ae,
                    name="bw",
                    fileExtension ="fms",columnName = "bw")
add_trackDefinition(ae,
                    name="dbw",
                    fileExtension ="fms",columnName = "bw")

Error in wrassp::wrasspOutputInfos[[onTheFlyFunctionName]] : 
  attempt to select less than one element in get1index

I guess the issue is that we should not have the same actual track under different names in the same database. But, that point is not communicated to the user in the clearest way.

raphywink commented 3 years ago

So this (had to fix bad function calls):

path2demoData = file.path(tempdir(),"emuR_demoData")
unlink(path2demoData, recursive = TRUE)

emuR::create_emuRdemoData()

ae <- emuR::load_emuDB(file.path(path2demoData,"ae_emuDB"))

add_ssffTrackDefinition(ae,
                        name="bw",
                        fileExtension ="fms",columnName = "bw")
add_ssffTrackDefinition(ae,
                        name="dbw",
                        fileExtension ="fms",columnName = "bw")

works without an error (although I don't, in general, quite understand what the use is of having 2 track defs. pointing to the same exact column in the SSFF files of the emuDB?)