mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
- code brought over from the following raytheon repos and directories: - awips2 repo: - awips2/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.alertviz/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.mpe/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.dataplugin.text/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.dataplugin.grid/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.activetable/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.management/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.dataplugin.radar/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.site/pythonPackages - awips2-core repo: - awips2-core/common/com.raytheon.uf.common.auth/pythonPackages - awips2-core/common/com.raytheon.uf.common.message/pythonPackages - awips2-core/common/com.raytheon.uf.common.localization/pythonPackages - awips2-core/common/com.raytheon.uf.common.datastorage/pythonPackages - awips2-core/common/com.raytheon.uf.common.pointdata/pythonPackages - awips2-core/common/com.raythoen.uf.common.pypies/pythonPackages - awips2-core/common/com.raytheon.uf.common.dataaccess/pythonPackages - awips2-core/common/com.raytheon.uf.common.dataplugin.level/pythonPackages - awips2-core/common/com.raytheon.uf.common.serialization/pythonPackages - awips2-core/common/com.raytheon.uf.common.time/pythonPackages - awips2-core/common/com.raytheon.uf.common.dataplugin/pythonPackages - awips2-core/common/com.raytheon.uf.common.dataquery/pythonPackages - awips2-rpm repo: had to untar and unzip the thirft repo, then go into /lib/py and run `python setup.py build` and then copy in from the build/ subdirectory -foss/thrift-0.14.1/packaged/thrift-0.14.1/lib/py/build/lib.macosx-10.9-x86_64-cpython-38/thrift
42 lines
No EOL
1.1 KiB
Python
42 lines
No EOL
1.1 KiB
Python
|
|
import pypies
|
|
from timeit import Timer
|
|
ntrials = 10
|
|
|
|
def readObject():
|
|
f = open('/tmp/javaOut')
|
|
data = f.read()
|
|
f.close()
|
|
return data
|
|
|
|
def deserialize(data):
|
|
dsm = pypies.DynamicSerializationManager.DynamicSerializationManager()
|
|
obj = dsm.deserializeBytes(data)
|
|
return obj
|
|
|
|
def main():
|
|
timer = Timer("deserialize(data)", "from __main__ import deserialize, readObject; data = readObject()")
|
|
print("deserializing took", sum(timer.repeat(ntrials,1))/ntrials,'seconds')
|
|
obj = readObject()
|
|
b = deserialize(obj)
|
|
printout(b)
|
|
|
|
def printout(obj):
|
|
print("result", obj)
|
|
print("groupName", obj.getGroupName())
|
|
print("size", obj.getSize())
|
|
print("otherName", obj.getOtherName())
|
|
print("nullTest", obj.getNullTest())
|
|
print("getValue", obj.getValue())
|
|
print("good", obj.getGood())
|
|
print("floatValue", obj.getFloatValue())
|
|
print("floatArray", obj.getFloatArray())
|
|
print("intArray", obj.getIntArray())
|
|
print("testMap", obj.getTestMap())
|
|
print("testSet", obj.getTestSet())
|
|
print("someEnum", obj.getSomeEnum())
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main() |