Cashflower

Latest version: v0.7.1

Safety actively analyzes 634660 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 6

0.6.2

In this latest release, the primary focus has been on refining the order of variable calculation within cyclic relationships.

The key improvements in this version:

1. **Addition of the `cycle_order` attribute** - we've introduced the `cycle_order` attribute within the `Variable` class. This attribute contains an integer that defines the calculation order within groups of variables forming cycles.

2. **Prevention of bidirectional recursion** - bidirectional recursion, where a variable calls both `t-...` and `t+...` in its definition, is now explicitly disallowed in the models. This restriction helps maintain clear and manageable relationships between variables.

3. **Error handling for negative index calls** - the package raises errors for calls with negative indexes. When a model variable is invoked for `t<0`, the package prompts an error, preventing potential inconsistencies in computations.

0.6.1

**New in this release:**

- new feature for model variables that don’t aggregate,
- eliminated redundant warnings for non-git repository folders,
- enhanced and updated the documentation.

---

**New feature:**

Now, users can specify the `aggregation_type` for variables.

<br>

Default behaviour:
All results are summed automatically.

python
variable()
def my_variable(t):
code


This is equivalent to explicitly defining aggregation as sum:

python
variable(aggregation_type="sum")
def my_variable(t):
code


This default behavior suits most financial scenarios involving cash flows like premiums and expenses.

<br>

Additional customization:
Users can now specify variables where results are sourced only from the first model point:

python
variable(aggregation_type="first")
def my_variable(t):
code


This configuration ensures that only the results from the first model point are included.
Suitable for containing results like interest rate curves or projection years.

0.6.0

To upgrade your existing model to version >= 0.6.0 of the cashflower, insert the following code into your `run.py` script:

python
import os
from cashflower import run
from settings import settings

if __name__ == "__main__":
output = run(settings=settings, path=os.path.dirname(__file__))

0.5.7

In this release, we're introducing a new configuration setting called `GROUP_BY_COLUMN`. This feature enables the creation of aggregated results based on specified groups.

To generate results grouped by a specific column, such as `product_code`, configure the settings as shown below:

settings.py
python
settings = {
"AGGREGATE": True,
"GROUP_BY_COLUMN": "product_code",
...
}


Please note that the `product_code` column must be part of the `main` model point set, as demonstrated below:

input.py
python
main = ModelPointSet(data=pd.DataFrame({
"id": [1, 2, 3],
"product_code": ["A", "B", "A"]
}))


The output will provide aggregated results grouped by the chosen column, for example:


t,product_code,fund_value
0,A,24000
1,A,24048
2,A,24096.1
3,A,24144.29
0,B,3000
1,B,3006
2,B,3012.01
3,B,3018.03

0.5.5

In this release, we have focused on enhancing the package's stability and maintainability.

Our efforts include the following improvements:

- fixed a bug which logged the runplan version multiple times when multiprocessing
- renamed `cashflow.py` to `core.py` - this change aligns with the widely-accepted convention of using "core.py" to designate a central module within a Python package, emphasizing its fundamental role,
- moved `pytest` configuration from `pytest.ini` to `pyproject.toml` to reduce the number of configuration files,
- added configuration for `ruff` (linter tool) in `pyproject.toml`,
- added documentation on development testing and files overview,
- improved speed of the `discount()` function by incorporating `cython.boundscheck(False)` and `cython.wraparound(False)`.

0.5.4

![image](https://github.com/acturtle/cashflower/assets/108257223/f5ac234b-5a62-4b08-a21d-4aebd0490684)

Page 2 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.