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 ] activate
d and ] instantiate
d. For more information, please consult the JuliaPhysics webpage, which also lists a bunch of external tutorials.
-
General
-
Machine Learning
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()
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:
- Make sure you have
Fire
installed, if not, install it with] add Fire
, - Create the source file
tutorials/<category>/<tutorial_name>/<tutorial_name>.<extension>
, where the extension should be either.ipynb
,.jl
, or.jmd
. - Type
julia convert.jl tutorials/<category>/<tutorial_name>/<tutorial_name>.<extension>
in a terminal.
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.
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