Hi, The svnmerge update will clear some things up. I've now tracked this to the load_spins() function of generic_fns/structure/main.py. The logic is not very flexible in here, and I think we will need to redesign this function. It is safe to do the redesign in the xyz branch as the 1.3 line is working perfectly at the moment. The redesign is only needed for the XYZ files. This is just because the code was not designed with this type of flexibility in mind.
I would suggest that the logic should follow these options (the container would be either a molecule container, a residue container, or a spin container, and the same logic would be applied to all three): (1) The container name (and number) was not supplied, so check that there is only a single container in the relax data store and that it is unnamed and unnumbered (throw a RelaxError otherwise). (2) The container already exists in the relax data store, so do nothing. (3) There is only a single container in the relax data store and it is empty. (4) The container does not exist, so add it. The order of these would need to be determined. I would suggest we also use a number of pre-written functions from relax: - To get the ID strings, we can use generic_fns.mol_res_spin.generate_spin_id(). This replaces all of the 'id' string manipulation in the current code. - The container objects have is_empty() methods for determining if they are empty. This should be used to identify if the container should be renamed and renumbered in (3). Because of the difficulty of this design, I might try to solve it myself and commit the code to the xyz branch. Regards, Edward On 27 July 2011 12:15, Han Sun <[email protected]> wrote: > Hi Edward, > > ok, I will have a look. I think the problem is that the return_residue > function does not work properly. I hope the 1.3 line has already solved this > problem. > > Best, > Han > > > On Jul 27, 2011, at 12:04 PM, Edward d'Auvergne wrote: > >> Hi Han, >> >> I think you'll need to merge the 1.3 line changes into your branch to >> root out this problem. That will simplify the amount of changed code >> to search for the problem. If you don't know how to do this, see >> section 9.5 of the relax manual for details >> (http://www.nmr-relax.com/manual/1.3/9_5_Branches.html). Note that >> svnmerge for the xyz branch has already been initialised. >> >> Regards, >> >> Edward >> >> >> On 27 July 2011 11:52, Edward d'Auvergne <[email protected]> wrote: >>> >>> Hi, >>> >>> This seems quite strange. When running the test suite, the system >>> tests have 11 failures and 44 errors. There appears to be a problem >>> whereby all spins are being put into the first residue. I.e. multiple >>> residues are no longer supported. This will require a bit of digging. >>> >>> Regards, >>> >>> Edward >>> >>> >>> >>> On 26 July 2011 18:57, Han Sun <[email protected]> wrote: >>>> >>>> Hi Edward, >>>> Now the test passes for reading the xyz file and loading the spins. But >>>> there is a problem for loading the spins in the pdb file. The reason is >>>> in >>>> the generic_fns/structure/main.py function load_spins. We added a check >>>> to >>>> see whether the residue name exists or not. When not, it will add one. >>>> And I >>>> found this rises the problem now for loading the spins of a pdb file >>>> properly. Do you have a idea how to solve it? >>>> Best, >>>> Han >>>> Begin forwarded message: >>>> >>>> From: [email protected] >>>> Date: July 26, 2011 6:47:49 PM GMT+02:00 >>>> To: [email protected] >>>> Subject: r13900 - /branches/xyz/generic_fns/structure/main.py >>>> Reply-To: [email protected] >>>> Author: han87 >>>> Date: Tue Jul 26 18:47:49 2011 >>>> New Revision: 13900 >>>> URL: http://svn.gna.org/viewcvs/relax?rev=13900&view=rev >>>> Log: >>>> Changing the code in the generic_fns/structure/main.py >>>> For printing out of modified spins, a test to check whether the >>>> spin_name >>>> exists or not is added. >>>> Modified: >>>> branches/xyz/generic_fns/structure/main.py >>>> Modified: branches/xyz/generic_fns/structure/main.py >>>> URL: >>>> >>>> http://svn.gna.org/viewcvs/relax/branches/xyz/generic_fns/structure/main.py?rev=13900&r1=13899&r2=13900&view=diff >>>> >>>> ============================================================================== >>>> --- branches/xyz/generic_fns/structure/main.py (original) >>>> +++ branches/xyz/generic_fns/structure/main.py Tue Jul 26 18:47:49 2011 >>>> @@ -602,7 +602,10 @@ >>>> # Print out of modified spins. >>>> if verbosity: >>>> - print(("Extracted " + str(spin.num) + "-" + >>>> str(attached_name) >>>> + " vectors for " + repr(id) + '.')) >>>> + if spin.name: >>>> + print(("Extracted " + spin.name + "-" + >>>> str(attached_name) >>>> + " vectors for " + repr(id) + '.')) >>>> + else: >>>> + print(("Extracted " + str(spin.num) + "-" + >>>> str(attached_name) + " vectors for " + repr(id) + '.')) >>>> # Right, catch the problem of missing vectors to prevent massive >>>> user >>>> confusion! >>>> if no_vectors: >>>> >>>> _______________________________________________ >>>> relax (http://nmr-relax.com) >>>> This is the relax-commits mailing list >>>> [email protected] >>>> To unsubscribe from this list, get a password >>>> reminder, or change your subscription options, >>>> visit the list information page at >>>> https://mail.gna.org/listinfo/relax-commits >>>> >>>> _______________________________________________ >>>> relax (http://nmr-relax.com) >>>> >>>> This is the relax-devel mailing list >>>> [email protected] >>>> >>>> To unsubscribe from this list, get a password >>>> reminder, or change your subscription options, >>>> visit the list information page at >>>> https://mail.gna.org/listinfo/relax-devel >>>> >>>> >>> > > _______________________________________________ relax (http://nmr-relax.com) This is the relax-devel mailing list [email protected] To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel

