Skip to content
Snippets Groups Projects
Commit 7685e749 authored by YingXing's avatar YingXing
Browse files

update readme

parent b91ff4bd
No related branches found
No related tags found
1 merge request!1Add pre-commit and .gitignore
*.pyc
*.un~
/build/
/deps/deps.jl
/deps/build.log
/deps/JUPYTER
/deps/julia-*
*.jl.*.cov
.ipynb_checkpoints
*.gif
Manifest.toml
Project.toml
repos:
- repo: https://github.com/nbQA-dev/nbQA
rev: "1.7.0"
hooks:
- id: nbqa-black
args: [--nbqa-skip-celltags=before-import]
- id: nbqa-pyupgrade
args: [--py39-plus]
- id: nbqa-isort
args: [--nbqa-skip-celltags=before-import, --profile=black]
- id: nbqa-check-ast
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: check-yaml
- id: check-json
- id: check-ast
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/kynan/nbstripout.git
rev: "0.6.1"
hooks:
- id: nbstripout
- repo: https://github.com/psf/black
rev: "23.9.1"
hooks:
- id: black
language_version: python3.9
args: ["-l", "100"]
- repo: https://github.com/asottile/pyupgrade
rev: "v3.1.0"
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/pycqa/isort
rev: "5.12.0"
hooks:
- id: isort
args: [--profile=black]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: python-no-eval
- id: python-use-type-annotations
- repo: https://github.com/srstevenson/nb-clean
rev: "3.0.1"
hooks:
- id: nb-clean
%% Cell type:markdown id:16b28ead tags:
# Installation and Setup
%% Cell type:markdown id:8829affd tags:
## Software and material
What you need for the workshop (quick overview):
- [Julia](https://julialang.org/downloads/)
- [Jupyter](https://jupyter.org/) and [IJulia.jl](https://github.com/JuliaLang/IJulia.jl)
- This repository of workshop materials
- All required dependencies (Julia packages) for the workshop
### Getting Julia
For following the course you will need at least Julia 1.6, but for full compatibility **Julia 1.8** is recommended.
Julia can be easily obtained in binary form from [Julia downloads](https://julialang.org/downloads/).
### Getting all the rest
The easiest way to get the remaining files and dependencies
is to [download the install.jl script](https://gitlab.mathematik.uni-stuttgart.de/stammbn/julia-seminar/-/blob/main/install.jl?ref_type=heads) and run it from julia. See the instructions [on the github repository](https://gitlab.mathematik.uni-stuttgart.de/stammbn/julia-seminar/).
As an alternative you can also also run the following commands manually
(this requires to have `git` and `julia` available from the commandline):
```
git clone https://gitlab.mathematik.uni-stuttgart.de/stammbn/Julia-seminar/
cd Julia-seminar
julia install-manual.jl
```
### Troubleshooting
If you are facing issues, check out
the [great troubleshooting section](https://carstenbauer.github.io/WorkshopWizard.jl/dev/troubleshooting/)
from the WorkshopWizard package by Carsten Bauer (which is being used by `install.jl`).
%% Cell type:markdown id:d3d75953 tags:
## Verifying everything works
A few quick commands to run:
%% Cell type:code id:7bb04662 tags:
``` julia
using Plots
p = plot(1, xlim=(0, 3π), ylim=(-1.5, 1.5), title="Sine", marker=2)
N = 100
@gif for i=1:N
x = (i-1) * 3π / N
push!(p, x, sin(x))
end
```
%% Cell type:code id:1f9376ca-21b5-429f-99f3-5612979662bb tags:
``` julia
```
......
......@@ -46,3 +46,34 @@ from the WorkshopWizard package by Carsten Bauer (which `install.jl` is using).
There is a section in the [00_Installation](00_Installation.ipynb) notebook
with a few quick commands to check everything works as expected.
Please run these **before the course**.
### For Developers: Setting Up `pre-commit`
[`pre-commit`](https://pre-commit.com/) is a framework that helps to manage and maintain pre-commit hooks to ensure that your code adheres to a consistent style, prevents errors, and adheres to other quality assurance checks.
1. **Install `pre-commit`:**
To ensure smooth development, install `pre-commit` using pip by running the following command:
```bash
pip install pre-commit
```
For more information and installation options, visit the [`pre-commit`](https://pre-commit.com/) website.
2. **Navigate to the Project Directory:**
Change into the project directory, i.e., `julia-seminar` by running:
```bash
cd julia-seminar
```
3. **Install Hooks:**
Install the git hooks by executing:
```bash
pre-commit install
```
This command installs the pre-commit script alongside existing git hooks.
Once the pre-commit hook is installed, it will automatically check your code for any issues before each commit. If the checks do not pass, you will be prompted to fix them before proceeding.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment