Skip to content

plasmabio/template-octave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template materials in Octave

Example repository to create an environment with course materials in Octave.

The Octave kernel is provided by Calysto.

Try it on Binder

Binder

Check Octave is properly installed

In JupyterLab, open a terminal and type :

octave --version

You should have an output similar to:

$ octave --version
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features
GNU Octave, version 7.1.0
Copyright (C) 1993-2022 The Octave Project Developers.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.

Octave was configured for "x86_64-conda-linux-gnu".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.

Warnings:

octave: X11 DISPLAY environment variable not set
octave: disabling GUI features

do not prevent graphics to be dislayed in Jupyter notebook.

Also do check octave kernel is available:

$ jupyter kernelspec list
Available kernels:
  octave     /srv/conda/envs/notebook/share/jupyter/kernels/octave
  python3    /srv/conda/envs/notebook/share/jupyter/kernels/python3

Install Octave packages

With Octave running, either from a console or a notebook, install needed packages:

pkg install -local -forge io statistics struct optim

This will take a couple of minutes, be patient. Warning message will also be printed.

Then list available packages:

pkg list

And test the optim package:

pkg test optim

Structure of the repo

This repository is based on the binder-examples/conda example.

repo2docker is the underlying tool that is used to build an environment from a repository.

repo2docker can be configured with several types of files. In the case of this repo:

  • binder/environment.yml: specify dependencies that will be installed using conda
  • binder/apt.txt: specify regular Ubuntu packages that will be installed using apt

Once created, the environment can be reused without building it again.

For more information, see the extensive rep2docker documentation.

Materials

Materials can be added anywhere to this repository, either at the top level or in subdirectory.

When building the environment, the materials (and any other file) will be copied to the Docker image.

In this example, there is already a test notebook available under example-notebook-octave.ipynb.