aolabNeuro / aolabNeuro/analyze

optitrack metadata breaks when there are commas in any of the keys or values

Offen
#45 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Python
Sterne
7
Forks
0
Ø Merge
22 Std. 29 Min.
Gemergte PRs (30 T.)
2

Beschreibung

not sure if we can do anything about this, but i get a list index out of range error when using `load_optitrack_metadata()` if the filename has commas in it (this one is called "Chair sequential (up, right, left, down).csv"), which appears as the "take name" entry in the first row of the csv file, commas included. because there are an even number of commas in the name, there ends up being an odd number of columns, so the error pops up.

```
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
in
----> 1 metadata = aopy.data.load_optitrack_metadata(data_dir, filename, metadata_row=0)
2 print(metadata)

~/leo/analyze/aopy/data.py in load_optitrack_metadata(data_dir, filename, metadata_row)
88 # For every pair of values in the list add to dict
89 for idx_dictval in range(0, len(row), 2):
---> 90 mocap_metadata[row[idx_dictval]]= row[idx_dictval + 1]
91
92 # Get Rigid body name for each column

IndexError: list index out of range
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.