def test_multiple_jpy_create_destroy_jvm(self): self.assertFalse(jpy.has_jvm()) jpy.create_jvm([]) self.assertTrue(jpy.has_jvm()) jpy.destroy_jvm() self.assertFalse(jpy.has_jvm()) jpy.create_jvm([]) self.assertTrue(jpy.has_jvm()) jpy.destroy_jvm() self.assertFalse(jpy.has_jvm())
Product = jpy.get_type('org.esa.snap.framework.datamodel.Product') ProductData = jpy.get_type('org.esa.snap.framework.datamodel.ProductData') RasterDataNode = jpy.get_type( 'org.esa.snap.framework.datamodel.RasterDataNode') AbstractBand = jpy.get_type( 'org.esa.snap.framework.datamodel.AbstractBand') Band = jpy.get_type('org.esa.snap.framework.datamodel.Band') VirtualBand = jpy.get_type('org.esa.snap.framework.datamodel.VirtualBand') GeoCoding = jpy.get_type('org.esa.snap.framework.datamodel.GeoCoding') GeoPos = jpy.get_type('org.esa.snap.framework.datamodel.GeoPos') PixelPos = jpy.get_type('org.esa.snap.framework.datamodel.PixelPos') FlagCoding = jpy.get_type('org.esa.snap.framework.datamodel.FlagCoding') ProductNodeGroup = jpy.get_type( 'org.esa.snap.framework.datamodel.ProductNodeGroup') ProductUtils = jpy.get_type('org.esa.snap.util.ProductUtils') GPF = jpy.get_type('org.esa.snap.framework.gpf.GPF') Operator = jpy.get_type('org.esa.snap.framework.gpf.Operator') Tile = jpy.get_type('org.esa.snap.framework.gpf.Tile') except Exception: jpy.destroy_jvm() raise # Note: use the following code to initialise SNAP's 3rd party libraries, JAI and GeoTools. # Only needed, if SNAP Python API is not called from Java (e.g. from SNAP gpt or SNAP desktop). if not called_from_java: SystemUtils.init3rdPartyLibs(None)
SystemUtils = jpy.get_type('org.esa.snap.util.SystemUtils') ProductIO = jpy.get_type('org.esa.snap.framework.dataio.ProductIO') Product = jpy.get_type('org.esa.snap.framework.datamodel.Product') ProductData = jpy.get_type('org.esa.snap.framework.datamodel.ProductData') RasterDataNode = jpy.get_type('org.esa.snap.framework.datamodel.RasterDataNode') AbstractBand = jpy.get_type('org.esa.snap.framework.datamodel.AbstractBand') Band = jpy.get_type('org.esa.snap.framework.datamodel.Band') VirtualBand = jpy.get_type('org.esa.snap.framework.datamodel.VirtualBand') GeoCoding = jpy.get_type('org.esa.snap.framework.datamodel.GeoCoding') GeoPos = jpy.get_type('org.esa.snap.framework.datamodel.GeoPos') PixelPos = jpy.get_type('org.esa.snap.framework.datamodel.PixelPos') FlagCoding = jpy.get_type('org.esa.snap.framework.datamodel.FlagCoding') ProductNodeGroup = jpy.get_type('org.esa.snap.framework.datamodel.ProductNodeGroup') ProductUtils = jpy.get_type('org.esa.snap.util.ProductUtils') GPF = jpy.get_type('org.esa.snap.framework.gpf.GPF') Operator = jpy.get_type('org.esa.snap.framework.gpf.Operator') Tile = jpy.get_type('org.esa.snap.framework.gpf.Tile') except Exception: jpy.destroy_jvm() raise # Note: use the following code to initialise SNAP's 3rd party libraries, JAI and GeoTools. # Only needed, if SNAP Python API is not called from Java (e.g. from SNAP gpt or SNAP desktop). if not called_from_java: SystemUtils.init3rdPartyLibs(None)
def tearDownClass(cls): jpy.destroy_jvm()