ease-ily make the most of eclipse with python · ease-ily make the most of eclipse with python...
TRANSCRIPT
![Page 1: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/1.jpg)
EASE-ily Make the Most of Eclipse with Python
EclipseCon France Workshop
7th June 2016
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 2: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/2.jpg)
Agenda
Introduction
Scripting Eclipse with Python
Break
Writing EASE modules
Conclusion & Resources
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 3: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/3.jpg)
Who We Are
Tracy Miranda Eclipse evangelist, Science steering committee
member
Jonah Graham January project lead, CDT committer
Christian Pontesegger EASE project lead, Code & Me blogger
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 4: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/4.jpg)
SCRIPTING ECLIPSE WITH PYTHON
EASE-ily Making the Most of Eclipse with Python
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 5: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/5.jpg)
AGENDA
Hello World
Python & EASE Background
Getting started
EASE Modules
Executing EASE Scripts
Magic Keyword Headers
Python & EASE: The Vision & The Roadmap
Hands-on-Scripting
Automate, Extend, Integrate & Share with EASE
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 6: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/6.jpg)
HELLO WORLD
EASE-ily Making the Most of Eclipse with Python
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 7: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/7.jpg)
Setup for Exercises
Setup Instructions :
Open up EASE.htm in Eclipse or in a browser
https://github.com/jonahkichwacoders/EASE-Python-Examples
Virtual conversation: https://mattermost-test.eclipse.org/eclipse/channels/ease
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 8: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/8.jpg)
Disclaimer
We will be writing and running powerful scripts that manipulate files, projects and settings in your workspace.
While we have done our best to ensure the scripts are safe for general consumption, please ensure there is nothing too precious in your workspace!
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 9: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/9.jpg)
Hello World!
1. Launch Eclipse & switch to Scripting Perspective
2. Ensure you have a ‘Py4J Script Shell’ open
3. Open file EASE.htm and follow the instructions for
‘Hello World’ section
4. When you finish, paste in your Python version
(sys.version) to Mattermost!
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 10: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/10.jpg)
EASE & PYTHON BACKGROUND
EASE-ily Making the Most of Eclipse with Python
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 11: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/11.jpg)
EASE Scripting Framework
Allows for easy extension and control of Eclipse IDE using your favourite scripting language.
https://github.com/jonahkichwacoders/EASE-Python-Examples
Eclipse Advanced Scripting Environment
Python (Py4J)
Jython Javascript
(Rhino, Nashorn)
Groovy Native
Java
[Your Interpreter
Here]
![Page 12: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/12.jpg)
Python & EASE: A brief history
EclipseCon France, June 2015:
“Integrating Python and Java in Eclipse”
EclipseCon Europe, October 2015:
“I Love Scripting”
EclipseCon France, June 2016:
“EASE-ily Making the Most of Eclipse with
Python”
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 13: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/13.jpg)
Why Python?
• Great beginner language
• Heavily used for Science
• Heavily used for Embedded e.g. GDB
• Lots and lots of fast, powerful libraries e.g. numpy
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 14: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/14.jpg)
Enabling Technology: Py4J
“A Bridge between Java and Python”
Allows Python to access JAVA classes and vice versa
Open source, BSD licence
Used by Apache Spark for PySpark
Developed by Barthelemy Dagenais
New ‘Pinned-thread’ threading model to work with
Eclipse/SWT
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 15: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/15.jpg)
Eclipse Advanced Scripting Module
Eclipse Project in Incubation
Modular approach
Good Eclipse integration e.g. Keywords,
script explorer, etc
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 16: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/16.jpg)
GETTING STARTED
EASE-ily Making the Most of Eclipse with Python
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 17: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/17.jpg)
EASE MODULES
• Logical groupings of functionality
• Provide easy access to Eclipse and Java APIs
https://github.com/jonahkichwacoders/EASE-Python-Examples
UI Resources Platform
Launch Charting Modeling
![Page 18: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/18.jpg)
Modules Exercises
Exercise 2.1 UI Module
Hint: showInputDialog, showInfoDialog
Exercise 2.2 Resources Module
Hint: createProject, getProject
Hint: IProject.addFile, createFile, refreshResource
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 19: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/19.jpg)
PYTHON & EASE: VISION AND ROADMAP
EASE-ily Making the Most of Eclipse with Python
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 20: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/20.jpg)
Extending Eclipse (Traditional)
https://github.com/jonahkichwacoders/EASE-Python-Examples
Java only plug-in
Code Separate Eclipse
instance Test
Build & deploy plug-in
Build
Install plug-in &
restart Eclipse
Install Success
![Page 21: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/21.jpg)
Extending Eclipse with EASE
https://github.com/jonahkichwacoders/EASE-Python-Examples
Python Script (or choice of language)
Code
Point EASE at script in
running Eclipse
instance
Deploy Success
![Page 22: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/22.jpg)
Extending Eclipse with EASE
https://github.com/jonahkichwacoders/EASE-Python-Examples
Python Script (or choice of language)
Code
Point EASE at script in
running Eclipse
instance
Deploy Success
Open up Eclipse extensibility to a
whole new world of developers!
![Page 23: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/23.jpg)
Python Scripting with EASE
Be more productive
Extend Eclipse quickly
Integrate Python libraries
Share scripts with others
easily
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 24: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/24.jpg)
Python Scripting RoadMap
https://github.com/jonahkichwacoders/EASE-Python-Examples
• Py4J Interpreter Integration
• Critical bug fixes
• Release Engineering
Short Term (Funded)
• Pythonic Behaviour (Usability)
• PyDev Integration
• AnalysisRPC
• CDT Integration
Near Term
• Remote Support
• Debugging Support
• IPython Notebook
• Recording
Future
![Page 25: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/25.jpg)
Pythonic Behaviour (Usability)
Namespace pollution
Running scripts with Python directly
More Python-friendly API
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 26: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/26.jpg)
PyDev Integration
Autocompletion in console
Autocompletion in editor
Integration of PyDev Console
IPython terminal support
Shared/Automatic Interpreter Configuration
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 27: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/27.jpg)
AnalysisRPC
https://github.com/jonahkichwacoders/EASE-Python-Examples
Custom solution to move data around
Enhanced Remote Procedure Call –Datasets (ndarrays)
–Regions Of Interest (ROIs)
–Exceptions
Language Independent Server and client written for Java and Python
Integration with Science WG Projects (Visualisation, Workflows and Data Structures)
![Page 28: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/28.jpg)
Python
x = numpy.ndarray(...) y = numpy.ndarray(...) rpcclient.Plotter.line( x, y)
FLATTEN
Java import org.eclipse.dawnsci.IDataset class Plotter { public void line( IDataset x, IDataset y) { // ...} }
UNFLATTEN
Transport (XML-RPC + Disk/Memory)
Datasets: /tmp/x /tmp/y
Meta and simple data: Target Plotter Method line x /tmp/x y /tmp/y
![Page 29: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/29.jpg)
Java interface IFilter { IDataset filter(IDataset data); } //create client for PyFilter client.newProxyInstance(IFilter.class) IDataset result = proxy.filter(data)
FLATTEN
Python class PyFilter: def filter(data): # manipulate ndarray data return data # create server server.add_handler(PyFilter())
UNFLATTEN
Transport (XML-RPC + Disk/Memory)
Datasets: /tmp/data
Meta and simple data: Target PyFilter Method filter data /tmp/data
![Page 30: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/30.jpg)
CDT Integration
Visual Studio Macro-like support
Debug Module
C Editor Support Module
GDB Python Interface Integration
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 31: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/31.jpg)
EXERCISES
EASE-ily Making the Most of Eclipse with Python
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 32: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/32.jpg)
Python Scripting with EASE
Be more productive
Extend Eclipse quickly
Integrate Python libraries
Share scripts with others
easily
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 33: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/33.jpg)
WRITING EASE MODULES
EASE-ily Making the Most of Eclipse with Python
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 34: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/34.jpg)
CONCLUSION
EASE-ily Making the Most of Eclipse with Python
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 35: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/35.jpg)
EASE-ily Make The Most of Eclipse
AUTOMATE EXTEND
INTEGRATE SHARE
https://github.com/jonahkichwacoders/EASE-Python-Examples
![Page 36: EASE-ily Make the Most of Eclipse with Python · EASE-ily Make the Most of Eclipse with Python EclipseCon France Workshop 7th June 2016 ... Jython Javascript (Rhino, Nashorn) Groovy](https://reader034.vdocuments.mx/reader034/viewer/2022042104/5e81b34adfa55a511d47b09f/html5/thumbnails/36.jpg)
Thank you & Questions
Tracy Miranda [email protected] @tracymiranda
Jonah Graham [email protected]
Christian Pontesegger [email protected]
https://github.com/jonahkichwacoders/EASE-Python-Examples