Skip to content

FinanceToolkit v2.1.3

Latest

Choose a tag to compare

@JerBouma JerBouma released this 27 Jun 09:03

Minor release with mostly bug fixes and some minor enhancements.

Bug Fixes

  1. Corrected trailing rolling axis for valuation ratios: The show_daily and trailing combination in get_enterprise_value, get_market_cap, and related valuation ratios was applying the rolling window on the wrong axis (tickers instead of dates), producing incorrect results when both parameters were active simultaneously.

  2. Resolved trailing parameter having no effect in get_market_cap: The if/else branches for trailing were identical, meaning the parameter was silently ignored regardless of what was passed.

  3. Fixed cumulative return calculations for edge case data: Replaced (1 + returns).cumprod() with (1 + returns.fillna(0)).cumprod() across historical_model.py and risk_model.py, and added .replace([np.inf, -np.inf], np.nan) before cumulative product computation to prevent inf propagation when input data contains gaps or anomalies.

  4. Resolved pandas FutureWarning in performance controller: Added future_stack=True to stack() calls in performance_controller.py to silence the upcoming default behaviour change in pandas.

  5. Fixed type annotation in helpers.py: Corrected pd.PeriodIndex to pd.DatetimeIndex in a function signature.

New Features

  1. trailing parameter for Models: Added a trailing parameter to the Models sub-module (e.g. get_weighted_average_cost_of_capital). When supplied, financial statement inputs are rolled over the trailing period before calculation, enabling TTM-style model outputs consistent with the same parameter in Ratios and Performance.

  2. trailing parameter for Ratios: Valuation ratios (P/E, P/B, free cash flow yield, price-to-earnings, etc.) now accept an explicit trailing parameter. Previously, quarterly data defaulted unconditionally to trailing=4; the parameter now allows overriding or disabling that behaviour.

Test Coverage

Added missing snapshot tests for: collect_custom_ratios, get_cash_conversion_efficiency, get_effective_tax_rate, get_debt_service_coverage_ratio, get_weighted_dividend_yield, get_reinvestment_rate, get_ev_to_ebit, collect_all_metrics (performance + risk), and get_compound_growth_rate. Updated snapshots for valuation methods affected by the trailing and show_daily axis fixes. Added httpx2 as a dev dependency to resolve StarletteDeprecationWarning in MCP OAuth tests.

MCP Server

Updated MCPB manifest and build script to reflect the latest configuration. Removed conflicting description remarks from the registry and tools model.

Full comparison: v2.1.2...v2.1.3