From 29e1eab2f5f590a5e5bc9724a856de33ec1d32cb Mon Sep 17 00:00:00 2001 From: Roman Cattaneo <> Date: Fri, 13 Feb 2026 09:25:54 +0100 Subject: [PATCH 1/3] docs: cleanup docstrings of tridiag solver --- ndsl/stencils/tridiag.py | 57 +++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/ndsl/stencils/tridiag.py b/ndsl/stencils/tridiag.py index 87b7311e..58374ef3 100644 --- a/ndsl/stencils/tridiag.py +++ b/ndsl/stencils/tridiag.py @@ -14,27 +14,30 @@ def tridiag_solve( """ This stencil solves a square, k x k tridiagonal matrix system with coefficients a, b, and c, and vectors p and d using the Thomas algorithm: - ! ### ### ### ### ### ###! - ! #b(0), c(0), 0 , 0 , 0 , . . . , 0 # # x(0) # # d(0) #! - ! #a(1), b(1), c(1), 0 , 0 , . . . , 0 # # x(1) # # d(1) #! - ! # 0 , a(2), b(2), c(2), 0 , . . . , 0 # # x(2) # # d(2) #! - ! # 0 , 0 , a(3), b(3), c(3), . . . , 0 # # x(3) # # d(3) #! - ! # 0 , 0 , 0 , a(4), b(4), . . . , 0 # # x(4) # # d(4) #! - ! # . . # # . # = # . #! - ! # . . # # . # # . #! - ! # . . # # . # # . #! - ! # 0 , . . . , 0 , a(k-2), b(k-2), c(k-2), 0 # #x(k-3)# #d(k-3)#! - ! # 0 , . . . , 0 , 0 , a(k-1), b(k-1), c(k-1)# #x(k-2)# #d(k-2)#! - ! # 0 , . . . , 0 , 0 , 0 , a(k) , b(k) # #x(k-1)# #d(k-1)#! - ! ### ### ### ### ### ###! + + ``` + ### ### ### ### ### ### + #b(0), c(0), 0 , 0 , 0 , . . . , 0 # # x(0) # # d(0) # + #a(1), b(1), c(1), 0 , 0 , . . . , 0 # # x(1) # # d(1) # + # 0 , a(2), b(2), c(2), 0 , . . . , 0 # # x(2) # # d(2) # + # 0 , 0 , a(3), b(3), c(3), . . . , 0 # # x(3) # # d(3) # + # 0 , 0 , 0 , a(4), b(4), . . . , 0 # # x(4) # # d(4) # + # . . # # . # = # . # + # . . # # . # # . # + # . . # # . # # . # + # 0 , . . . , 0 , a(k-2), b(k-2), c(k-2), 0 # #x(k-3)# #d(k-3)# + # 0 , . . . , 0 , 0 , a(k-1), b(k-1), c(k-1)# #x(k-2)# #d(k-2)# + # 0 , . . . , 0 , 0 , 0 , a(k) , b(k) # #x(k-1)# #d(k-1)# + ### ### ### ### ### ### + ``` Args: - a (in): lower-diagonal matrix coefficients - b (in): diagonal matrix coefficients - c (in): upper-diagonal matrix coefficients - d (in): Result vector - x (out): The vector to solve for - delta (out): d post-pivot + a: lower-diagonal matrix coefficients + b: diagonal matrix coefficients + c: upper-diagonal matrix coefficients + d: Result vector + x: The vector to solve for + delta: d post-pivot """ with computation(FORWARD): # Forward sweep with interval(0, 1): @@ -60,16 +63,16 @@ def masked_tridiag_solve( mask: BoolFieldIJ, ) -> None: """ - Same as tridiag_solve but restricted to a subset of horizontal points + Same as `tridiag_solve` but restricted to a subset of horizontal points. Args: - a (in): lower-diagonal matrix coefficients - b (in): diagonal matrix coefficients - c (in): upper-diagonal matrix coefficients - d (in): Result vector - mask (in): Columns to execute the stencil on - x (out): The vector to solve for - delta (out): d post-pivot + a: lower-diagonal matrix coefficients + b: diagonal matrix coefficients + c: upper-diagonal matrix coefficients + d: Result vector + mask: Columns to execute the stencil on + x: The vector to solve for + delta: d post-pivot """ with computation(FORWARD): # Forward sweep with interval(0, 1): From 5c0b7ea2b631e57c875df3b520cb541ff6cff2ac Mon Sep 17 00:00:00 2001 From: Roman Cattaneo <> Date: Fri, 13 Feb 2026 09:31:48 +0100 Subject: [PATCH 2/3] docs: remove stale reference to ndsl namelist --- mkdocs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 0e5738f1..62b3fbcf 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -26,7 +26,6 @@ nav: - "constants": docstrings/top/constants.md - "io": docstrings/top/io.md - "logging": docstrings/top/logging.md - - "namelist": docstrings/top/namelist.md - "optional_imports": docstrings/top/optional_imports.md - "types": docstrings/top/types.md - "typing": docstrings/top/typing.md From 74585107ac1d02c50be4c65d1ca0b37d5f762b89 Mon Sep 17 00:00:00 2001 From: Roman Cattaneo <> Date: Thu, 12 Feb 2026 10:12:08 +0100 Subject: [PATCH 3/3] docs: fix whitespace in docstring --- ndsl/quantity/quantity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndsl/quantity/quantity.py b/ndsl/quantity/quantity.py index 95b0400c..67d437c2 100644 --- a/ndsl/quantity/quantity.py +++ b/ndsl/quantity/quantity.py @@ -386,7 +386,7 @@ def transpose( >>> quantity = Quantity( ... data=np.zeros([2, 3, 4]), ... dims=[I_DIM, J_DIM, K_DIM], - ... units="m", + ... units="m", ... ) If you know you are working with cell-centered variables, you can do: