示例#1
0
    def test_copy_current(self):
        """Test the copying of current data pipe.

        The function tested is pipe_control.pipes.copy().
        """

        # Copy the 'orig' data pipe to the 'new' data pipe.
        pipes.copy(pipe_to='new')

        # Test that the new data pipe exists.
        self.assert_('new' in ds)

        # Test that the new data pipe has the object 'x' and that its value is 1.
        self.assertEqual(ds['new'].x, 1)

        # Change the value of x.
        ds['new'].x = 2

        # Test that the two values are different.
        self.assert_(ds['orig'].x != ds['new'].x)

        # Test that the new data pipe has the object 'mol[0].res[0].spin[0].num' and that its value is 1.
        self.assertEqual(ds['new'].mol[0].res[0].spin[0].num, 1)

        # Change the spin system number.
        ds['new'].mol[0].res[0].spin[0].num = 2

        # Test that the original spin system number hasn't changed.
        self.assertEqual(ds['orig'].mol[0].res[0].spin[0].num, 1)
示例#2
0
    def test_copy_current(self):
        """Test the copying of current data pipe.

        The function tested is pipe_control.pipes.copy().
        """

        # Copy the 'orig' data pipe to the 'new' data pipe.
        pipes.copy(pipe_to='new')

        # Test that the new data pipe exists.
        self.assert_('new' in ds)

        # Test that the new data pipe has the object 'x' and that its value is 1.
        self.assertEqual(ds['new'].x, 1)

        # Change the value of x.
        ds['new'].x = 2

        # Test that the two values are different.
        self.assert_(ds['orig'].x != ds['new'].x)

        # Test that the new data pipe has the object 'mol[0].res[0].spin[0].num' and that its value is 1.
        self.assertEqual(ds['new'].mol[0].res[0].spin[0].num, 1)

        # Change the spin system number.
        ds['new'].mol[0].res[0].spin[0].num = 2

        # Test that the original spin system number hasn't changed.
        self.assertEqual(ds['orig'].mol[0].res[0].spin[0].num, 1)
示例#3
0
文件: api.py 项目: tlinnet/relax
    def duplicate_data(self,
                       pipe_from=None,
                       pipe_to=None,
                       model_info=None,
                       global_stats=False,
                       verbose=True):
        """Duplicate the data specific to a single frame order data pipe.

        @keyword pipe_from:     The data pipe to copy the data from.
        @type pipe_from:        str
        @keyword pipe_to:       The data pipe to copy the data to.
        @type pipe_to:          str
        @keyword model_info:    The model information from model_loop().  This is unused.
        @type model_info:       None
        @keyword global_stats:  The global statistics flag.
        @type global_stats:     bool
        @keyword verbose:       Unused.
        @type verbose:          bool
        """

        # Check that the data pipe does not exist.
        if pipes.has_pipe(pipe_to):
            raise RelaxError("The data pipe '%s' already exists." % pipe_to)

        # Create the pipe_to data pipe by copying.
        pipes.copy(pipe_from=pipe_from, pipe_to=pipe_to)
示例#4
0
文件: api.py 项目: pombredanne/relax
    def duplicate_data(self, pipe_from=None, pipe_to=None, model_info=None, global_stats=False, verbose=True):
        """Duplicate the data specific to a single frame order data pipe.

        @keyword pipe_from:     The data pipe to copy the data from.
        @type pipe_from:        str
        @keyword pipe_to:       The data pipe to copy the data to.
        @type pipe_to:          str
        @keyword model_info:    The model information from model_loop().  This is unused.
        @type model_info:       None
        @keyword global_stats:  The global statistics flag.
        @type global_stats:     bool
        @keyword verbose:       Unused.
        @type verbose:          bool
        """

        # Check that the data pipe does not exist.
        if pipes.has_pipe(pipe_to):
            raise RelaxError("The data pipe '%s' already exists." % pipe_to)

        # Create the pipe_to data pipe by copying.
        pipes.copy(pipe_from=pipe_from, pipe_to=pipe_to)