Skip to content

Commit dfb8432

Browse files
committed
Updated all notebooks
1 parent 176807e commit dfb8432

File tree

132 files changed

+8735
-11073
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+8735
-11073
lines changed

financepy/market/curves/discount_curve_pwf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DiscountCurvePWF(DiscountCurve):
2828
def __init__(
2929
self,
3030
value_dt: Date,
31-
zero_dts: list,
31+
zero_dts: list[Date],
3232
zero_rates: Union[list, np.ndarray],
3333
freq_type: FrequencyTypes = FrequencyTypes.CONTINUOUS,
3434
dc_type: DayCountTypes = DayCountTypes.ACT_ACT_ISDA,

financepy/models/merton_firm.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class MertonFirm:
2323

2424
def __init__(
2525
self,
26-
asset_value: Union[float, list, np.ndarray],
27-
bond_face: Union[float, list, np.ndarray],
28-
years_to_maturity: Union[float, list, np.ndarray],
29-
risk_free_rate: Union[float, list, np.ndarray],
30-
asset_growth_rate: Union[float, list, np.ndarray],
31-
asset_volatility: Union[float, list, np.ndarray],
26+
asset_value: Union[float, np.ndarray],
27+
bond_face: Union[float, np.ndarray],
28+
years_to_maturity: Union[float, np.ndarray],
29+
risk_free_rate: Union[float, np.ndarray],
30+
asset_growth_rate: Union[float, np.ndarray],
31+
asset_volatility: Union[float, np.ndarray],
3232
) -> None:
3333
"""Create an object that holds all of the model parameters. These
3434
parameters may be vectorised."""

financepy/models/merton_firm_mkt.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ class MertonFirmMkt(MertonFirm):
5454

5555
def __init__(
5656
self,
57-
equity_value: Union[float, list, np.ndarray],
58-
bond_face: Union[float, list, np.ndarray],
59-
years_to_maturity: Union[float, list, np.ndarray],
60-
risk_free_rate: Union[float, list, np.ndarray],
61-
asset_growth_rate: Union[float, list, np.ndarray],
62-
equity_volatility: Union[float, list, np.ndarray],
57+
equity_value: Union[float, np.ndarray],
58+
bond_face: Union[float, np.ndarray],
59+
years_to_maturity: Union[float, np.ndarray],
60+
risk_free_rate: Union[float, np.ndarray],
61+
asset_growth_rate: Union[float, np.ndarray],
62+
equity_volatility: Union[float, np.ndarray],
6363
):
6464
"""Create an object that holds all of the model parameters. These
6565
parameters may be vectorised."""

golden_tests/TestFinModelMerton.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (C) 2018, 2019, 2020 Dominic O'Kane
22

33
import add_fp_to_path
4+
import numpy as np
45

56
from FinTestCases import FinTestCases, global_test_case_mode
67
from financepy.models.merton_firm_mkt import MertonFirmMkt
@@ -14,11 +15,11 @@
1415
def test_fin_model_merton_credit():
1516

1617
# Input Equity values and equity vols
17-
equity_value = [2.6406, 2.6817, 3.977, 2.947, 2.528]
18-
equity_vol = [0.7103, 0.3929, 0.3121, 0.4595, 0.6181]
19-
bond_face = [4.0, 3.5, 3.5, 3.2, 4.0]
20-
risk_free_rate = [0.05, 0.05, 0.05, 0.05, 0.05]
21-
asset_growth_rate = [0.0306, 0.03, 0.031, 0.0302, 0.0305]
18+
equity_value = np.array([2.6406, 2.6817, 3.977, 2.947, 2.528])
19+
equity_vol = np.array([0.7103, 0.3929, 0.3121, 0.4595, 0.6181])
20+
bond_face = np.array([4.0, 3.5, 3.5, 3.2, 4.0])
21+
risk_free_rate = np.array([0.05, 0.05, 0.05, 0.05, 0.05])
22+
asset_growth_rate = np.array([0.0306, 0.03, 0.031, 0.0302, 0.0305])
2223
years_to_maturity = 1.0 # np.linspace(0.1, 10, 100)
2324

2425
model = MertonFirmMkt(

notebooks/finutils/FINCALENDAR_IntroductionToUsingCalendars.ipynb

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,7 @@
1111
"cell_type": "code",
1212
"execution_count": 1,
1313
"metadata": {},
14-
"outputs": [
15-
{
16-
"name": "stdout",
17-
"output_type": "stream",
18-
"text": [
19-
"####################################################################\n",
20-
"# FINANCEPY Version 1.1 - This build: 27 Aug 2025 at 13:28 #\n",
21-
"# This software is distributed FREE AND WITHOUT ANY WARRANTY #\n",
22-
"# Report bugs as issues at https://github.com/domokane/FinancePy #\n",
23-
"####################################################################\n",
24-
"\n"
25-
]
26-
}
27-
],
14+
"outputs": [],
2815
"source": [
2916
"from financepy.utils import *"
3017
]
@@ -273,7 +260,7 @@
273260
],
274261
"metadata": {
275262
"kernelspec": {
276-
"display_name": "base",
263+
"display_name": "Python 3",
277264
"language": "python",
278265
"name": "python3"
279266
},
@@ -287,7 +274,7 @@
287274
"name": "python",
288275
"nbconvert_exporter": "python",
289276
"pygments_lexer": "ipython3",
290-
"version": "3.13.5"
277+
"version": "3.13.7"
291278
}
292279
},
293280
"nbformat": 4,

notebooks/finutils/FINDATES_TestingDateInternals.ipynb

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,7 @@
2525
"cell_type": "code",
2626
"execution_count": 1,
2727
"metadata": {},
28-
"outputs": [
29-
{
30-
"name": "stdout",
31-
"output_type": "stream",
32-
"text": [
33-
"####################################################################\n",
34-
"# FINANCEPY Version 1.1 - This build: 27 Aug 2025 at 13:28 #\n",
35-
"# This software is distributed FREE AND WITHOUT ANY WARRANTY #\n",
36-
"# Report bugs as issues at https://github.com/domokane/FinancePy #\n",
37-
"####################################################################\n",
38-
"\n"
39-
]
40-
}
41-
],
28+
"outputs": [],
4229
"source": [
4330
"from financepy.utils import *"
4431
]
@@ -187,7 +174,7 @@
187174
],
188175
"metadata": {
189176
"kernelspec": {
190-
"display_name": "base",
177+
"display_name": "Python 3",
191178
"language": "python",
192179
"name": "python3"
193180
},
@@ -201,7 +188,7 @@
201188
"name": "python",
202189
"nbconvert_exporter": "python",
203190
"pygments_lexer": "ipython3",
204-
"version": "3.13.5"
191+
"version": "3.13.7"
205192
}
206193
},
207194
"nbformat": 4,

notebooks/finutils/FINDATE_CreatingAndManipulatingFinDates.ipynb

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,7 @@
2525
"cell_type": "code",
2626
"execution_count": 1,
2727
"metadata": {},
28-
"outputs": [
29-
{
30-
"name": "stdout",
31-
"output_type": "stream",
32-
"text": [
33-
"####################################################################\n",
34-
"# FINANCEPY Version 1.1 - This build: 27 Aug 2025 at 13:28 #\n",
35-
"# This software is distributed FREE AND WITHOUT ANY WARRANTY #\n",
36-
"# Report bugs as issues at https://github.com/domokane/FinancePy #\n",
37-
"####################################################################\n",
38-
"\n"
39-
]
40-
}
41-
],
28+
"outputs": [],
4229
"source": [
4330
"from financepy.utils import *"
4431
]
@@ -492,7 +479,7 @@
492479
],
493480
"metadata": {
494481
"kernelspec": {
495-
"display_name": "base",
482+
"display_name": "Python 3",
496483
"language": "python",
497484
"name": "python3"
498485
},
@@ -506,7 +493,7 @@
506493
"name": "python",
507494
"nbconvert_exporter": "python",
508495
"pygments_lexer": "ipython3",
509-
"version": "3.13.5"
496+
"version": "3.13.7"
510497
}
511498
},
512499
"nbformat": 4,

notebooks/finutils/FINDAYCOUNT_Introduction.ipynb

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,7 @@
1818
"cell_type": "code",
1919
"execution_count": 1,
2020
"metadata": {},
21-
"outputs": [
22-
{
23-
"name": "stdout",
24-
"output_type": "stream",
25-
"text": [
26-
"####################################################################\n",
27-
"# FINANCEPY Version 1.1 - This build: 27 Aug 2025 at 13:28 #\n",
28-
"# This software is distributed FREE AND WITHOUT ANY WARRANTY #\n",
29-
"# Report bugs as issues at https://github.com/domokane/FinancePy #\n",
30-
"####################################################################\n",
31-
"\n"
32-
]
33-
}
34-
],
21+
"outputs": [],
3522
"source": [
3623
"from financepy.utils import *"
3724
]
@@ -143,7 +130,7 @@
143130
],
144131
"metadata": {
145132
"kernelspec": {
146-
"display_name": "base",
133+
"display_name": "Python 3",
147134
"language": "python",
148135
"name": "python3"
149136
},
@@ -157,7 +144,7 @@
157144
"name": "python",
158145
"nbconvert_exporter": "python",
159146
"pygments_lexer": "ipython3",
160-
"version": "3.13.5"
147+
"version": "3.13.7"
161148
}
162149
},
163150
"nbformat": 4,

notebooks/finutils/FINSCHEDULE_ExamplesOfScheduleGeneration.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
],
226226
"metadata": {
227227
"kernelspec": {
228-
"display_name": "base",
228+
"display_name": "Python 3",
229229
"language": "python",
230230
"name": "python3"
231231
},
@@ -239,7 +239,7 @@
239239
"name": "python",
240240
"nbconvert_exporter": "python",
241241
"pygments_lexer": "ipython3",
242-
"version": "3.13.5"
242+
"version": "3.13.7"
243243
}
244244
},
245245
"nbformat": 4,

0 commit comments

Comments
 (0)