vates 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vates-0.1.0/LICENSE +21 -0
- vates-0.1.0/PKG-INFO +106 -0
- vates-0.1.0/README.md +91 -0
- vates-0.1.0/pyproject.toml +24 -0
- vates-0.1.0/setup.cfg +4 -0
- vates-0.1.0/vates/__init__.py +30 -0
- vates-0.1.0/vates/_core/__init__.py +16 -0
- vates-0.1.0/vates/_core/_html_generator.py +529 -0
- vates-0.1.0/vates/_core/cli.py +28 -0
- vates-0.1.0/vates/_core/keyed_array.py +340 -0
- vates-0.1.0/vates/_core/proj_model_engine.py +518 -0
- vates-0.1.0/vates/_core/proj_variables.py +283 -0
- vates-0.1.0/vates/_core/stoch_executor.py +309 -0
- vates-0.1.0/vates/_core/utils.py +233 -0
- vates-0.1.0/vates/alm/__init__.py +27 -0
- vates-0.1.0/vates/alm/assets/__init__.py +25 -0
- vates-0.1.0/vates/alm/assets/_bond_fixed_component.py +376 -0
- vates-0.1.0/vates/alm/assets/_derivative_pricer.py +255 -0
- vates-0.1.0/vates/alm/assets/asset_base.py +226 -0
- vates-0.1.0/vates/alm/assets/bond_fixed.py +375 -0
- vates-0.1.0/vates/alm/assets/builders/__init__.py +11 -0
- vates-0.1.0/vates/alm/assets/builders/asset_creation.py +48 -0
- vates-0.1.0/vates/alm/assets/builders/bond_fixed_builder.py +251 -0
- vates-0.1.0/vates/alm/assets/builders/equity_option_builder.py +125 -0
- vates-0.1.0/vates/alm/assets/cash.py +147 -0
- vates-0.1.0/vates/alm/assets/equity.py +184 -0
- vates-0.1.0/vates/alm/assets/equity_option.py +248 -0
- vates-0.1.0/vates/alm/econs/__init__.py +14 -0
- vates-0.1.0/vates/alm/econs/credit_band.py +95 -0
- vates-0.1.0/vates/alm/econs/currency.py +57 -0
- vates-0.1.0/vates/alm/econs/equity_index.py +120 -0
- vates-0.1.0/vates/alm/econs/market_info.py +49 -0
- vates-0.1.0/vates/alm/econs/yield_curve.py +135 -0
- vates-0.1.0/vates/alm/enums.py +34 -0
- vates-0.1.0/vates/alm/funds/__init__.py +10 -0
- vates-0.1.0/vates/alm/funds/_asset_allocator.py +425 -0
- vates-0.1.0/vates/alm/funds/_fund_calculator.py +332 -0
- vates-0.1.0/vates/alm/funds/fund.py +322 -0
- vates-0.1.0/vates/alm/liabs/__init__.py +7 -0
- vates-0.1.0/vates/alm/liabs/ext_proj_liab.py +130 -0
- vates-0.1.0/vates/alm/liabs/liab_base.py +208 -0
- vates-0.1.0/vates/solvency/__init__.py +6 -0
- vates-0.1.0/vates/solvency/cn_cross2/__init__.py +27 -0
- vates-0.1.0/vates/solvency/cn_cross2/params.py +186 -0
- vates-0.1.0/vates/solvency/cn_cross2/quant_risk_min_cap.py +366 -0
- vates-0.1.0/vates/utils/__init__.py +96 -0
- vates-0.1.0/vates/utils/curve_conversion.py +297 -0
- vates-0.1.0/vates/utils/curve_extrapolation.py +334 -0
- vates-0.1.0/vates/utils/curve_interpolation.py +168 -0
- vates-0.1.0/vates/utils/data_classes.py +26 -0
- vates-0.1.0/vates/utils/qfi.py +83 -0
- vates-0.1.0/vates/utils/risk_module.py +55 -0
- vates-0.1.0/vates/utils/uncategorized.py +28 -0
- vates-0.1.0/vates.egg-info/PKG-INFO +106 -0
- vates-0.1.0/vates.egg-info/SOURCES.txt +56 -0
- vates-0.1.0/vates.egg-info/dependency_links.txt +1 -0
- vates-0.1.0/vates.egg-info/requires.txt +3 -0
- vates-0.1.0/vates.egg-info/top_level.txt +1 -0
vates-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shanya Shi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
vates-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vates
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python actuarial model
|
|
5
|
+
Author-email: Shanya Shi <shanyashi2025@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: actuarial model,asset-liability model,alm
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: numpy>=2.2.6
|
|
12
|
+
Requires-Dist: pandas<3.0.0,>=2.3.0
|
|
13
|
+
Requires-Dist: scipy
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# Vates Project
|
|
17
|
+
|
|
18
|
+
Open-source Python framework and sample implementations for actuarial modeling.
|
|
19
|
+
|
|
20
|
+
### How this repo is organized
|
|
21
|
+
|
|
22
|
+
1. **`vates/`** — The **standard** library / installable package: reusable framework code (`pip install -e .`).
|
|
23
|
+
2. **`examples/model/`** — **Example / tutorial for model developers** (company builders): reference models (`fund_model.py`, `port_monte_carlo.py`) and local package(s) (`local_package/`).
|
|
24
|
+
3. **Other folders under `examples/`** (`scripts/`, `cli/`, `input/`, …) — **Example / tutorial for most colleagues**: how to run models for analysis and reporting (commands, sample data), without editing framework or model code.
|
|
25
|
+
4. The **`gui/`** app is another way for analysts to run tasks.
|
|
26
|
+
|
|
27
|
+
## Install the framework (`vates`)
|
|
28
|
+
|
|
29
|
+
Work from the **repository root**.
|
|
30
|
+
|
|
31
|
+
### 1. Create a virtual environment (recommended)
|
|
32
|
+
|
|
33
|
+
**PowerShell** (Windows):
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
cd path\to\your\project
|
|
37
|
+
python -m venv .venv
|
|
38
|
+
.venv\Scripts\Activate.ps1
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
If activation is blocked by execution policy, run once in that window:
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then run `Activate.ps1` again.
|
|
48
|
+
|
|
49
|
+
**Command Prompt** (`cmd.exe`):
|
|
50
|
+
|
|
51
|
+
```bat
|
|
52
|
+
cd path\to\your\project
|
|
53
|
+
python -m venv .venv
|
|
54
|
+
.venv\Scripts\activate.bat
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
You should see `(.venv)` in the prompt when the environment is active.
|
|
58
|
+
|
|
59
|
+
### 2. Install `vates` in editable mode
|
|
60
|
+
|
|
61
|
+
```powershell
|
|
62
|
+
pip install -e .
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
This installs the distribution **`vates`** in editable mode; import the library as **`import vates`**.
|
|
66
|
+
|
|
67
|
+
## Project layout
|
|
68
|
+
|
|
69
|
+
| Path | Role |
|
|
70
|
+
|---------------------|--------------------------------------------------|
|
|
71
|
+
| `vates/` | Core framework and library (`pip install -e .`). |
|
|
72
|
+
| `examples/model/` | Reference models and company-style package(s). |
|
|
73
|
+
| `examples/scripts/` | Python scripts that call the reference models. |
|
|
74
|
+
| `examples/cli/` | CLI commands and model args json files. |
|
|
75
|
+
| `examples/input/` | Sample CSV input data. |
|
|
76
|
+
| `gui/` | End-user launcher. |
|
|
77
|
+
| `docs/` | Structure notes and discussions. |
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
## Quick start
|
|
81
|
+
|
|
82
|
+
### 1) Example Models
|
|
83
|
+
|
|
84
|
+
| No | Example Model | Python Script | CLI + json |
|
|
85
|
+
|----|-----------------------|------------------------------------------|-----------------------------|
|
|
86
|
+
| 1 | 01_asset_proj | `python .\examples\scripts\script_01.py` | `.\examples\cli\cli_01.bat` |
|
|
87
|
+
| 2 | 02_fund_proj | `python .\examples\scripts\script_02.py` | `.\examples\cli\cli_02.bat` |
|
|
88
|
+
| 3 | 03_cross_proj | `python .\examples\scripts\script_11.py` | `.\examples\cli\cli_11.bat` |
|
|
89
|
+
| 5 | 21_smith_wilson | `python .\examples\scripts\script_21.py` | `.\examples\cli\cli_21.bat` |
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
- Model output can be found in `.\examples\results\script_*` and/or `.\examples\results\cli_*`
|
|
93
|
+
- CLI is configured via the corresponding json file `.\examples\cli\model_args_*.json`.
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### 2) GUI
|
|
97
|
+
|
|
98
|
+
Start GUI:
|
|
99
|
+
```powershell
|
|
100
|
+
.\gui\start.bat
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## For model developers
|
|
104
|
+
|
|
105
|
+
- Treat **`examples/model/`** as a **reference** layout: copy `local_package/` (rename to your company package) and the model files into your own repository.
|
|
106
|
+
- Keep company-specific code **outside** `vates/`; depend on **`vates`** via `pip install` or your dependency mechanism.
|
vates-0.1.0/README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Vates Project
|
|
2
|
+
|
|
3
|
+
Open-source Python framework and sample implementations for actuarial modeling.
|
|
4
|
+
|
|
5
|
+
### How this repo is organized
|
|
6
|
+
|
|
7
|
+
1. **`vates/`** — The **standard** library / installable package: reusable framework code (`pip install -e .`).
|
|
8
|
+
2. **`examples/model/`** — **Example / tutorial for model developers** (company builders): reference models (`fund_model.py`, `port_monte_carlo.py`) and local package(s) (`local_package/`).
|
|
9
|
+
3. **Other folders under `examples/`** (`scripts/`, `cli/`, `input/`, …) — **Example / tutorial for most colleagues**: how to run models for analysis and reporting (commands, sample data), without editing framework or model code.
|
|
10
|
+
4. The **`gui/`** app is another way for analysts to run tasks.
|
|
11
|
+
|
|
12
|
+
## Install the framework (`vates`)
|
|
13
|
+
|
|
14
|
+
Work from the **repository root**.
|
|
15
|
+
|
|
16
|
+
### 1. Create a virtual environment (recommended)
|
|
17
|
+
|
|
18
|
+
**PowerShell** (Windows):
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
cd path\to\your\project
|
|
22
|
+
python -m venv .venv
|
|
23
|
+
.venv\Scripts\Activate.ps1
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If activation is blocked by execution policy, run once in that window:
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then run `Activate.ps1` again.
|
|
33
|
+
|
|
34
|
+
**Command Prompt** (`cmd.exe`):
|
|
35
|
+
|
|
36
|
+
```bat
|
|
37
|
+
cd path\to\your\project
|
|
38
|
+
python -m venv .venv
|
|
39
|
+
.venv\Scripts\activate.bat
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You should see `(.venv)` in the prompt when the environment is active.
|
|
43
|
+
|
|
44
|
+
### 2. Install `vates` in editable mode
|
|
45
|
+
|
|
46
|
+
```powershell
|
|
47
|
+
pip install -e .
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This installs the distribution **`vates`** in editable mode; import the library as **`import vates`**.
|
|
51
|
+
|
|
52
|
+
## Project layout
|
|
53
|
+
|
|
54
|
+
| Path | Role |
|
|
55
|
+
|---------------------|--------------------------------------------------|
|
|
56
|
+
| `vates/` | Core framework and library (`pip install -e .`). |
|
|
57
|
+
| `examples/model/` | Reference models and company-style package(s). |
|
|
58
|
+
| `examples/scripts/` | Python scripts that call the reference models. |
|
|
59
|
+
| `examples/cli/` | CLI commands and model args json files. |
|
|
60
|
+
| `examples/input/` | Sample CSV input data. |
|
|
61
|
+
| `gui/` | End-user launcher. |
|
|
62
|
+
| `docs/` | Structure notes and discussions. |
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## Quick start
|
|
66
|
+
|
|
67
|
+
### 1) Example Models
|
|
68
|
+
|
|
69
|
+
| No | Example Model | Python Script | CLI + json |
|
|
70
|
+
|----|-----------------------|------------------------------------------|-----------------------------|
|
|
71
|
+
| 1 | 01_asset_proj | `python .\examples\scripts\script_01.py` | `.\examples\cli\cli_01.bat` |
|
|
72
|
+
| 2 | 02_fund_proj | `python .\examples\scripts\script_02.py` | `.\examples\cli\cli_02.bat` |
|
|
73
|
+
| 3 | 03_cross_proj | `python .\examples\scripts\script_11.py` | `.\examples\cli\cli_11.bat` |
|
|
74
|
+
| 5 | 21_smith_wilson | `python .\examples\scripts\script_21.py` | `.\examples\cli\cli_21.bat` |
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
- Model output can be found in `.\examples\results\script_*` and/or `.\examples\results\cli_*`
|
|
78
|
+
- CLI is configured via the corresponding json file `.\examples\cli\model_args_*.json`.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### 2) GUI
|
|
82
|
+
|
|
83
|
+
Start GUI:
|
|
84
|
+
```powershell
|
|
85
|
+
.\gui\start.bat
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## For model developers
|
|
89
|
+
|
|
90
|
+
- Treat **`examples/model/`** as a **reference** layout: copy `local_package/` (rename to your company package) and the model files into your own repository.
|
|
91
|
+
- Keep company-specific code **outside** `vates/`; depend on **`vates`** via `pip install` or your dependency mechanism.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vates"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Python actuarial model"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Shanya Shi", email = "shanyashi2025@gmail.com"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["actuarial model", "asset-liability model", "alm"]
|
|
16
|
+
dependencies = [
|
|
17
|
+
"numpy>=2.2.6",
|
|
18
|
+
"pandas>=2.3.0, <3.0.0",
|
|
19
|
+
"scipy",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[tool.setuptools.packages.find]
|
|
23
|
+
where = ["."]
|
|
24
|
+
include = ["vates*"]
|
vates-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from vates._core import (
|
|
2
|
+
cli_main,
|
|
3
|
+
cli_run,
|
|
4
|
+
ProjModelEngine,
|
|
5
|
+
StochExecutor,
|
|
6
|
+
ConstVariable,
|
|
7
|
+
TDepVariable,
|
|
8
|
+
KeyedArray,
|
|
9
|
+
)
|
|
10
|
+
from vates import utils
|
|
11
|
+
|
|
12
|
+
from vates import alm
|
|
13
|
+
from vates import solvency
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
# core
|
|
17
|
+
'cli_main',
|
|
18
|
+
'cli_run',
|
|
19
|
+
'ProjModelEngine',
|
|
20
|
+
'StochExecutor',
|
|
21
|
+
'ConstVariable',
|
|
22
|
+
'TDepVariable',
|
|
23
|
+
'KeyedArray',
|
|
24
|
+
# utils
|
|
25
|
+
'utils',
|
|
26
|
+
# libs
|
|
27
|
+
'alm',
|
|
28
|
+
'solvency',
|
|
29
|
+
|
|
30
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from vates._core.proj_model_engine import ProjModelEngine
|
|
2
|
+
from vates._core.stoch_executor import StochExecutor
|
|
3
|
+
from vates._core.proj_variables import ConstVariable, TDepVariable
|
|
4
|
+
from vates._core.cli import cli_main, cli_run
|
|
5
|
+
from vates._core.keyed_array import KeyedArray
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
'cli_main',
|
|
10
|
+
'cli_run',
|
|
11
|
+
'ProjModelEngine',
|
|
12
|
+
'StochExecutor',
|
|
13
|
+
'ConstVariable',
|
|
14
|
+
'TDepVariable',
|
|
15
|
+
'KeyedArray',
|
|
16
|
+
]
|