Beispiel #1
0
    def setUp(self):
        """Set up tests."""
        self.inCmpFile = path.join(DATA_DIR, "testsort.cmp.h5")
        self.outCmpFile = mkstemp(suffix=".cmp.h5")[1]

        copyfile(self.inCmpFile, self.outCmpFile)
        self.options = Opt()
        self.obj = SortService(self.outCmpFile, self.options)
Beispiel #2
0
class ForQuiverService(object):
    """
    Uses SortService, LoadPulsesService, LoadChemistryService,
    RepackService to post process a cmp.h5 file so that the file can
    be used by quiver directly.
    """
    @property
    def name(self):
        """Name of ForQuiverService."""
        return "ForQuiverService"

    def __init__(self, fileNames, options):
        """Initialize a ForQuiverService object.

        Input:
            fileNames : pbalign file names
            options   : pbalign options

        """
        self.fileNames = fileNames
        self.options = options
        self._loadpulsesService = LoadPulsesService(
            self.fileNames.pulseFileName,
            self.fileNames.outputFileName,
            self.options)
        self._loadchemistryService = LoadChemistryService(
            self.fileNames.pulseFileName,
            self.fileNames.outputFileName,
            self.options)
        self._sortService = SortService(
            self.fileNames.outputFileName,
            self.options)
        self._repackService = RepackService(
            self.fileNames.outputFileName,
            self.fileNames.outputFileName + ".TMP")

    def run(self):
        """ Run the ForQuiver service."""
        logging.info(self.name + ": Sort.")

        self._sortService.checkAvailability()
        self._sortService.run()

        logging.info(self.name + ": LoadPulses.")
        self._loadpulsesService.checkAvailability()
        self._loadpulsesService.run()

        logging.info(self.name + ": LoadChemistry.")
        self._loadchemistryService.checkAvailability()
        self._loadchemistryService.run()

        logging.info(self.name + ": Repack.")
        self._repackService.checkAvailability()
        self._repackService.run()
Beispiel #3
0
class ForQuiverService(object):
    """
    Uses SortService, LoadPulsesService, LoadChemistryService,
    RepackService to post process a cmp.h5 file so that the file can
    be used by quiver directly.
    """
    @property
    def name(self):
        """Name of ForQuiverService."""
        return "ForQuiverService"

    def __init__(self, fileNames, options):
        """Initialize a ForQuiverService object.

        Input:
            fileNames : pbalign file names
            options   : pbalign options

        """
        self.fileNames = fileNames
        self.options = options
        self._loadpulsesService = LoadPulsesService(
            self.fileNames.pulseFileName, self.fileNames.outputFileName,
            self.options)
        self._loadchemistryService = LoadChemistryService(
            self.fileNames.pulseFileName, self.fileNames.outputFileName,
            self.options)
        self._sortService = SortService(self.fileNames.outputFileName,
                                        self.options)
        self._repackService = RepackService(
            self.fileNames.outputFileName,
            self.fileNames.outputFileName + ".TMP")

    def run(self):
        """ Run the ForQuiver service."""
        logging.info(self.name + ": Sort.")

        self._sortService.checkAvailability()
        self._sortService.run()

        logging.info(self.name + ": LoadPulses.")
        self._loadpulsesService.checkAvailability()
        self._loadpulsesService.run()

        logging.info(self.name + ": LoadChemistry.")
        self._loadchemistryService.checkAvailability()
        self._loadchemistryService.run()

        logging.info(self.name + ": Repack.")
        self._repackService.checkAvailability()
        self._repackService.run()
    def setUp(self):
        """Set up tests."""
        self.rootDir = "/mnt/secondary-siv/" + \
                       "testdata/BlasrTestData/pbalign"
        self.inCmpFile = path.join(self.rootDir, "data/testsort.cmp.h5")
        self.outCmpFile = mkstemp(suffix=".cmp.h5")[1]

        copyfile(self.inCmpFile, self.outCmpFile)
        self.options = Opt()
        self.obj = SortService(self.outCmpFile, self.options)
Beispiel #5
0
    def __init__(self, fileNames, options):
        """Initialize a ForQuiverService object.

        Input:
            fileNames : pbalign file names
            options   : pbalign options

        """
        self.fileNames = fileNames
        self.options = options
        self._loadpulsesService = LoadPulsesService(
            self.fileNames.pulseFileName, self.fileNames.outputFileName,
            self.options)
        self._loadchemistryService = LoadChemistryService(
            self.fileNames.pulseFileName, self.fileNames.outputFileName,
            self.options)
        self._sortService = SortService(self.fileNames.outputFileName,
                                        self.options)
        self._repackService = RepackService(
            self.fileNames.outputFileName,
            self.fileNames.outputFileName + ".TMP")
Beispiel #6
0
class Test_SortService(unittest.TestCase):
    """Test pbalign.forquiverservice.sort."""
    def setUp(self):
        """Set up tests."""
        self.inCmpFile = path.join(DATA_DIR, "testsort.cmp.h5")
        self.outCmpFile = mkstemp(suffix=".cmp.h5")[1]

        copyfile(self.inCmpFile, self.outCmpFile)
        self.options = Opt()
        self.obj = SortService(self.outCmpFile, self.options)

    def tearDown(self):
        remove(self.outCmpFile)

    def test_run(self):
        """Test SortService.__init__()."""
        print self.obj.cmd
        _output, errCode, _errMsg = self.obj.run()
        self.assertEqual(errCode, 0)
Beispiel #7
0
    def __init__(self, fileNames, options):
        """Initialize a ForQuiverService object.

        Input:
            fileNames : pbalign file names
            options   : pbalign options

        """
        self.fileNames = fileNames
        self.options = options
        self._loadpulsesService = LoadPulsesService(
            self.fileNames.pulseFileName,
            self.fileNames.outputFileName,
            self.options)
        self._loadchemistryService = LoadChemistryService(
            self.fileNames.pulseFileName,
            self.fileNames.outputFileName,
            self.options)
        self._sortService = SortService(
            self.fileNames.outputFileName,
            self.options)
        self._repackService = RepackService(
            self.fileNames.outputFileName,
            self.fileNames.outputFileName + ".TMP")