# numpkg

*module*

Small package with numpy-style docstrings.

Exists so the parser tests cover the numpy section syntax (underlined section
titles, `name : type` parameter lines).

[View source](https://github.com/ewels/starlight-pydocs/blob/main/fixtures/numpkg/src/numpkg/__init__.py#L1-L1)

## numpkg.Grid

*class*

```python
class Grid
```

A rectangular grid of samples.

**Parameters**

- `width` (`int`) — Number of columns.
- `height` (`int`) — Number of rows.

**Attributes**

- `width` (`int`) — Number of columns.
- `height` (`int`) — Number of rows.

[View source](https://github.com/ewels/starlight-pydocs/blob/main/fixtures/numpkg/src/numpkg/__init__.py#L10-L40)

### numpkg.Grid.height

*attribute* · *instance attribute*

```python
height = height
```

[View source](https://github.com/ewels/starlight-pydocs/blob/main/fixtures/numpkg/src/numpkg/__init__.py#L30-L30)

### numpkg.Grid.width

*attribute* · *instance attribute*

```python
width = width
```

[View source](https://github.com/ewels/starlight-pydocs/blob/main/fixtures/numpkg/src/numpkg/__init__.py#L29-L29)

### numpkg.Grid.area

*method*

```python
def area() -> int
```

Compute the number of cells.

**Returns**

- (`int`) — Width multiplied by height.

[View source](https://github.com/ewels/starlight-pydocs/blob/main/fixtures/numpkg/src/numpkg/__init__.py#L32-L40)

## numpkg.resample

*function*

```python
def resample(grid: Grid, factor: float = 2.0) -> Grid
```

Scale a grid by a factor.

**Parameters**

- `grid` (`Grid`) — The grid to scale.
- `factor` (`float`) (default: `2.0`) — Multiplier applied to both dimensions, by default 2.0.

**Returns**

- (`Grid`) — A new, scaled grid.

**Raises**

- `ValueError` — If `factor` is not positive.

**Examples**

```pycon
>>> resample(Grid(2, 3), 2.0).area()
24
```

[View source](https://github.com/ewels/starlight-pydocs/blob/main/fixtures/numpkg/src/numpkg/__init__.py#L43-L70)
