Skip to content

Commit f47e8af

Browse files
authored
Merge pull request #136 from jorenham/typing
2 parents 528aba0 + a1e13f1 commit f47e8af

File tree

6 files changed

+461
-41
lines changed

6 files changed

+461
-41
lines changed

.github/workflows/type_check.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Type-check
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
type-check:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 5
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: astral-sh/setup-uv@v6
21+
with:
22+
python-version: "3.11"
23+
activate-environment: true
24+
25+
- name: env setup
26+
run: uv pip install . numpy mypy
27+
28+
- name: run mypy
29+
run: mypy --no-incremental --cache-dir=/dev/null .
30+
31+
- name: run pyright
32+
uses: jakebailey/pyright-action@v2

numpy_financial/_cfinancial.pyi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from typing import TypeAlias
2+
3+
import numpy as np
4+
import numpy.typing as npt
5+
6+
_ArrayF64: TypeAlias = npt.NDArray[np.float64]
7+
8+
def nper(
9+
rates: _ArrayF64,
10+
pmts: _ArrayF64,
11+
pvs: _ArrayF64,
12+
fvs: _ArrayF64,
13+
whens: _ArrayF64,
14+
out: _ArrayF64,
15+
) -> None: ...
16+
def npv(rates: _ArrayF64, values: _ArrayF64, out: _ArrayF64) -> None: ...

0 commit comments

Comments
 (0)