Skip to content

Commit 060cc2d

Browse files
committed
rename top-level namespace
1 parent 88fdb28 commit 060cc2d

26 files changed

+97
-89
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The goal is to replicate Excel results (right and wrong). Feel free to contribu
1414

1515

1616
#### How do I use the library?
17-
Just add ExcelFinancialFunctions.dll to the references in your project. The functions are provided as static methods on a Financial class in the System.Numerics namespace
17+
Just add ExcelFinancialFunctions.dll to the references in your project. The functions are provided as static methods on a Financial class in the Excel.FinancialFunctions namespace
1818

1919

2020
#### Have you tested this thing?

Diff for: RELEASE_NOTES.md

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99

1010
#### 2.1
1111
* Move to github
12+
13+
#### 2.2
14+
* Rename the top-level namespace to `Excel.FinancialFunctions`
15+

Diff for: docs/content/compatibility.fsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#r "ExcelFinancialFunctions.dll"
44

55
open System
6-
open System.Numerics
6+
open Excel.FinancialFunctions
77

88
(**
99
Compatibility

Diff for: docs/content/index.fsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This example demonstrates using the YIELD function to calculate bond yield.
3434
*)
3535
#r "ExcelFinancialFunctions.dll"
3636
open System
37-
open System.Numerics
37+
open Excel.FinancialFunctions
3838

3939
// returns 0.065 or 6.5%
4040
Financial.Yield (DateTime(2008,2,15), DateTime(2016,11,15), 0.0575, 95.04287, 100.0,

Diff for: docs/content/openofficediff.fsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#r "ExcelFinancialFunctions.dll"
44

55
open System
6-
open System.Numerics
6+
open Excel.FinancialFunctions
77

88
(**
99
Difference between OpenOffice and the library

Diff for: src/ExcelFinancialFunctions/AssemblyInfo.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ open System.Reflection
44
[<assembly: AssemblyTitleAttribute("ExcelFinancialFunctions")>]
55
[<assembly: AssemblyProductAttribute("ExcelFinancialFunctions")>]
66
[<assembly: AssemblyDescriptionAttribute("A .NET library that provides the full set of financial functions from Excel.")>]
7-
[<assembly: AssemblyVersionAttribute("2.1")>]
8-
[<assembly: AssemblyFileVersionAttribute("2.1")>]
7+
[<assembly: AssemblyVersionAttribute("2.2")>]
8+
[<assembly: AssemblyFileVersionAttribute("2.2")>]
99
do ()
1010

1111
module internal AssemblyVersionInformation =
12-
let [<Literal>] Version = "2.1"
12+
let [<Literal>] Version = "2.2"

Diff for: src/ExcelFinancialFunctions/bonds.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Bonds mathematics the Excel way
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44

5-
open System.Numerics.Common
6-
open System.Numerics.DayCount
5+
open Excel.FinancialFunctions.Common
6+
open Excel.FinancialFunctions.DayCount
77

88
module internal Bonds =
99

Diff for: src/ExcelFinancialFunctions/common.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Common math, error management, zero finding, etc... routines used in all the rest of the library
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44

55
open System
66
open System.Collections.Generic

Diff for: src/ExcelFinancialFunctions/daycountbasis.fs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// I tried to abstract out the commonality in one interface, but I have some special cases in the rest of the code
33
// If you want to support your own daycount, you should be ok just implementing the IDayCount interface
44
#light
5-
namespace System.Numerics
5+
namespace Excel.FinancialFunctions
66

77
open System
8-
open System.Numerics.Common
8+
open Excel.FinancialFunctions.Common
99

1010
module internal DayCount =
1111
// Some of the Excel day count info comes from http://www.dwheeler.com/yearfrac/excel-ooxml-yearfrac.pdf

Diff for: src/ExcelFinancialFunctions/depreciation.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Depreciation calculations. AmorDegr and AmorLinc required a lot of work and trial and error. I wonder how many people are using them.
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44

55
open System
6-
open System.Numerics.Common
7-
open System.Numerics.DayCount // because of AmorDegr and AmorLinc
6+
open Excel.FinancialFunctions.Common
7+
open Excel.FinancialFunctions.DayCount // because of AmorDegr and AmorLinc
88

99
module internal Depreciation =
1010

Diff for: src/ExcelFinancialFunctions/irr.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Finding internal rate of return routines. I use a different algo then excel. The results might be different.
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44

55
open System
6-
open System.Numerics.Common
7-
open System.Numerics.Tvm
6+
open Excel.FinancialFunctions.Common
7+
open Excel.FinancialFunctions.Tvm
88

99
module internal Irr =
1010

Diff for: src/ExcelFinancialFunctions/loan.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Loan related calculation routines, small variations on TVM
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44

55
open System
6-
open System.Numerics.Common
7-
open System.Numerics.Tvm
6+
open Excel.FinancialFunctions.Common
7+
open Excel.FinancialFunctions.Tvm
88

99
module internal Loan =
1010
let inline approxEqual x y = abs (x - y) < 1e-10

Diff for: src/ExcelFinancialFunctions/misc.fs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Various routings that don't have an obvious classification in other files.
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44

55
open System
6-
open System.Numerics.Common
6+
open Excel.FinancialFunctions.Common
77

88
module internal Misc =
99

Diff for: src/ExcelFinancialFunctions/oddbonds.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Difficult to digest formulas for odd bonds calculations. Trust the testcases that I got these ones right.
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44

55
open System
6-
open System.Numerics.Common
7-
open System.Numerics.DayCount
6+
open Excel.FinancialFunctions.Common
7+
open Excel.FinancialFunctions.DayCount
88

99
module internal OddBonds =
1010

Diff for: src/ExcelFinancialFunctions/publicenums.fs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
// All the enums exposed in the external API, I need to define them first becasue they are used in the internal part
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44

55
/// Indicates when payments are due (end/beginning of period)
66
type PaymentDue =
77
| EndOfPeriod = 0
88
| BeginningOfPeriod = 1
99

10-
/// The type of Day Count Basis: US 30/360, Actual/actual, Actual/360, Actual/365 or European 30/360
10+
/// The type of Day Count Basis
1111
type DayCountBasis =
12+
/// US 30/360
1213
| UsPsa30_360 = 0
14+
/// Actual/Actual
1315
| ActualActual = 1
16+
/// Actual/360
1417
| Actual360 = 2
18+
/// Actual/365
1519
| Actual365 = 3
20+
/// European 30/360
1621
| Europ30_360 = 4
1722

1823
/// The number of coupon payments per year

Diff for: src/ExcelFinancialFunctions/tbill.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Very simple TBill mathematics. The only interesting thing is the 'if' statement on line 17.
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44

55
open System
6-
open System.Numerics.Common
7-
open System.Numerics.DayCount
6+
open Excel.FinancialFunctions.Common
7+
open Excel.FinancialFunctions.DayCount
88

99
module internal TBill =
1010

Diff for: src/ExcelFinancialFunctions/testpreconditions.fs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
namespace System.Numerics
1+
namespace Excel.FinancialFunctions
22

33
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo "ExcelFinancialFunctions.ConsoleTests">]
44
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo "ExcelFinancialFunctions.Tests">]
55
do()
66

77
module internal TestPreconditions =
88
open System
9-
open System.Numerics.Common
10-
open System.Numerics.Tvm
11-
open System.Numerics.Irr
12-
open System.Numerics.DayCount
9+
open Excel.FinancialFunctions.Common
10+
open Excel.FinancialFunctions.Tvm
11+
open Excel.FinancialFunctions.Irr
12+
open Excel.FinancialFunctions.DayCount
1313

1414
// Functions to define valid parameter combinations to testcases given that the permutations can create invalid parameters combinations
1515
let tryPv r nper pmt fv pd =

Diff for: src/ExcelFinancialFunctions/tvm.fs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Time value of money routines, note the extensive treatment of error condition to help the user with sensible error messages
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44

55
open System
6-
open System.Numerics.Common
6+
open Excel.FinancialFunctions.Common
77

88
module internal Tvm =
99

Diff for: src/ExcelFinancialFunctions/wrapperdotnettype.fs

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
// I cannot use F# optional parameters because they end up forcing you to include the F# dll
22
// Instead I use overloading with parsimony to achieve similar goals
33
#light
4-
namespace System.Numerics
4+
namespace Excel.FinancialFunctions
55

66
open System
77
open System.Collections
8-
open System.Numerics
9-
open System.Numerics.Common
10-
open System.Numerics.Tvm
11-
open System.Numerics.Loan
12-
open System.Numerics.Irr
13-
open System.Numerics.Depreciation
14-
open System.Numerics.DayCount
15-
open System.Numerics.Bonds
16-
open System.Numerics.TBill
17-
open System.Numerics.Misc
18-
open System.Numerics.OddBonds
8+
open Excel.FinancialFunctions.Common
9+
open Excel.FinancialFunctions.Tvm
10+
open Excel.FinancialFunctions.Loan
11+
open Excel.FinancialFunctions.Irr
12+
open Excel.FinancialFunctions.Depreciation
13+
open Excel.FinancialFunctions.DayCount
14+
open Excel.FinancialFunctions.Bonds
15+
open Excel.FinancialFunctions.TBill
16+
open Excel.FinancialFunctions.Misc
17+
open Excel.FinancialFunctions.OddBonds
1918

2019
/// A wrapper class to expose the Excel financial functions API to .NET clients
2120
type Financial =

Diff for: tests/ExcelFinancialFunctions.ConsoleTests/excel.fs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Wrappers for Excel functions to be used in the testcases
22
#light
3-
namespace System.Numerics
3+
namespace Excel.FinancialFunctions
44
open Microsoft.Office.Interop.Excel // You need Excel 12 to test this
55

66
open System
77
open System.Runtime.InteropServices // For COMException
8-
open System.Numerics.Common
9-
open System.Numerics.Tvm
10-
open System.Numerics.DayCount
8+
open Excel.FinancialFunctions.Common
9+
open Excel.FinancialFunctions.Tvm
10+
open Excel.FinancialFunctions.DayCount
1111

1212
module internal ExcelTesting =
1313
// Need to be a singleton for perf reasons

Diff for: tests/ExcelFinancialFunctions.ConsoleTests/testinfrastructure.fs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Test infrastructure. The idea is that Excel is the oracle.
22
// I test a whole bunch of different values for parameters against Excel and check that the result is the same.
33
#light
4-
namespace System.Numerics
4+
namespace Excel.FinancialFunctions
55

66
open System
77
open System.Collections
8-
open System.Numerics.ExcelTesting
9-
open System.Numerics.Common
10-
open System.Numerics.Tvm
8+
open Excel.FinancialFunctions.ExcelTesting
9+
open Excel.FinancialFunctions.Common
10+
open Excel.FinancialFunctions.Tvm
1111

1212
module internal TestInfrastructure =
1313

Diff for: tests/ExcelFinancialFunctions.ConsoleTests/testsdef.fs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// All the test values that I want to throw at the testcase infrastructure. Just add values here if you want to run 1,000,0000,000 tests
22
#light
33

4-
namespace System.Numerics
4+
namespace Excel.FinancialFunctions
55

66
open System
77
open System.Collections
8-
open System.Numerics.ExcelTesting
9-
open System.Numerics.Common
10-
open System.Numerics.Tvm
11-
open System.Numerics.Irr
12-
open System.Numerics.TestInfrastructure
13-
open System.Numerics.Depreciation
14-
open System.Numerics.DayCount
15-
open System.Numerics.Bonds
16-
open System.Numerics.OddBonds
8+
open Excel.FinancialFunctions.ExcelTesting
9+
open Excel.FinancialFunctions.Common
10+
open Excel.FinancialFunctions.Tvm
11+
open Excel.FinancialFunctions.Irr
12+
open Excel.FinancialFunctions.TestInfrastructure
13+
open Excel.FinancialFunctions.Depreciation
14+
open Excel.FinancialFunctions.DayCount
15+
open Excel.FinancialFunctions.Bonds
16+
open Excel.FinancialFunctions.OddBonds
1717

1818
module internal TestsDef =
1919

Diff for: tests/ExcelFinancialFunctions.ConsoleTests/testsexec.fs

+15-15
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77

88
open System
99
open System.Collections
10-
open System.Numerics
11-
open System.Numerics.ExcelTesting
12-
open System.Numerics.Common
13-
open System.Numerics.Tvm
14-
open System.Numerics.Loan
15-
open System.Numerics.Irr
16-
open System.Numerics.Depreciation
17-
open System.Numerics.DayCount
18-
open System.Numerics.TestInfrastructure
19-
open System.Numerics.TestsDef
20-
open System.Numerics.Bonds
21-
open System.Numerics.TBill
22-
open System.Numerics.Misc
23-
open System.Numerics.OddBonds
24-
open System.Numerics.TestPreconditions
10+
open Excel.FinancialFunctions
11+
open Excel.FinancialFunctions.ExcelTesting
12+
open Excel.FinancialFunctions.Common
13+
open Excel.FinancialFunctions.Tvm
14+
open Excel.FinancialFunctions.Loan
15+
open Excel.FinancialFunctions.Irr
16+
open Excel.FinancialFunctions.Depreciation
17+
open Excel.FinancialFunctions.DayCount
18+
open Excel.FinancialFunctions.TestInfrastructure
19+
open Excel.FinancialFunctions.TestsDef
20+
open Excel.FinancialFunctions.Bonds
21+
open Excel.FinancialFunctions.TBill
22+
open Excel.FinancialFunctions.Misc
23+
open Excel.FinancialFunctions.OddBonds
24+
open Excel.FinancialFunctions.TestPreconditions
2525

2626
try
2727
let tests = [|

Diff for: tests/ExcelFinancialFunctions.Tests/crosstests.fs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#nowarn "25"
22

3-
namespace ExcelFinancialFunctions.Tests
3+
namespace Excel.FinancialFunctions.Tests
44

55
open NUnit.Framework
66

77
[<SetCulture("en-US")>]
88
module CrossTests =
9-
open System.Numerics
9+
open Excel.FinancialFunctions
1010

1111
[<Test>]
1212
let accrint() = runTests "accrint" parse8 Financial.AccrInt

Diff for: tests/ExcelFinancialFunctions.Tests/spottests.fs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
namespace ExcelFinancialFunctions.Tests
1+
namespace Excel.FinancialFunctions.Tests
22

33
open FsCheck
44
open NUnit.Framework
55

66
[<SetCulture("en-US")>]
77
module SpotTests =
88
open System
9-
open System.Numerics
9+
open Excel.FinancialFunctions
1010
open TestPreconditions
1111

1212
[<Test>]

0 commit comments

Comments
 (0)