BML_0: BAR_LA_MARE#

Bio Acoustic Research to Learn About the MARine Environment

Preparation: Python Jupyter Lab#

Following worked for windows 11

Installation (e.g. from https://docs.conda.io/en/latest/miniconda.html)

  • miniconda

Link gives also instructions for other OS (Mac, Linux)

Launch minconda terminal and check conda

  • conda --help

create and change to working directory (Windows 11)

  • (e.g. mkdir $home/documents/blm followed by cd $home/documents/blm)

or if $home is nod defined (e.g. Windows 10)

  • mkdir documents/blm followed by cd documents/blm

Creation of environment

  • conda create -n blm python=3

Activate conda environment

  • conda activate blm

Download basic python moduls

  • conda install jupyterLab

  • conda install numpy

  • conda install matplotlib

Start jupyterLab In miniconda terminal:

  • jupyter lab

Web browser opens in working directory

Open new notebook: New -> Python 3

A new notebook will open “untitled.ipynb” ready to work with.

First steps in python#

# simple mathematic
a = 3*3
b = 3*4
c = 3**2
d1 = a==b
d2 = a==c
#
print(a)
print(b)
print(c)
print(d1)
print(d2)
#
print(a,b,c,d1,d2)
9
12
9
False
True
9 12 9 False True

Additional commands#

As of 2022 Windows 11 uses Windows Terminal and CMD does not work.

To ensure Windows Terminal in VSCode

open Preferences > Settings (CTRL+,)

  • search for terminal.integrated.defaultProfile.windows and

  • set a Windows Powershell

Useful commands to publish#

to generate notebook on github-io

Installation

  • conda install -c conda-forge jupyter-book

  • jb build ./ -v --all

  • cp -Path "_build/html/*" -Destination "../wmxz-eu.github.io" -recurse -Force

and using github to publish the files