Skip to content

example_pkg

Type part of a name or a dotted path

A tiny package, so the example site has an API reference to render.

Classes

NameDescription
GridA uniform grid of cells on [start, stop].

Functions

NameDescription
linspace_midpointsThe midpoints of cells uniform cells on [start, stop].

Modules

  • gridA uniform 1D grid.

Gridclassdataclass#

class Grid(start: float, stop: float, cells: int)

A uniform grid of cells on [start, stop].

Attributes

NameTypeDescription
startfloatLeft end of the domain.
stopfloatRight end of the domain.
cellsintNumber of cells.

cellsattributeinstance attribute#

cells: int

startattributeinstance attribute#

start: float

stopattributeinstance attribute#

stop: float

spacingproperty#

spacing: float

The cell width h=(b−a)/nh = (b - a) / n.

nodesmethod#

def nodes() -> np.ndarray

The cells + 1 cell boundaries.

Returns

np.ndarray
The node coordinates.

linspace_midpointsfunction#

def linspace_midpoints(start: float, stop: float, cells: int) -> np.ndarray

The midpoints of cells uniform cells on [start, stop].

Parameters

NameTypeDescription
startfloatLeft end of the domain.
stopfloatRight end of the domain.
cellsintNumber of cells.

Returns

np.ndarray
An array of length cells.