Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.9.3
hooks:
- id: ruff-format
exclude: ^content/week01/cleanup_bessel\.ipynb$
Expand All @@ -31,12 +31,12 @@ repos:
- id: nbstripout

- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.3.3"
rev: "v3.4.2"
hooks:
- id: prettier

- repo: https://github.com/codespell-project/codespell
rev: "v2.3.0"
rev: "v2.4.0"
hooks:
- id: codespell
args: ["-L", "hist,whet,classe,nd", "-w"]
Expand Down
2 changes: 1 addition & 1 deletion content/week03/tdd.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function should have and when to _stop_ coding.

## TDD

TDD is a fundamental apsect of agile software development where no code is
TDD is a fundamental aspect of agile software development where no code is
written without first having a test covering the feature. Development proceeds
through a cycle of red, green, refactor.

Expand Down
9 changes: 5 additions & 4 deletions content/week10/rust_example/rust.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Intro to Rust

This is an introduction to some of the unique design of Rust. This is not
comprehensive - the fantastic [Rust Book][] is much better if you want to fully learn
Rust. Instead, we'll look at how it's different from what we've seen so far in Python,
and discuss some of the aspects that make special, like how it is memory safe without
resorting to a garbage collector, the trait system, and syntactic macros.
comprehensive - the fantastic [Rust Book][] is much better if you want to fully
learn Rust. Instead, we'll look at how it's different from what we've seen so
far in Python, and discuss some of the aspects that make special, like how it is
memory safe without resorting to a garbage collector, the trait system, and
syntactic macros.

## Basic syntax

Expand Down
16 changes: 8 additions & 8 deletions content/week11/poisson_jacobi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ program poisson
end do
end do
ftot = 0. !ftot/dble(n*n)

! Main loop
ffac = h**2.
err = huge(err)
Expand All @@ -68,11 +68,11 @@ program poisson

do j = 1,n
do i = 1,n

lap = uold(i-1,j)+uold(i+1,j)+uold(i,j-1)+uold(i,j+1)-4.0*uold(i,j)
res = lap - ffac * (f(i,j) - ftot)
unew(i,j) = uold(i,j) + omega*0.25*res

err = MAX(err,abs(unew(i,j) - uold(i,j)))
end do
end do
Expand All @@ -84,13 +84,13 @@ program poisson
unew(0,i) = 0. !unew(n,i)
unew(n+1,i) = 0. !unew(1,i)
end do

do j = 1,n
do i = 1,n
uold(i,j) = unew(i,j)
end do
end do

iter = iter + 1
if ((mod(iter,OUTFREQ) .eq. 0) .or. (err .lt. eps)) then
write(*, '(A, I8, A, ES13.6)') 'Iter. ', iter, ', err = ', err
Expand All @@ -103,7 +103,7 @@ program poisson

write(*,'(A, ES13.6, A)') 'Finished in ', stop-strt, ' s'


! Final time step output
if (FOUT) then
open(7, file = 'final_phi.dat')
Expand All @@ -113,9 +113,9 @@ program poisson
end do
close(7)
end if

deallocate(uold)
deallocate(unew)
deallocate(f)

end program poisson
Loading