Hi Troels, You should here store the outfile as self.tmpfile or ds.tmpfile so that the base class TearDown method removes the file at the end. You also will have to remove the delete argument: [edward@localhost ~]$ python2.5 Python 2.5.6 (r256, Dec 4 2014, 15:01:21) [GCC 4.8.2] on linux3 Type "help", "copyright", "credits" or "license" for more information.
from tempfile import mkdtemp, NamedTemporaryFile outfile= NamedTemporaryFile(delete=False).name
Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: NamedTemporaryFile() got an unexpected keyword argument 'delete'
Cheers, Edward On 6 December 2014 at 15:19, <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet Date: Sat Dec 6 15:19:46 2014 New Revision: 26977 URL: http://svn.gna.org/viewcvs/relax?rev=26977&view=rev Log: Added systemtest Spectrum.test_grace_sn_ratio to help implement plotting the signaÃl to noise ratio per residue. Modified: trunk/test_suite/system_tests/spectrum.py Modified: trunk/test_suite/system_tests/spectrum.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/spectrum.py?rev=26977&r1=26976&r2=26977&view=diff ============================================================================== --- trunk/test_suite/system_tests/spectrum.py (original) +++ trunk/test_suite/system_tests/spectrum.py Sat Dec 6 15:19:46 2014 @@ -194,3 +194,32 @@ # View the plotting. if show_grace: self.interpreter.grace.view(file=outfile, dir=filedir, grace_exe='xmgrace') + + + def test_grace_sn_ratio(self): + """Test grace plotting function for plotting the signal to noise ratio per residue. + """ + + # Setup data. + self.setup_signal_noise_ratio() + + # Calculate the signal to noise ratio calculation. + self.interpreter.spectrum.sn_ratio() + + # Deselect spin with negative intensity. + self.interpreter.deselect.spin(spin_id=':4@N', boolean='AND', change_all=False) + + # Test show grace. If showing, the temporary directory created, should not be deleted. + show_grace = False + if show_grace: + outfile= NamedTemporaryFile(delete=False).name + filedir = dirname(outfile) + else: + filedir = self.tmpdir + outfile = 'int_sn.agr' + + self.interpreter.grace.write(x_data_type='res_num', y_data_type='sn_ratio', file=outfile, dir=filedir, force=True) + + # View the plotting. + if show_grace: + self.interpreter.grace.view(file=outfile, dir=filedir, grace_exe='xmgrace') _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@xxxxxxx 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