Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for running on mybinder.org #13

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# .coveragerc
[report]
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
service_name: travis-pro
repo_token: ttD3hbDhhobM5EWM7diDHphNLaRLuPQRY
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: python

sudo: required
before_install:
- sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran

python:
- 3.8

install:
- pip install --quiet coveralls
- pip install --quiet nose
- pip install --quiet coverage
- pip install --quiet jupyter_client
- pip install --quiet ipykernel
- pip install --quiet IPython
- python setup.py install

script:
- nosetests
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# GDL kernel for Jupyter

Demo [Notebook](demo.ipynb)
[![Build Status](https://app.travis-ci.com/equib/gdl_kernel.svg?branch=master)](https://app.travis-ci.com/github/equib/gdl_kernel)
[![Build Status](https://ci.appveyor.com/api/projects/status/w65lp35d6wlas36x?svg=true)](https://ci.appveyor.com/project/danehkar/gdl-kernel)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/equib/gdl_kernel/HEAD?labpath=demo_gdl.ipynb)

Demo: [Notebook](demo_gdl.ipynb) on [Binder](https://mybinder.org/v2/gh/equib/gdl_kernel/HEAD?labpath=demo_gdl.ipynb).

This repository also makes use of [GDL](https://github.com/gnudatalanguage/gdl) to run IDL/GDL codes in Jupyter lab. This requires the following component:

* `apt.txt` for apt-installing the gnudatalanguage (gdl) component.

The current version was found to work with pexpect 4.6, jupyter 4.4, and jupyter-notebook 5.7.

Expand Down
26 changes: 26 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
environment:
matrix:
- PYTHON: "C:\\Python38"
PYTHON_VERSION: "3.8"
PYTHON_ARCH: "64"

matrix:
fast_finish: true

init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"

platform:
- x64

install:
- "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- python -m pip install --upgrade pip
- pip install jupyter_client ipykernel IPython nose
- pip install coverage

build_script:
- python setup.py install"

test_script:
- nosetests
1 change: 1 addition & 0 deletions apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gnudatalanguage
1 change: 1 addition & 0 deletions demo_gdl.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions demo_gdl_fbp.ipynb

Large diffs are not rendered by default.

37 changes: 25 additions & 12 deletions gdl_kernel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ipykernel.kernelbase import Kernel
from IPython.utils.path import locate_profile
from IPython.paths import locate_profile
from IPython.core.displaypub import publish_display_data
from pexpect import replwrap,EOF,spawn

Expand Down Expand Up @@ -66,7 +66,8 @@ def _start_gdl(self):
sig = signal.signal(signal.SIGINT, signal.SIG_DFL)
try:
self._executable = find_executable("gdl")
self._child = spawn(self._executable+' --use-wx ',timeout = 300, encoding='utf-8')
#self._child = spawn(self._executable+' --use-wx ',timeout = 300, encoding='utf-8')
self._child = spawn(self._executable,timeout = 300, encoding='utf-8')
self.gdlwrapper = replwrap.REPLWrapper(self._child,u"GDL> ",None)
finally:
signal.signal(signal.SIGINT, sig)
Expand Down Expand Up @@ -108,16 +109,28 @@ def do_execute(self, code, silent, store_history=True, user_expressions=None,
plot_format = 'png'

postcall = """
device,window_state=winds_arefgij
if !inline and total(winds_arefgij) ne 0 then begin
w_CcjqL6MA = where(winds_arefgij ne 0,nw_CcjqL6MA)
for i_KEv8eW6E=0,nw_CcjqL6MA-1 do begin
wset, w_CcjqL6MA[i_KEv8eW6E]
outfile_c5BXq4dV = '%(plot_dir)s/__fig'+strtrim(i_KEv8eW6E,2)+'.png'
ii_rsApk4JS = snapshot(outfile_c5BXq4dV)
wdelete
endfor
endif
if !D.NAME eq 'X' then begin
device,window_state=winds_arefgij
if !inline and total(winds_arefgij) ne 0 then begin
w_CcjqL6MA = where(winds_arefgij ne 0,nw_CcjqL6MA)
for i_KEv8eW6E=0,nw_CcjqL6MA-1 do begin
wset, w_CcjqL6MA[i_KEv8eW6E]
outfile_c5BXq4dV = '%(plot_dir)s/__fig'+strtrim(i_KEv8eW6E,2)+'.png'
ii_rsApk4JS = snapshot(outfile_c5BXq4dV)
wdelete
endfor
endif
endif else begin
if !D.NAME eq 'Z' then begin
device
if !inline and (total(tvrd()) ne 0.0) then begin
i_KEv8eW6E=0
outfile_c5BXq4dV = '%(plot_dir)s/__fig'+strtrim(i_KEv8eW6E,2)+'.png'
ii_rsApk4JS = snapshot(outfile_c5BXq4dV)
erase
endif
endif
endelse
end
""" % locals()

Expand Down
238 changes: 0 additions & 238 deletions notebooks/demo_gdl.ipynb

This file was deleted.

Loading