<br clear="all"><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse;color:rgb(34,34,34)"><p><font face="arial, helvetica, sans-serif">Claudia Millán (<a href="mailto:cmncri@ibmb.csic.es" style="color:rgb(17,85,204)" target="_blank">cmncri@ibmb.csic.es</a>)</font></p>

<p><font face="arial, helvetica, sans-serif">Institut de Biologia Molecular de Barcelona (IBMB-CSIC)</font></p><p><font face="arial, helvetica, sans-serif">Barcelona, Spain</font></p></span>Ok, thanks a lot for the suggestions. I also realised i was having some problems with the PYTHONPATH and then other issues stop to arise. Thanks again for a quick reply :)<div>

<div><br></div><div>Cheers,</div><div><br></div><div>Claudia<br>
<br><br><div class="gmail_quote">2012/10/1 Nathaniel Echols <span dir="ltr">&lt;<a href="mailto:nechols@lbl.gov" target="_blank">nechols@lbl.gov</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Mon, Oct 1, 2012 at 3:29 AM, Claudia Millán Nebot<br>
&lt;<a href="mailto:cmncri@ibmb.csic.es">cmncri@ibmb.csic.es</a>&gt; wrote:<br>
&gt; I&#39;ve just started to look into the cctbx facilities, and as i&#39;m a newbie in<br>
&gt; both object oriented programming and in general to the system, i&#39;m tryng to<br>
&gt; play around and find by myself how things are working. Using the<br>
&gt; cctbx.python, i realised that it is necessary to import explicitly the<br>
&gt; module amino_acid_codes, while for others like atom_name_interpretation this<br>
&gt; is done straigthforward if you do an import from a lower level (like from<br>
&gt; iotbx.pdb import *). Is there some good reason because this has to be like<br>
&gt; that?<br>
<br>
</div>I suspect this is a Python quirk - atom_name_interpretation is<br>
imported at the top of iotbx/pdb/__init__.py, amino_acid_codes is not.<br>
 In general, however, I would recommend two rules for dealing with<br>
imports:<br>
<br>
1. Always explicitly import any module you want - with the exception<br>
that if you do this:<br>
  import iotbx.pdb.amino_acid_codes<br>
you will also have access to iotbx.pdb as well.  In this case you<br>
might want to do this:<br>
  from iotbx.pdb import amino_acid_codes, atom_name_interpretation<br>
the choice of when to use &quot;from foo import bar&quot; versus &quot;import<br>
foo.bar&quot; is up to you, but the latter is a better idea if there is any<br>
ambiguity in the names of submodules (for instance, anything named<br>
&quot;utils&quot;, of which there are probably a half-dozen).<br>
<br>
2. Never use &quot;from foo import *&quot; - it&#39;s just a bad idea, because<br>
anyone else looking at the code won&#39;t be able to tell where a function<br>
comes from.  (Actually, we use this frequently for Boost.Python<br>
extensions, but we shouldn&#39;t.)<br>
<br>
-Nat<br>
_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
</blockquote></div><br></div></div>