Commit 4988c49e authored by Somnath, Suhas's avatar Somnath, Suhas
Browse files

Merge remote-tracking branch 'origin/master'

parents a27e6c6c e3e7f86c
......@@ -2,6 +2,10 @@
pycroscopy
==========
.. image:: http://pepy.tech/badge/pycroscopy
:target: http://pepy.tech/project/pycroscopy
:alt: Downloads
.. image:: https://img.shields.io/travis/pycroscopy/pycroscopy/master.svg
:target: https://travis-ci.org/pycroscopy/pycroscopy
:alt: TravisCI
......
......@@ -27,16 +27,28 @@ def unnest_parm_dicts(image_parms, prefix=''):
new_parms = dict()
for name in image_parms.keys():
val = image_parms[name]
# print('name',name,'val',val)
# print('name', name, 'val', val)
name = '-'.join([prefix] + name.split()).strip('-')
if isinstance(val, dict):
new_parms.update(unnest_parm_dicts(val, name))
elif isinstance(val, list):
if len(val) == 0:
continue
elif isinstance(val[0], dict):
for thing in val:
new_parms.update(unnest_parm_dicts(thing, name))
ithing = 0
thing_list = list()
for thing in val:
temp_name = '-'.join([name, str(ithing)])
if isinstance(thing, dict):
thing_dict = unnest_parm_dicts(thing, temp_name)
ithing += 1
new_parms.update(thing_dict)
else:
thing_list.append(thing)
if thing_list != list():
new_parms.update({name: thing_list})
else:
new_parms[name] = try_tag_to_string(val)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment