<div dir="ltr">Hi Rob,<div><br></div><div>Yes, you can access those attributes, but you have to work with the phil object, not the extract. Here is some sample code. There is more code in the libtbx/phil/interface.py that builds some dictionaries for tracking these values.</div><div><br></div><div><font face="monospace">arrayinfo_phil_str = """<br>selected_info {<br> span = True<br> .type = bool<br> .short_caption = "Span"<br> minmax_data = True<br> .type = bool<br> .short_caption = "min,max data"<br>}<br>"""<br><br>def recursive_show(phil_object):<br> for o in phil_object.objects:<br> if o.is_scope:<br> recursive_show(o)<br> elif o.is_definition:<br> # o.show()<br> print('My name is', <a href="http://o.name">o.name</a>)<br> print('My value is', str(o.words[0]))<br> print('My type is', str(o.type))<br> print('My short_caption is', o.short_caption)<br> print('My full path is', o.full_path())<br> # print(dir(o))<br><br>from libtbx.phil import parse<br>p = parse(arrayinfo_phil_str)<br>recursive_show(p)</font><br></div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div>--</div><div><span style="font-size:12.8000001907349px">Billy K. Poon</span><br></div></div><div>Research Scientist, Molecular Biophysics and Integrated Bioimaging</div><div>Lawrence Berkeley National Laboratory</div><div>1 Cyclotron Road, M/S 33R0345</div><div>Berkeley, CA 94720</div><div>Fax: (510) 486-5909</div><div>Web: <a href="https://phenix-online.org" target="_blank">https://phenix-online.org</a></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 14, 2021 at 4:40 PM Robert Oeffner <<a href="mailto:rdo20@cam.ac.uk">rdo20@cam.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Most likely a trivial question but if I have a PHIL object such as one <br>
based on the string<br>
<br>
arrayinfo_phil_str = """<br>
selected_info {<br>
span = True<br>
.type = bool<br>
.short_caption = "Span"<br>
minmax_data = True<br>
.type = bool<br>
.short_caption = "min,max data"<br>
}<br>
"""<br>
<br>
I can then get the PHIL definitions span and minmax_data as python <br>
values like:<br>
<br>
from libtbx.phil import parse<br>
parse(arrayinfo_phil_str).extract().selected_info.span<br>
parse(arrayinfo_phil_str).extract().selected_info.minmax_data<br>
<br>
But how do I access the values of the short_caption attribute of these <br>
definitions? Does that make sense or have not understood correctly how <br>
PHIL works?<br>
<br>
<br>
Thanks,<br>
<br>
<br>
Rob<br>
<br>
<br>
<br>
<br>
-- <br>
This email has been checked for viruses by AVG.<br>
<a href="https://www.avg.com" rel="noreferrer" target="_blank">https://www.avg.com</a><br>
<br>
_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org" target="_blank">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" rel="noreferrer" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
</blockquote></div>