Menu

#2460 Python plugin for Autoplot is broken

nextrelease
open
nobody
None
5
2023-12-04
2022-06-10
No

A some point the plug-in for Autoplot for Python broke. It would work with a call to the magic function "addjavapath", which was borrowed from the Matlab support. This would return the jpype object for the class "org", so you could say

org= javaaddpath()
sc= org.autoplot.ScriptContext
xxs= sc.getCompletions( s )

This no longer works, with Python 3.8.10, and probably many earlier versions.

New documentation should be written which shows how it is used properly, and using more conventional Python code and JPype use. Last, a Jenkins test should be used to verify its use with "python" on the command line, whatever version Linux/Mint is using.

Discussion

  • Jeremy Faden

    Jeremy Faden - 2022-06-10
    from autoplot import javaaddpath
    import jpype
    javaaddpath()  # download Autoplot jar and start Java with the jar
    sc= jpype.JClass('org.autoplot.ScriptContext')
    xxs= sc.getCompletions( 'http://autoplot.org/data/autoplot.cdf?' )
    for xx in xxs: print(xx) 
    # prints http://autoplot.org/data/autoplot.cdf?Magnitude
    # prints http://autoplot.org/data/autoplot.cdf?BGSEc
    # ...
    
     

    Last edit: Jeremy Faden 2022-06-10
  • Jeremy Faden

    Jeremy Faden - 2022-06-10

    To create an Autoplot GUI from Python:

    from autoplot import javaaddpath
    import jpype
    javaaddpath()  # download Autoplot jar and start Java with the jar
    sc= jpype.JClass('org.autoplot.ScriptContext')
    sc.createGui()
    
     
  • Jeremy Faden

    Jeremy Faden - 2022-06-10

    The Python code autoplot.py has methods which no longer work, like to_qdataset. This needs to be reviewed and corrected.

     
  • Jeremy Faden

    Jeremy Faden - 2022-06-10

    See also https://pypi.org/project/autoplot/, which will need updating as well.

     
  • Jeremy Faden

    Jeremy Faden - 2022-06-19

    The python3 on my Mac M1 is a "Mach-O universal binary with 2 architectures" (enter "file which python3" at the shell), and doesn't load the Java library ( Mach-O 64-bit executable x86_64) properly. Pointing to an arm-based Java doesn't seem to help.

     

    Last edit: Jeremy Faden 2022-06-19
MongoDB Logo MongoDB