Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def getDatasetStructure(ds):
structure = {}
# for each data param (non-independent param)
for dependent_id in get_dependents(ds.conn, ds.run_id):
# get name etc.
layout = get_layout(ds.conn, dependent_id)
name = layout['name']
structure[name] = {'values' : [], 'unit' : layout['unit'], 'axes' : []}
# find dependencies (i.e., axes) and add their names/units in the right order
dependencies = get_dependencies(ds.conn, dependent_id)
for dep_id, iax in dependencies:
dep_layout = get_layout(ds.conn, dep_id)
dep_name = dep_layout['name']
structure[name]['axes'].insert(iax, dep_name)
structure[dep_name] = {'values' : [], 'unit' : dep_layout['unit']}
return structure
def getDatasetStructure(ds):
structure = {}
# for each data param (non-independent param)
for dependent_id in get_dependents(ds.conn, ds.run_id):
# get name etc.
layout = get_layout(ds.conn, dependent_id)
name = layout['name']
structure[name] = {'values' : [], 'unit' : layout['unit'], 'axes' : []}
# find dependencies (i.e., axes) and add their names/units in the right order
dependencies = get_dependencies(ds.conn, dependent_id)
for dep_id, iax in dependencies:
dep_layout = get_layout(ds.conn, dep_id)
dep_name = dep_layout['name']
structure[name]['axes'].insert(iax, dep_name)
structure[dep_name] = {'values' : [], 'unit' : dep_layout['unit']}
return structure