Age | Commit message (Collapse) | Author |
|
model.py should be a file containing only dataclasses to model finance.
simulate.py should take care of the simulation of that finance data to
create a financial forecast.
|
|
This introduces the plot() helper function to plot the default data
format list[tuple[datetime, Decimal]] with matplotlib.
|
|
|
|
This type is useful for finance-py in general. It is often required to
handle money in datetime context. Using this type consistently makes the
code easier to read and maintain.
|
|
|
|
|
|
|
|
|
|
|
|
This was renamed to "flow".
|
|
That way a flow can be limited to a certain time frame.
|
|
This refactoring introduces a generator function supporting the
integration. It creates datetime candidates where it can be checked if
they are in the time interval given to the integration method.
Furthermore a numerical improvement was made. The Flow.integrate()
function now checks candidates from the helper function and sums the
matching candidates up as an integer. After checking all candidates the
integer is converted to a decimal and multiplied by Flow.amount.
This is more accurate because in Python decimal calculation not numbers
or calculations are rounded, just the result of a calculation. Looping
over the candidates and adding amount each time thus involves a rounding
operation per candidate. The new algorithm has exactly one rounding
operation.
|
|
Modeling income and expenses separately does not make sense since the
only difference is the sign of the amount. Separate definitions would
lead to a lot of duplicated code.
|
|
Floating point data types are not suitable to represent money since
rounding issues will sum up.
|
|
Time-based Integration in general is done between two time stamps. For
the financial context it makes sense to use Python's datetime.datetime
class for this purpose.
This commit implements integrating an income between two
datetime.datetime time stamps.
|
|
This is the minimal starting point to model financial income.
|
|
This package should contain the primary content of this repository.
|