Skip to content

create_itemsInLevel is does not work for segments with multiple attributes #266

@FredrikKarlssonSpeech

Description

@FredrikKarlssonSpeech

There are some issues with create_itemsInLevel, and one of them is that if you have a SEGMENT level with multiple attributes, than you cannot add labels to them.

marks
# A tibble: 8 × 8
  session name               row start_item_seq_idx labels level attribute start
  <chr>   <chr>            <dbl>              <dbl> <chr>  <chr> <chr>     <dbl>
1 0000    dâlem_iso_1_mis      1                  1 1      EGG   EGG       0.002
2 0000    dâlem_iso_1_mis      1                  1 1      EGG   two       0.002
3 0000    dhâlem_iso_1_mis     1                  1 1      EGG   EGG       0.002
4 0000    dhâlem_iso_1_mis     1                  1 1      EGG   two       0.002
5 0000    talam_iso_1_mis      1                  1 1      EGG   EGG       0.002
6 0000    talam_iso_1_mis      1                  1 1      EGG   two       0.002
7 0000    talam_sen_1_mis      1                  1 1      EGG   EGG       0.002
8 0000    talam_sen_1_mis      1                  1 1      EGG   two       0.002
> edf %>% full_join(te) -> marks
Joining, by = "row"
> edf %>% full_join(te) %>% rename(bundle = name) -> marks
Joining, by = "row"
> marks
# A tibble: 8 × 8
  session bundle             row start_item_seq_idx labels level attribute start
  <chr>   <chr>            <dbl>              <dbl> <chr>  <chr> <chr>     <dbl>
1 0000    dâlem_iso_1_mis      1                  1 1      EGG   EGG       0.002
2 0000    dâlem_iso_1_mis      1                  1 1      EGG   two       0.002
3 0000    dhâlem_iso_1_mis     1                  1 1      EGG   EGG       0.002
4 0000    dhâlem_iso_1_mis     1                  1 1      EGG   two       0.002
5 0000    talam_iso_1_mis      1                  1 1      EGG   EGG       0.002
6 0000    talam_iso_1_mis      1                  1 1      EGG   two       0.002
7 0000    talam_sen_1_mis      1                  1 1      EGG   EGG       0.002
8 0000    talam_sen_1_mis      1                  1 1      EGG   two       0.002
> list_levelDefinitions(egg)
  name    type nrOfAttrDefs attrDefNames
1  EGG SEGMENT            1         EGG;
> add_attributeDefinition(egg,levelName = "EGG",name = "two")
  INFO: Rewriting 4 _annot.json files to file system...
  |===============================================================================================================================================================================================================| 100%
> create_itemsInLevel(egg,itemsToCreate = marks)
Error in create_itemsInLevel(egg, itemsToCreate = marks) : 
  Found duplicate sample_start values on same level

The documentation could need some looking over too, but duplicate start ids is kind of the point when you are assigning multiple level attributes, so this needs fixing (and clarification with clear examples).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions