odf / gavrog

Generation, analysis and visualization of reticular ornaments using Gavrog.
http://www.gavrog.org
Apache License 2.0
33 stars 5 forks source link

How to run Systre in command line? #6

Closed gooaah closed 5 years ago

gooaah commented 7 years ago

I want to find the topology of a set of quotient graphs(too many), and I think Systre in command line could be more effiecient. I find SystreCmdline.java in Systre fold, but how to use it?

odf commented 7 years ago

There are now two command line interfaces for Systre, one written in Java and one in Jython (a Python implementation for the Java Virtual Machine, see www.jython.org).

For the Java version, use

java -cp Systre-1.2.0-beta2.jar org.gavrog.apps.systre.SystreCmdline file.cgd

For the Jython version, use

CLASSPATH=Systre-1.2.0-beta2.jar jython jython/systreCmd.py file.cgd

Command line options for the Jython interface can be viewed by running it with the -h option.

I hope this helps.

gooaah commented 7 years ago

Thanks! The Jave version works, but for Jython version, systreCmd.py raises an error like this:

==================================================
!!! ERROR (INTERNAL) - __hash__() takes no arguments (0 given)
==================================================

Traceback (most recent call last):
  File "systreCmd.py", line 459, in processDataFile
    (processGraph if G.isConnected() else processDisconnectedGraph)(
  File "systreCmd.py", line 368, in processGraph
    nodeToName, mergedNames = nodeNameMapping(M)
  File "systreCmd.py", line 91, in nodeNameMapping
    if name != orbit2name.get(orbit, name):
TypeError: __hash__() takes no arguments (0 given)
odf commented 7 years ago

Thanks! I think this might be caused by an incompatibility between Java and Python data types. Could you let me know which versions of Java and Jython you were using?

gooaah commented 7 years ago

The error appears under both Win10 and Xubuntu( Ubuntu with Xfce). Java versions: Win10

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Xubuntu

java version "1.7.0_101"
OpenJDK Runtime Environment (IcedTea 2.6.6) (7u101-2.6.6-0ubuntu0.15.10.1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

The versions of Jython under both platforms are 2.7

And what is your Java development environment? Thanks!

odf commented 7 years ago

Thanks, that's helpful information. I had been using Jython 2.5.3, which is the version supported by Ubuntu 16.10. I've installed Jython 2.7 now and am getting the same error.

odf commented 7 years ago

Okay, I've added a conversion from a java.util.HashSet to a Python frozenset, and now the Jython script works for me in both versions 2.5.3 and 2.7.

gooaah commented 7 years ago

Great, it works!