def unitTestInitialState(self):
     """
     Check the initialization of the share:
     """
     EDAssert.equal(False, EDShare.isInitialized(), "Check that EDShare is uninitialized")
     EDShare.initialize(os.path.join(tempfile.gettempdir(), "edna-%s" % os.environ["USER"]))
     EDShare["test1"] = range(10)
     EDVerbose.screen("Backend used is %s" % EDShare.backend)
     EDAssert.equal(1, len(EDShare.items()))
     EDAssert.equal(True, "test1" in EDShare, "list is actually present")
     for i, j in zip(range(10), EDShare["test1"]):
         EDAssert.equal(i, j, "elements are the same")
     EDShare.close()
     EDShare.initialize(os.path.join(tempfile.gettempdir(), "edna-%s" % os.environ["USER"]))
     EDAssert.equal(True, "test1" in EDShare, "list is still present")
     for i, j in zip(range(10), EDShare["test1"]):
         EDAssert.equal(i, j, "elements are still the same")
     filename = EDShare.filename
     EDShare.close(remove=True)
     EDAssert.equal(False, os.path.isfile(filename), "dump-file has been removed")
Beispiel #2
0
 def unitTestInitialState(self):
     """
     Check the initialization of the share:
     """
     EDAssert.equal(False, EDShare.isInitialized(),
                    "Check that EDShare is uninitialized")
     strEdnaUserTempFolder = EDUtilsPath.getEdnaUserTempFolder()
     EDShare.initialize(strEdnaUserTempFolder)
     EDShare["test1"] = range(10)
     EDVerbose.screen("Backend used is %s" % EDShare.backend)
     EDAssert.equal(1, len(EDShare.items()))
     EDAssert.equal(True, "test1" in EDShare, "list is actually present")
     for i, j in zip(range(10), EDShare["test1"]):
         EDAssert.equal(i, j, "elements are the same")
     EDShare.close()
     EDShare.initialize(strEdnaUserTempFolder)
     EDAssert.equal(True, "test1" in EDShare, "list is still present")
     for i, j in zip(range(10), EDShare["test1"]):
         EDAssert.equal(i, j, "elements are still the same")
     filename = EDShare.filename
     EDShare.close(remove=True)
     EDAssert.equal(False, os.path.isfile(filename),
                    "dump-file has been removed")
Beispiel #3
0
 def cleanUp(cls):
     """
     Clean up of the dictionary containing images: Left for compatibility reasons
     """
     EDShare.flush()
Beispiel #4
0
architecture = EDUtilsPlatform.architecture
fabioPath = os.path.join(os.environ["EDNA_HOME"], "libraries", "FabIO-0.0.7",
                         architecture)
imagingPath = os.path.join(os.environ["EDNA_HOME"], "libraries",
                           "20091115-PIL-1.1.7", architecture)
numpyPath = os.path.join(os.environ["EDNA_HOME"], "libraries",
                         "20090405-Numpy-1.3", architecture)

EDFactoryPluginStatic.preImport("Image", imagingPath)
numpy = EDFactoryPluginStatic.preImport("numpy", numpyPath)
fabio = EDFactoryPluginStatic.preImport("fabio", fabioPath)

if "USER" not in os.environ:
    os.environ["USER"] = "******"
destDir = os.path.join(tempfile.gettempdir(), "edna-%s" % os.environ["USER"])
EDShare.initialize(destDir)


class EDTestCasePluginExecuteExecMatrixInvertv2_0_path(EDTestCasePluginExecute
                                                       ):
    """
    Those are all execution tests for the EDNA Exec plugin MatrixInvertv2_0 (Using shared arrays via HDF5)
    """
    def __init__(self, _strTestName=None):
        """
        """
        EDTestCasePluginExecute.__init__(self, "EDPluginExecMatrixInvertv2_0")
        #        self.setConfigurationFile(os.path.join(self.getPluginTestsDataHome(),
        #                                               "XSConfiguration_MatrixInvert.xml"))
        self.setDataInputFile(os.path.join(self.getPluginTestsDataHome(), \
                                           "XSDataInputMatrixInvertv2_path.xml"))
Beispiel #5
0
from EDPluginControlFullFieldXASv1_0 import EDPluginControlFullFieldXASv1_0
from EDPluginHDF5StackImagesv10 import EDPluginHDF5StackImagesv10
from XSDataFullFieldXAS import MeasureOffset, XSDataInputAlignStack, XSDataInputFullFieldXAS
from XSDataCommon import (
    XSDataTime,
    XSDataFile,
    XSDataImageExt,
    XSDataString,
    XSDataInteger,
    XSDataBoolean,
    XSDataDouble,
)


if socket.gethostname() == "lintaillefer":
    EDShare.initialize("/mnt/data/EDShare")
if socket.gethostname() == "tabor":
    EDShare.initialize("/mnt/EDShare")
else:
    try:
        dirnames = [i for i in os.listdir("/buffer") if i.startswith(socket.gethostname())]
    except OSError:
        dirnames = []
    if dirnames != []:
        EDShare.initialize(os.path.join("/buffer", dirnames[0]))


EDNAPluginName = "EDPluginControlFullFieldXASv1_0"


class FullFieldXas(object):
 def cleanUp(cls):
     """
     Clean up of the dictionary containing images: Left for compatibility reasons
     """
     EDShare.flush()
Beispiel #7
0
h5pyPath = os.path.join(os.environ["EDNA_HOME"], "libraries", "H5Py-1.3.0", EDUtilsPlatform.architecture)
h5py = EDFactoryPluginStatic.preImport("h5py", h5pyPath, _strMethodVersion="version.api_version", _strForceVersion="1.8")
from EDShare                import EDShare
EDFactoryPluginStatic.loadModule('EDPluginHDF5StackImagesv10')
EDFactoryPluginStatic.loadModule('EDPluginControlAlignStackv1_0')
EDFactoryPluginStatic.loadModule("EDPluginAccumulatorv1_0")
from EDPluginAccumulatorv1_0            import EDPluginAccumulatorv1_0
from EDPluginControlAlignStackv1_0      import EDPluginControlAlignStackv1_0
from EDPluginControlFullFieldXASv1_0    import EDPluginControlFullFieldXASv1_0
from EDPluginHDF5StackImagesv10         import EDPluginHDF5StackImagesv10
from XSDataFullFieldXAS                 import MeasureOffset, XSDataInputAlignStack, XSDataInputFullFieldXAS
from XSDataCommon                       import XSDataTime, XSDataFile, XSDataImageExt, XSDataString, XSDataInteger, XSDataBoolean, XSDataDouble


if socket.gethostname() == 'lintaillefer':
    EDShare.initialize("/mnt/data/EDShare")
if socket.gethostname() == 'tabor':
    EDShare.initialize("/mnt/EDShare")
else:
    try:
        dirnames = [i for i in os.listdir("/buffer") if i.startswith(socket.gethostname())]
    except OSError:
        dirnames = []
    if dirnames != []:
         EDShare.initialize(os.path.join("/buffer", dirnames[0]))



EDNAPluginName = "EDPluginControlFullFieldXASv1_0"
class FullFieldXas(object):
    """
EDFactoryPluginStatic.loadModule("EDInstallPILv1_1_7")
EDFactoryPluginStatic.loadModule("EDInstallFabio_v0_0_7")

architecture = EDUtilsPlatform.architecture
fabioPath = os.path.join(os.environ["EDNA_HOME"], "libraries", "FabIO-0.0.7", architecture)
imagingPath = os.path.join(os.environ["EDNA_HOME"], "libraries", "20091115-PIL-1.1.7", architecture)
numpyPath = os.path.join(os.environ["EDNA_HOME"], "libraries", "20090405-Numpy-1.3", architecture)

EDFactoryPluginStatic.preImport("Image", imagingPath)
numpy = EDFactoryPluginStatic.preImport("numpy", numpyPath)
fabio = EDFactoryPluginStatic.preImport("fabio", fabioPath)

if "USER" not in os.environ:
    os.environ["USER"] = "******"
destDir = os.path.join(tempfile.gettempdir(), "edna-%s" % os.environ["USER"])
EDShare.initialize(destDir)


class EDTestCasePluginExecuteExecMatrixInvertv2_0_path(EDTestCasePluginExecute):
    """
    Those are all execution tests for the EDNA Exec plugin MatrixInvertv2_0 (Using shared arrays via HDF5)
    """

    def __init__(self, _strTestName=None):
        """
        """
        EDTestCasePluginExecute.__init__(self, "EDPluginExecMatrixInvertv2_0")
        #        self.setConfigurationFile(os.path.join(self.getPluginTestsDataHome(),
        #                                               "XSConfiguration_MatrixInvert.xml"))
        self.setDataInputFile(os.path.join(self.getPluginTestsDataHome(), "XSDataInputMatrixInvertv2_path.xml"))
        self.setReferenceDataOutputFile(