-
Notifications
You must be signed in to change notification settings - Fork 15
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
create_itemsInLevel does not order annotation items chronologically in JSON files #273
Comments
Strictly speaking, this is a bug in the EMU-webApp and not in emuR, since the |
I have dug a bit and found out that emuR does in fact go out of its way to make sure they are stored chronologically. But there’s a bug. And very importantly, this bug does not only affect the Apparently the data frame passed to @rpuggaardrode Can you try adding a For the record, here’s how to reproduce this bug: create_emuRdemoData("~/")
db_ae = load_emuDB("~/emuR_demoData/ae_emuDB/")
itemsToCreate = data.frame(session = "0000",
bundle = "msajc003",
level = "Tone",
attribute = "Tone",
labels = "new",
start = 1000,
# db_uuid = db_ae$UUID ### <<- look here
)
create_itemsInLevel(db_ae,
itemsToCreate = itemsToCreate)
query(db_ae, "Tone =~ .*", bundlePattern = "003") %>%
dplyr::select(labels, start, end, start_item_seq_idx) If you leave out And this is the offending line: emuR/R/emuR-annotations_crud.R Line 195 in 543d5fc
I don’t know why This probably only happens in |
Yes, adding a Actually, I think this affects It's very possible that I messed something up, but as far as I can tell this behavior shouldn't be possible at all in the |
@rpuggaardrode, you don’t happen to have an example of this problem with a emuR/R/emuR-annotations_crud.R Lines 280 to 289 in fcf8694
But apparently, that approach with querying using |
On another note, may or may not be related: I am in the process of changing
Currently, even if you did set end times explicitly, they would be ignored and instead calculated based on the next interval’s start time; or in the case of the last segment on a level, based on the duration of the annotated media file. In the current design of Another user was bitten by this, because she wanted to copy the result of some |
Sorry, I've cleaned the problematic examples from both the emuDB and my code, and I'm not even completely sure how to recreate it. I wonder what's wrong with that check in
Right, this tracks with my experience at this point, and is maybe a little unfortunate because of workflows like the one you mentioned. I think intuitively people would like to treat these like intervals, but the current approach is more akin to treating them like points. I see now that the documentation is clear about needing only a start time, but calling it a start time is maybe a little misleading. |
Alright, thanks for your reply.
And they absolutely should do that, since it’s a
Yes and that can be a problem depending on what the user is expecting. I think both these perspectives are relevant use cases: a) I already have start and end time in my data (e.g. because I am basing my new data on a I therefore intend to add a new parameter |
This sounds like totally the right approach imo, and having something like an optional column of end times in the |
@rpuggaardrode: I have changed |
When using
create_itemsInLevel()
to programmatically annotate, annotation items end up being ordered in the JSON files in the order they are added and not the chronological order relative to the sound file. This creates a bug in thewebApp
, such that can be difficult or impossible to select annotation items.In my case I have a level of type
EVENT
. When I use the tab to select the next item, thewebApp
will select the item that was created next, and not the next item in the sound file. Also the highlighted item is not necessarily the one closest to the cursor, which makes it impossible to change or delete items. I suppose the JSON file should be reordered so that thesamplePoint
s are chronological when usingcreate_itemsInLevel()
.The text was updated successfully, but these errors were encountered: