All Projects → JuliaPhysics → PhysicsTutorials.jl

JuliaPhysics / PhysicsTutorials.jl

Licence: MIT license
A collection of physics tutorials for the Julia programming language

Programming Languages

Jupyter Notebook
11667 projects
HTML
75241 projects

PhysicsTutorials.jl

This package holds tutorials showing how to utilize Julia and its ecosystem for physics applications. Tutorials are available as PDFs, HTML webpages, and interactive Jupyter notebooks. The folder structure is tutorials/<category>/<tutorial name>/. Each tutorial folder is a Julia project, which can be ] activated and ] instantiated. For more information, please consult the JuliaPhysics webpage, which also lists a bunch of external tutorials.

Table of Contents

Interactive Jupyter Notebooks

To run the tutorials interactively in Jupyter notebooks, install the package and IJulia via

] add http://github.com/JuliaPhysics/PhysicsTutorials IJulia

and start/open the notebook server like

using PhysicsTutorials, IJulia
PhysicsTutorials.open_notebooks()

Contributing

Supported source files for tutorials are Jupyter notebooks, Weave.jl files, or Literate.jl files. To contribute a tutorial, clone the repository and put the source file into tutorials/<category>/<tutorial_name>/ and name it <tutorial_name>.ipynb (extension .jmd/.jl for Weave/Literate sources). To trigger the generation process of all output formats, run the following code from within the repository root folder:

  1. Make sure you have Fire installed, if not, install it with ] add Fire,
  2. Create the source file tutorials/<category>/<tutorial_name>/<tutorial_name>.<extension>, where the extension should be either .ipynb, .jl, or .jmd.
  3. Type julia convert.jl tutorials/<category>/<tutorial_name>/<tutorial_name>.<extension> in a terminal.

Alternative approach: trigger conversion manually

using Pkg; Pkg.activate(".")
using PhysicsTutorials
PhysicsTutorials.convert_tutorial("<category>","<tutorial_name>", PhysicsTutorials.NotebookSource())

For Weave or Literate sources, replace PhysicsTutorials.NotebookSource() by PhysicsTutorials.WeaveSource() or PhysicsTutorials.LiterateSource(), respectively.

Title and Author Formatting

To have the title and author information of a tutorial formatted nicely, we special case the first two (non-empty) lines when parsing source files.

  • The first line should indicate the title information as a level 1 header, indicated by #.
  • The second line should specify the author information as a level 3 heading, i.e. ###.

Hence, for notebook and Weave input files (example) you want the first two lines to be

# My Awesome Tutorial
### John Doe

and for Literate input (see this example)

# # My Awesome Tutorial
# ### John Doe
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].