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 makes sure this script is also detected by the tools used in
tools/check_source.sh.
In general it is not a bad idea to use a file name extension to indicate
the file type. This improves compatibility with other tools in general.
The downside is that command line tools usually should not have a file
name extension. This can be worked around by using symlinks or an
install step. Both can remove the file name extension.
|
|
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 makes the output less trivial.
|
|
|
|
|
|
|
|
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 script checks for common programming errors in the Python code of
this repository.
It might be symlinked by `.git/hooks/pre-commit` to make sure those
errors do not end up in the Git history.
|
|
This package should contain the primary content of this repository.
|
|
|
|
|