gafusion / omas

Ordered Multidimensional Array Structure
http://gafusion.github.io/omas
MIT License
30 stars 15 forks source link

Length of lists/arrays of strings accessed by `.:.` is set by first element and not extended later, which causes strings to be truncated #125

Closed eldond closed 3 years ago

eldond commented 3 years ago

Sample code:

OMFIT['ods'] = ods = ODS()
ods['langmuir_probes.embedded.0.name'] = 1
ods['langmuir_probes.embedded.1.name'] = 10
ods['langmuir_probes.embedded.2.name'] = 100
print(ods['langmuir_probes']['embedded.:.name'])

Actual result:

['1' '1' '1']

Desired result:

['1' '10' '100']

These strings happen to contain numbers this time because that's how KSTAR probes are designated. But the general case is for these to be strings. It works as desired if probe 0 has the longer number, but... uh... that's not how numbers usually work.

eldond commented 3 years ago

I bet this is related to #124