You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.py 1.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #export LD_LIBRARY_PATH=.:/export/home/lambertn/Documents/Cython_GedLib_2/lib/fann/:/export/home/lambertn/Documents/Cython_GedLib_2/lib/libsvm.3.22:/export/home/lambertn/Documents/Cython_GedLib_2/lib/nomad
  2. #Pour que "import script" trouve les librairies qu'a besoin GedLib
  3. #Equivalent à définir la variable d'environnement LD_LIBRARY_PATH sur un bash
  4. #Permet de fonctionner sur Idle et autre sans définir à chaque fois la variable d'environnement
  5. #os.environ ne fonctionne pas dans ce cas
  6. import librariesImport, script
  7. #import script
  8. #truc = script.computeEditDistanceOnGXlGraphs('include/gedlib-master/data/datasets/Mutagenicity/data/','collections/MUTA_10.xml',"CHEM_1", "BIPARTITE", "")
  9. #print(truc)
  10. #script.PyRestartEnv()
  11. #script.appel()
  12. def test() :
  13. # script.appel()
  14. script.PyRestartEnv()
  15. print("Here is the Python function !")
  16. print("List of Edit Cost Options : ")
  17. for i in script.listOfEditCostOptions :
  18. print (i)
  19. print("")
  20. print("List of Method Options : ")
  21. for j in script.listOfMethodOptions :
  22. print (j)
  23. print("")
  24. script.PyLoadGXLGraph('include/gedlib-master/data/datasets/Mutagenicity/data/', 'collections/MUTA_10.xml')
  25. listID = script.PyGetGraphIds()
  26. afficheId = ""
  27. for i in listID :
  28. afficheId+=str(i) + " "
  29. print("Number of graphs = " + str(len(listID)) + ", list of Ids = " + afficheId)
  30. script.PySetEditCost("CHEM_1")
  31. script.PyInitEnv()
  32. script.PySetMethod("BIPARTITE", "")
  33. script.PyInitMethod()
  34. g = listID[0]
  35. h = listID[1]
  36. script.PyRunMethod(g,h)
  37. liste = script.PyGetAllMap(g,h)
  38. print("Forward map : " ,liste[0], ", Backward map : ", liste[1])
  39. print ("Upper Bound = " + str(script.PyGetUpperBound(g,h)) + ", Lower Bound = " + str(script.PyGetLowerBound(g,h)) + ", Runtime = " + str(script.PyGetRuntime(g,h)))
  40. test()

A Python package for graph kernels, graph edit distances and graph pre-image problem.