tesorotools-python 0.0.27__tar.gz → 0.0.28__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/PKG-INFO +1 -1
  2. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/pyproject.toml +1 -1
  3. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/pipeline/engine.py +26 -2
  4. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/.gitignore +0 -0
  5. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/__init__.py +0 -0
  6. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/artists/__init__.py +0 -0
  7. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/artists/barh.md +0 -0
  8. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/artists/barh_plot.py +0 -0
  9. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/artists/line_plot.py +0 -0
  10. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/artists/stacked.py +0 -0
  11. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/artists/table.py +0 -0
  12. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/artists/type_curve.py +0 -0
  13. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/README.md +0 -0
  14. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/fonts/CabinetGrotesk-Black.otf +0 -0
  15. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/fonts/CabinetGrotesk-Bold.otf +0 -0
  16. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/fonts/CabinetGrotesk-Extrabold.otf +0 -0
  17. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/fonts/CabinetGrotesk-Extralight.otf +0 -0
  18. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/fonts/CabinetGrotesk-Light.otf +0 -0
  19. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/fonts/CabinetGrotesk-Medium.otf +0 -0
  20. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/fonts/CabinetGrotesk-Regular.otf +0 -0
  21. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/fonts/CabinetGrotesk-Thin.otf +0 -0
  22. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/fonts/README.md +0 -0
  23. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/plots.yaml +0 -0
  24. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/assets/tesoro.mplstyle +0 -0
  25. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/convert.py +0 -0
  26. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/data_sources/README.md +0 -0
  27. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/data_sources/__init__.py +0 -0
  28. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/data_sources/debug.py +0 -0
  29. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/data_sources/lseg.py +0 -0
  30. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/database/__init__.py +0 -0
  31. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/database/local.py +0 -0
  32. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/database/push.py +0 -0
  33. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/dependencies/__init__.py +0 -0
  34. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/dependencies/node.py +0 -0
  35. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/dependencies/resolution.py +0 -0
  36. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/main.py +0 -0
  37. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/offsets/__init__.py +0 -0
  38. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/offsets/offsets.py +0 -0
  39. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/offsets/outliers.py +0 -0
  40. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/pipeline/__init__.py +0 -0
  41. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/pipeline/diagnose.py +0 -0
  42. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/pipeline/rules.py +0 -0
  43. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/providers/__init__.py +0 -0
  44. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/providers/base.py +0 -0
  45. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/providers/bde.py +0 -0
  46. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/py.typed +0 -0
  47. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/render/__init__.py +0 -0
  48. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/render/content/__init__.py +0 -0
  49. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/render/content/content.py +0 -0
  50. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/render/content/images.py +0 -0
  51. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/render/content/section.py +0 -0
  52. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/render/content/subtitle.py +0 -0
  53. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/render/content/table.py +0 -0
  54. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/render/content/text.py +0 -0
  55. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/render/content/title.py +0 -0
  56. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/render/report.py +0 -0
  57. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/utils/__init__.py +0 -0
  58. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/utils/config.py +0 -0
  59. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/utils/format.py +0 -0
  60. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/utils/globals.py +0 -0
  61. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/utils/matplotlib.py +0 -0
  62. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/utils/series.py +0 -0
  63. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/utils/shortcuts.py +0 -0
  64. {tesorotools_python-0.0.27 → tesorotools_python-0.0.28}/src/tesorotools/utils/template.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tesorotools-python
3
- Version: 0.0.27
3
+ Version: 0.0.28
4
4
  Requires-Python: >=3.13
5
5
  Requires-Dist: babel>=2.17
6
6
  Requires-Dist: eikon>=1.1
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "tesorotools-python"
3
3
  requires-python = ">=3.13"
4
- version = "0.0.27"
4
+ version = "0.0.28"
5
5
  dependencies = [
6
6
  # database and ORM
7
7
  "psycopg[binary]>=3.1",
@@ -51,6 +51,12 @@ def apply_transformations(
51
51
  ) -> pd.DataFrame:
52
52
  """Apply rules sequentially to a DataFrame.
53
53
 
54
+ New columns are accumulated in a dict and merged into
55
+ *result* only when a later rule reads from them (or at
56
+ the end). This avoids per-rule fragmentation of the
57
+ DataFrame and pandas' ``PerformanceWarning`` when many
58
+ rules (100+) are applied.
59
+
54
60
  Parameters
55
61
  ----------
56
62
  df
@@ -64,8 +70,10 @@ def apply_transformations(
64
70
  Copy of *df* with new columns added by the rules.
65
71
  """
66
72
  result = df.copy()
73
+ pending: dict[str, pd.Series[float]] = {}
67
74
  for rule in rules:
68
- missing = [d for d in rule.dependencies if d not in result.columns]
75
+ available = set(result.columns) | set(pending)
76
+ missing = [d for d in rule.dependencies if d not in available]
69
77
  if missing:
70
78
  logger.warning(
71
79
  "Skipping %s: missing dependencies %s",
@@ -73,5 +81,21 @@ def apply_transformations(
73
81
  missing,
74
82
  )
75
83
  continue
76
- result[rule.output_name] = rule.compute(result)
84
+ # rule.compute() reads from result; flush pending
85
+ # into result if this rule needs any pending column.
86
+ if any(d in pending for d in rule.dependencies):
87
+ result = pd.concat(
88
+ [
89
+ result,
90
+ pd.DataFrame(pending, index=result.index),
91
+ ],
92
+ axis=1,
93
+ )
94
+ pending = {}
95
+ pending[rule.output_name] = rule.compute(result)
96
+ if pending:
97
+ result = pd.concat(
98
+ [result, pd.DataFrame(pending, index=result.index)],
99
+ axis=1,
100
+ )
77
101
  return result