ADIOS icon indicating copy to clipboard operation
ADIOS copied to clipboard

Numpy: Root Path Attributes

Open ax3l opened this issue 9 years ago • 3 comments

@yyalli For an example file such as

$ bpls -Ad test.bp
  long long  a1    attr   = 12
  long long  /a2   attr   = 42

reading attributes relative to the base path is not always working

import adios as ad
f = ad.File("test.bp")
f.attrs["a1"] # works
f.attrs["/a1"] # fails
f.attrs["a2"] # fails
f.attrs["/a2"] # works
f.close()

But access wise, reading with our without the / in the File object should be identical.

ax3l avatar Jul 17 '16 21:07 ax3l

Reading with and without '/' provided in the File object is an extra convenience. As you mentioned, the File object can handle as follows: f["a1"] # works f["/a1"] # works f["a2"] # works f["/a2"] # works

I think it doesn't need to be identical with attr objects which represent "attr" objects in the file. How do you think?

On Jul 17, 2016, at 5:56 PM, Axel Huebl <[email protected]mailto:[email protected]> wrote:

@yyallihttps://github.com/yyalli For an example file such as

$ bpls -Ad test.bp long long a1 attr = 12 long long /a2 attr = 42

reading attributes relative to the base path is not always working

import adios as ad f = ad.File("test.bp") f.attrs["a1"] # works f.attrs["/a1"] # fails f.attrs["a2"] # fails f.attrs["/a2"] # works f.close()

But access wise, reading with our without the / in the File object should be identical.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ornladios/ADIOS/issues/78, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADfdB_6-l6XF3x-IbiZv8fksVMlbYQ_Wks5qWqUBgaJpZM4JOUp1.

jychoi-hpc avatar Jul 18 '16 21:07 jychoi-hpc

Yes, what I suggest is that it should work not only for vars such as f["v1"]==f["/v1"] but also for attributes f.attrs["a1"]==f.attrs["/a1"]

ax3l avatar Jul 18 '16 22:07 ax3l

I have made changes and it should work as you describe. Please let me know if you find any problem.

On Jul 18, 2016, at 6:09 PM, Axel Huebl <[email protected]mailto:[email protected]> wrote:

Yes, what I suggest is that it should work not only for vars such as f["v1"]==f["/v1"] but also for attributes f.attrs["a1"]==f.attrs["/a1"]

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ornladios/ADIOS/issues/78#issuecomment-233474281, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADfdBwW9s4M_9f7JNo3Y6plezAWojZAgks5qW_mFgaJpZM4JOUp1.

jychoi-hpc avatar Jul 19 '16 20:07 jychoi-hpc