Python API for associated attributes
Created by: pnorbert
Is there a Python equivalent of the C++ AvailableAttributes(string varname)? Needed by @isosc
This does not work:
$ python3
Python 3.5.2 (default, Jul 10 2019, 11:58:48)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import adios2
>>> import numpy
>>> fr = adios2.open("heat2d/fortran/a.bp", "r")
>>> vars_info = fr.available_variables()
>>> vars_info
{'T': {'AvailableStepsCount': '4', 'Type': 'double', 'SingleValue': 'false', 'Max': '200', 'Shape': '768, 1024', 'Min': '0'}, 'dT': {'AvailableStepsCount': '4', 'Type': 'double', 'SingleValue': 'false', 'Max': '74.5893', 'Shape': '768, 1024', 'Min': '-77.3378'}}
>>> attrs_info = fr.available_attributes()
>>> attrs_info
{'dT/description': {'Value': '"Temperature difference between two steps calculated in analysis"', 'Type': 'string', 'Elements': '1'}, 'T/unit': {'Value': '"C"', 'Type': 'string', 'Elements': '1'}, 'T/description': {'Value': '"Temperature from simulation"', 'Type': 'string', 'Elements': '1'}}
>>> desc = fr.available_attributes('dT')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: available_attributes(): incompatible function arguments. The following argument types are supported:
1. (self: adios2.File) -> Dict[str, Dict[str, str]]
Invoked with: <adios2.file named '../heat2d/fortran/a.bp' and mode 'r'>, 'dT'