tesorotools-python 0.1.11__tar.gz → 0.1.13__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 (181) hide show
  1. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/PKG-INFO +1 -1
  2. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/__init__.py +40 -3
  3. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/_registry.py +56 -0
  4. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/__init__.py +27 -1
  5. tesorotools_python-0.1.13/src/tesorotools/artists/_bars.py +231 -0
  6. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/_common.py +322 -49
  7. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/_dates.py +12 -5
  8. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/bar_line.py +145 -42
  9. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/barh_plot.py +144 -26
  10. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/box_plot.py +3 -0
  11. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/intraday_plot.py +11 -4
  12. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/line_plot.py +235 -96
  13. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/matrix.py +5 -2
  14. tesorotools_python-0.1.13/src/tesorotools/artists/names.py +129 -0
  15. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/plotly_backend.py +101 -28
  16. tesorotools_python-0.1.13/src/tesorotools/artists/review.py +424 -0
  17. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/sankey.py +5 -2
  18. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/scatter.py +13 -7
  19. tesorotools_python-0.1.13/src/tesorotools/artists/sharing.py +306 -0
  20. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/shock_plot.py +4 -0
  21. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/stacked.py +129 -44
  22. tesorotools_python-0.1.13/src/tesorotools/artists/type_curve.py +497 -0
  23. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/vector_plot.py +13 -10
  24. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/waterfall.py +126 -57
  25. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/plots.yaml +48 -8
  26. tesorotools_python-0.1.13/src/tesorotools/dates.py +165 -0
  27. tesorotools_python-0.1.13/src/tesorotools/extend.py +188 -0
  28. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/builder.py +2 -5
  29. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/charts.py +15 -2
  30. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/lint.py +7 -4
  31. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/markdown.py +106 -22
  32. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/skill/SKILL.md +4 -3
  33. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/pipeline/engine.py +21 -11
  34. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/pipeline/rules.py +155 -4
  35. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/__init__.py +42 -0
  36. tesorotools_python-0.1.13/src/tesorotools/presentation/builder.py +5951 -0
  37. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/charts.py +14 -3
  38. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/cli.py +101 -12
  39. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/fit.py +29 -1
  40. tesorotools_python-0.1.13/src/tesorotools/presentation/fonts.py +260 -0
  41. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/house.py +255 -62
  42. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/lint.py +279 -14
  43. tesorotools_python-0.1.13/src/tesorotools/presentation/markdown.py +2615 -0
  44. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/native.py +12 -15
  45. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/skeleton.md +1 -1
  46. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/skill/SKILL.md +284 -51
  47. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/skill/reglas.md +3 -3
  48. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/template.py +4 -2
  49. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/content/images.py +34 -0
  50. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/content/section.py +4 -0
  51. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/content/subtitle.py +11 -0
  52. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/content/table.py +19 -0
  53. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/content/text.py +4 -0
  54. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/content/title.py +8 -0
  55. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/report.py +8 -0
  56. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/utils/matplotlib.py +53 -1
  57. tesorotools_python-0.1.13/src/tesorotools/utils/template.py +397 -0
  58. tesorotools_python-0.1.11/src/tesorotools/artists/sharing.py +0 -59
  59. tesorotools_python-0.1.11/src/tesorotools/artists/type_curve.py +0 -346
  60. tesorotools_python-0.1.11/src/tesorotools/presentation/builder.py +0 -2535
  61. tesorotools_python-0.1.11/src/tesorotools/presentation/markdown.py +0 -1379
  62. tesorotools_python-0.1.11/src/tesorotools/utils/template.py +0 -132
  63. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/.gitignore +0 -0
  64. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/pyproject.toml +0 -0
  65. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/_build_context.py +0 -0
  66. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/compact.py +0 -0
  67. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/artists/tikz_backend.py +0 -0
  68. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/README.md +0 -0
  69. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/fonts/CabinetGrotesk-Black.otf +0 -0
  70. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/fonts/CabinetGrotesk-Bold.otf +0 -0
  71. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/fonts/CabinetGrotesk-Extrabold.otf +0 -0
  72. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/fonts/CabinetGrotesk-Extralight.otf +0 -0
  73. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/fonts/CabinetGrotesk-Light.otf +0 -0
  74. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/fonts/CabinetGrotesk-Medium.otf +0 -0
  75. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/fonts/CabinetGrotesk-Regular.otf +0 -0
  76. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/fonts/CabinetGrotesk-Thin.otf +0 -0
  77. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/fonts/README.md +0 -0
  78. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/nota_template.dotx +0 -0
  79. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/template.docx +0 -0
  80. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/assets/tesoro.mplstyle +0 -0
  81. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/data_sources/__init__.py +0 -0
  82. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/data_sources/debug.py +0 -0
  83. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/database/__init__.py +0 -0
  84. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/database/local.py +0 -0
  85. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/database/push.py +0 -0
  86. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/database/shared.py +0 -0
  87. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/dependencies/__init__.py +0 -0
  88. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/dependencies/node.py +0 -0
  89. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/dependencies/resolution.py +0 -0
  90. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/driver.py +0 -0
  91. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/__init__.py +0 -0
  92. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/cli.py +0 -0
  93. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/scaffold.py +0 -0
  94. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/article/main.tex.tmpl +0 -0
  95. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/article/sections/01-introduccion.tex +0 -0
  96. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/article/sections/02-analisis.tex +0 -0
  97. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/article/sections/03-conclusiones.tex +0 -0
  98. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/beamer/main.tex.tmpl +0 -0
  99. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/beamer/slides/01-contexto.tex +0 -0
  100. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/beamer/slides/02-analisis.tex +0 -0
  101. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/beamer/slides/03-conclusiones.tex +0 -0
  102. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/beamer/style/beamerthemeTesoro.sty +0 -0
  103. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/book/appendices/a-fuentes.tex +0 -0
  104. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/book/chapters/01-introduccion.tex +0 -0
  105. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/book/chapters/02-analisis.tex +0 -0
  106. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/book/frontmatter/resumen.tex +0 -0
  107. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/book/main.tex.tmpl +0 -0
  108. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/common/README.md.tmpl +0 -0
  109. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/common/dot-gitignore +0 -0
  110. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/common/dot-vscode/settings.json +0 -0
  111. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/common/figures/dot-gitkeep +0 -0
  112. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/common/fonts/README.md +0 -0
  113. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/common/latexmkrc +0 -0
  114. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/common/refs.bib +0 -0
  115. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/common/style/tesoro.sty +0 -0
  116. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/common/style/tesorobrand.sty.tmpl +0 -0
  117. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/latex/templates/common/style/tesorolocal.sty.tmpl +0 -0
  118. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/manifest.py +0 -0
  119. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/__init__.py +0 -0
  120. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/cli.py +0 -0
  121. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/inline.py +0 -0
  122. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/issues.py +0 -0
  123. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/pdf.py +0 -0
  124. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/skeleton.md +0 -0
  125. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/skill/reglas.md +0 -0
  126. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/note/template.py +0 -0
  127. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/offsets/__init__.py +0 -0
  128. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/offsets/offsets.py +0 -0
  129. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/offsets/outliers.py +0 -0
  130. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/orchestration.py +0 -0
  131. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/palette.py +0 -0
  132. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/pipeline/__init__.py +0 -0
  133. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/pipeline/diagnose.py +0 -0
  134. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/glossary.py +0 -0
  135. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/pdf.py +0 -0
  136. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/presentation/sections.py +0 -0
  137. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/providers/__init__.py +0 -0
  138. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/providers/base.py +0 -0
  139. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/providers/bde.py +0 -0
  140. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/providers/ecb.py +0 -0
  141. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/providers/fred.py +0 -0
  142. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/providers/imf_irfcl.py +0 -0
  143. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/providers/lseg.py +0 -0
  144. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/py.typed +0 -0
  145. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/__init__.py +0 -0
  146. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/content/__init__.py +0 -0
  147. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/content/content.py +0 -0
  148. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/render/document.py +0 -0
  149. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/scaffold.py +0 -0
  150. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/testing/__init__.py +0 -0
  151. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/testing/compare.py +0 -0
  152. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/utils/__init__.py +0 -0
  153. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/utils/config.py +0 -0
  154. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/utils/format.py +0 -0
  155. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/utils/globals.py +0 -0
  156. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/utils/series.py +0 -0
  157. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/utils/shortcuts.py +0 -0
  158. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/__init__.py +0 -0
  159. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/app.py +0 -0
  160. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/brand.py +0 -0
  161. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/cli.py +0 -0
  162. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/components.py +0 -0
  163. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/formatting.py +0 -0
  164. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/launcher.py +0 -0
  165. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/palette.py +0 -0
  166. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/period.py +0 -0
  167. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/plotting.py +0 -0
  168. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/scaffold.py +0 -0
  169. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/Dockerfile.tmpl +0 -0
  170. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/README.md.tmpl +0 -0
  171. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/dot-dockerignore.tmpl +0 -0
  172. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/dot-gitignore.tmpl +0 -0
  173. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/dot-streamlit/config.toml.tmpl +0 -0
  174. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/pyproject.toml.tmpl +0 -0
  175. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/src/$package/__init__.py.tmpl +0 -0
  176. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/src/$package/cli.py.tmpl +0 -0
  177. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/src/$package/main.py.tmpl +0 -0
  178. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/src/$package/sections.py.tmpl +0 -0
  179. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/tests/__init__.py.tmpl +0 -0
  180. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/templates/tests/test_app.py.tmpl +0 -0
  181. {tesorotools_python-0.1.11 → tesorotools_python-0.1.13}/src/tesorotools/web/theme.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tesorotools-python
3
- Version: 0.1.11
3
+ Version: 0.1.13
4
4
  Requires-Python: >=3.13
5
5
  Requires-Dist: babel>=2.17
6
6
  Requires-Dist: matplotlib>=3.10
@@ -14,11 +14,16 @@ requires ``[lseg]``) are exposed lazily through
14
14
  extras to be installed.
15
15
 
16
16
  Third parties extend the package via ``register_artist``,
17
- ``register_tag``, and ``register_provider`` (and their
18
- plural variants). See ``docs/extending.md`` for the
19
- recommended idioms.
17
+ ``register_tag``, ``register_provider`` and ``register_rule``
18
+ (and their plural variants), with the building blocks of
19
+ :mod:`tesorotools.extend`; installed packages that declare a
20
+ ``tesorotools.extensions`` entry point are loaded on import
21
+ (:func:`load_extensions`). See ``docs/extending.md`` for the
22
+ recommended idioms and ``docs/estabilidad.md`` for what is
23
+ public.
20
24
  """
21
25
 
26
+ import os
22
27
  from importlib.metadata import PackageNotFoundError, version
23
28
  from typing import TYPE_CHECKING, Any
24
29
 
@@ -40,6 +45,7 @@ if TYPE_CHECKING:
40
45
  from tesorotools._build_context import BuildContext
41
46
  from tesorotools._registry import (
42
47
  Artist,
48
+ NO_EXTENSIONS_ENV,
43
49
  YamlConstructor,
44
50
  all_artists,
45
51
  all_providers,
@@ -49,6 +55,8 @@ from tesorotools._registry import (
49
55
  iter_artists,
50
56
  iter_providers,
51
57
  iter_tags,
58
+ load_extensions,
59
+ loaded_extensions,
52
60
  register_artist,
53
61
  register_artists,
54
62
  register_provider,
@@ -77,6 +85,14 @@ from tesorotools.artists import (
77
85
  share_y_axes,
78
86
  )
79
87
  from tesorotools.orchestration import CompositeRegistry, iter_contexts
88
+ from tesorotools.pipeline.rules import (
89
+ RuleParam,
90
+ RuleSpec,
91
+ build_rule,
92
+ describe_rule,
93
+ describe_rules,
94
+ register_rule,
95
+ )
80
96
  from tesorotools.providers.base import (
81
97
  DataProvider,
82
98
  RegistryProtocol,
@@ -94,6 +110,12 @@ from tesorotools.render import (
94
110
  Title,
95
111
  new_document,
96
112
  )
113
+ from tesorotools.utils.template import (
114
+ Tagged,
115
+ TemplateDumper,
116
+ TemplateLoader,
117
+ dump_template,
118
+ )
97
119
 
98
120
 
99
121
  def _register_builtins() -> None:
@@ -127,6 +149,9 @@ def _register_builtins() -> None:
127
149
 
128
150
  _register_builtins()
129
151
 
152
+ if os.environ.get(NO_EXTENSIONS_ENV) != "1":
153
+ load_extensions()
154
+
130
155
 
131
156
  __all__ = [
132
157
  "__version__",
@@ -161,6 +186,9 @@ __all__ = [
161
186
  "StackedBarPlot",
162
187
  "Subtitle",
163
188
  "Table",
189
+ "Tagged",
190
+ "TemplateDumper",
191
+ "TemplateLoader",
164
192
  "Text",
165
193
  "Title",
166
194
  "TypeCurve",
@@ -171,6 +199,7 @@ __all__ = [
171
199
  "all_providers",
172
200
  "all_tags",
173
201
  "bootstrap_providers",
202
+ "dump_template",
174
203
  "get_artist",
175
204
  "get_provider",
176
205
  "iter_artists",
@@ -185,6 +214,14 @@ __all__ = [
185
214
  "register_tag",
186
215
  "register_tags",
187
216
  "share_y_axes",
217
+ "RuleParam",
218
+ "RuleSpec",
219
+ "build_rule",
220
+ "describe_rule",
221
+ "describe_rules",
222
+ "load_extensions",
223
+ "loaded_extensions",
224
+ "register_rule",
188
225
  ]
189
226
 
190
227
 
@@ -39,7 +39,9 @@ import the private dictionaries.
39
39
 
40
40
  from __future__ import annotations
41
41
 
42
+ import warnings
42
43
  from collections.abc import Iterator, Mapping
44
+ from importlib.metadata import entry_points
43
45
  from typing import Any, Callable, Literal, Protocol, Self, cast, overload
44
46
 
45
47
  from yaml.nodes import MappingNode
@@ -236,3 +238,57 @@ def iter_tags() -> Iterator[tuple[str, YamlConstructor]]:
236
238
  def all_tags() -> dict[str, YamlConstructor]:
237
239
  """Return a snapshot dict of every registered ``!`` YAML tag."""
238
240
  return dict(iter_tags())
241
+
242
+
243
+ # ----------------------------------------------------------------------
244
+ # Extensions declared by installed packages
245
+ # ----------------------------------------------------------------------
246
+
247
+ #: Entry point group of the packages that extend tesorotools.
248
+ EXTENSIONS_GROUP = "tesorotools.extensions"
249
+ #: Set it to ``1`` to import tesorotools without loading extensions.
250
+ NO_EXTENSIONS_ENV = "TESOROTOOLS_NO_EXTENSIONS"
251
+ _LOADED_EXTENSIONS: dict[str, str] = {}
252
+
253
+
254
+ def load_extensions(group: str = EXTENSIONS_GROUP) -> dict[str, str]:
255
+ """Load the extensions that installed packages declare.
256
+
257
+ A package declares one in its ``pyproject.toml``::
258
+
259
+ [project.entry-points."tesorotools.extensions"]
260
+ mi_extension = "mi_paquete.extension:install"
261
+
262
+ and ``install()`` registers its artists, tags, providers and rules.
263
+ An entry point may also name a module, whose import registers them.
264
+ ``import tesorotools`` calls this once (unless the environment
265
+ variable ``TESOROTOOLS_NO_EXTENSIONS`` is ``1``), so the extension
266
+ works from the command line, a project or a server alike.
267
+
268
+ An extension that fails is skipped with a :class:`RuntimeWarning`
269
+ naming it, and never stops tesorotools from loading. Returns every
270
+ extension loaded so far, by name, with its ``"module:attr"``; a
271
+ name already loaded is not loaded twice.
272
+ """
273
+ for point in entry_points(group=group):
274
+ if point.name in _LOADED_EXTENSIONS:
275
+ continue
276
+ try:
277
+ target = point.load()
278
+ if callable(target):
279
+ target()
280
+ except Exception as error: # noqa: BLE001 - never break the import
281
+ warnings.warn(
282
+ f"tesorotools extension {point.name!r} ({point.value}) "
283
+ f"failed to load: {type(error).__name__}: {error}",
284
+ RuntimeWarning,
285
+ stacklevel=2,
286
+ )
287
+ continue
288
+ _LOADED_EXTENSIONS[point.name] = point.value
289
+ return dict(_LOADED_EXTENSIONS)
290
+
291
+
292
+ def loaded_extensions() -> dict[str, str]:
293
+ """The extensions loaded so far, by name, with their ``module:attr``."""
294
+ return dict(_LOADED_EXTENSIONS)
@@ -20,6 +20,9 @@ Each class follows the same shape:
20
20
  Plotly figure (all but ``IntradayPlot``);
21
21
  :func:`plotly_unsupported` lists the keys it drops.
22
22
 
23
+ :func:`data_issues` reviews the data of a chart (too many series or
24
+ bars, mixed magnitudes, gaps) and returns ``Issue`` warnings.
25
+
23
26
  :func:`share_y_axes` gives the charts that declare the same
24
27
  ``y_group`` one common y scale.
25
28
 
@@ -45,9 +48,22 @@ from tesorotools.artists.box_plot import BoxPlot
45
48
  from tesorotools.artists.intraday_plot import IntradayPlot
46
49
  from tesorotools.artists.line_plot import LinePlot
47
50
  from tesorotools.artists.matrix import MatrixChart
51
+ from tesorotools.artists.names import (
52
+ KIND_NAMES,
53
+ KindName,
54
+ kind_from_name,
55
+ native_kind,
56
+ spanish_name,
57
+ )
58
+ from tesorotools.artists.review import ReviewLimits, data_issues
48
59
  from tesorotools.artists.sankey import SankeyPlot
49
60
  from tesorotools.artists.scatter import ScatterPlot
50
- from tesorotools.artists.sharing import share_y_axes
61
+ from tesorotools.artists.sharing import (
62
+ align_plot_areas,
63
+ draw_together,
64
+ equal_axis_decimals,
65
+ share_y_axes,
66
+ )
51
67
  from tesorotools.artists.shock_plot import ShockChart
52
68
  from tesorotools.artists.stacked import StackedAreaPlot, StackedBarPlot
53
69
  from tesorotools.artists.type_curve import TypeCurve
@@ -55,6 +71,7 @@ from tesorotools.artists.vector_plot import VectorPlot
55
71
  from tesorotools.artists.waterfall import Waterfall
56
72
 
57
73
  __all__ = [
74
+ "KIND_NAMES",
58
75
  "Artist",
59
76
  "BarLinePlot",
60
77
  "BoxPlot",
@@ -63,9 +80,11 @@ __all__ = [
63
80
  "GroupedBarChart",
64
81
  "HorizontalBarChart",
65
82
  "IntradayPlot",
83
+ "KindName",
66
84
  "Legend",
67
85
  "LinePlot",
68
86
  "MatrixChart",
87
+ "ReviewLimits",
69
88
  "SankeyPlot",
70
89
  "ScatterPlot",
71
90
  "ShockChart",
@@ -74,6 +93,13 @@ __all__ = [
74
93
  "TypeCurve",
75
94
  "VectorPlot",
76
95
  "Waterfall",
96
+ "align_plot_areas",
97
+ "draw_together",
98
+ "equal_axis_decimals",
99
+ "kind_from_name",
100
+ "native_kind",
101
+ "data_issues",
77
102
  "plotly_unsupported",
78
103
  "share_y_axes",
104
+ "spanish_name",
79
105
  ]
@@ -0,0 +1,231 @@
1
+ """Category x-axes of the vertical bar charts: labels that never collide.
2
+
3
+ Shared by :class:`~tesorotools.artists.stacked.StackedBarPlot`,
4
+ :class:`~tesorotools.artists.bar_line.BarLinePlot` and
5
+ :class:`~tesorotools.artists.waterfall.Waterfall`, whose bars sit one per
6
+ slot (``np.arange``) rather than on a date axis. A dated slot axis is
7
+ labelled on the calendar grid of :mod:`tesorotools.artists._dates` (every
8
+ year, quarter or month boundary that fits), and any label row turns only
9
+ when it does not fit flat. Measured on the drawn figure, like the date
10
+ axes of :mod:`tesorotools.artists._common`.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ from collections.abc import Callable, Sequence
16
+ from typing import Any
17
+
18
+ import pandas as pd
19
+ from matplotlib.axes import Axes
20
+ from matplotlib.figure import Figure
21
+ from matplotlib.text import Text
22
+
23
+ from tesorotools.artists._common import (
24
+ COMPACT_CONFIG,
25
+ LINE_CONFIG,
26
+ date_max_labels,
27
+ )
28
+ from tesorotools.artists._dates import (
29
+ data_frequency,
30
+ date_layouts,
31
+ month_label,
32
+ quarter_label,
33
+ )
34
+ from tesorotools.utils.matplotlib import PLOT_CONFIG
35
+
36
+ __all__ = [
37
+ "bar_date_ticks",
38
+ "fit_x_rotation",
39
+ "labels_collide",
40
+ ]
41
+
42
+ BAR_AXIS_CONFIG: dict[str, Any] = PLOT_CONFIG.get("bar_axis", {})
43
+
44
+ # label texts tried, coarsest first, when no calendar step suits the
45
+ # bars (a few weeks of daily data): the first one that tells them apart.
46
+ # The house forms of the date axes: 2024, mar. 2024, 4 mar., 4 mar. 2024
47
+ _FALLBACK_LABELS: tuple[Callable[[pd.Timestamp], str], ...] = (
48
+ lambda moment: str(moment.year),
49
+ lambda moment: month_label(moment, year=True),
50
+ lambda moment: f"{moment.day} {month_label(moment)}",
51
+ lambda moment: f"{moment.day} {month_label(moment, year=True)}",
52
+ )
53
+
54
+ #: The calendar steps finer than a frequency, which would name each bar
55
+ #: by a month it only ends in (``dic.`` under a yearly bar).
56
+ _TOO_FINE: dict[str, tuple[str, ...]] = {
57
+ "Y": ("1M", "2M", "3M", "6M"),
58
+ "Q": ("1M", "2M"),
59
+ }
60
+
61
+
62
+ def _gap_px(fig: Figure, texts: Sequence[Text], *, compact: bool) -> float:
63
+ """The air two neighbour labels need, ``date_label_gap_em`` of their size."""
64
+ cfg = COMPACT_CONFIG if compact else LINE_CONFIG
65
+ em = float(cfg.get("date_label_gap_em", 0.3))
66
+ size = max(float(t.get_fontsize()) for t in texts)
67
+ return em * size * fig.dpi / 72
68
+
69
+
70
+ def labels_collide(
71
+ fig: Figure, texts: Sequence[Text], *, compact: bool = False
72
+ ) -> bool:
73
+ """Whether two neighbouring *texts*, left to right, overlap or touch.
74
+
75
+ Empty texts are skipped; the gap two labels need is the date axes'
76
+ ``date_label_gap_em`` (``compact.`` or ``line.`` in ``plots.yaml``).
77
+ """
78
+ shown = [t for t in texts if t.get_visible() and t.get_text()]
79
+ if len(shown) < 2:
80
+ return False
81
+ fig.draw_without_rendering()
82
+ gap = _gap_px(fig, shown, compact=compact)
83
+ boxes = sorted((t.get_window_extent() for t in shown), key=lambda b: b.x0)
84
+ return any(
85
+ a.x1 + gap > b.x0 and a.y0 < b.y1 and b.y0 < a.y1
86
+ for a, b in zip(boxes, boxes[1:])
87
+ )
88
+
89
+
90
+ def _set_rotation(ax: Axes, rotation: float) -> None:
91
+ for label in ax.get_xticklabels():
92
+ label.set_rotation(rotation)
93
+ label.set_horizontalalignment("right" if rotation else "center")
94
+ label.set_rotation_mode("anchor" if rotation else "default")
95
+
96
+
97
+ def fit_x_rotation(
98
+ fig: Figure, ax: Axes, rotation: float | None, *, compact: bool = False
99
+ ) -> None:
100
+ """Turn the x labels only when they do not fit flat.
101
+
102
+ ``rotation=None`` (auto) leaves the labels horizontal unless two of
103
+ them collide, and then turns them ``bar_axis.x_rotation`` degrees
104
+ (``plots.yaml``); an explicit *rotation* is applied as given.
105
+ """
106
+ if rotation is None:
107
+ _set_rotation(ax, 0)
108
+ if not labels_collide(fig, ax.get_xticklabels(), compact=compact):
109
+ return
110
+ rotation = float(BAR_AXIS_CONFIG.get("x_rotation", 45))
111
+ _set_rotation(ax, rotation)
112
+
113
+
114
+ def _calendar_slots(
115
+ dates: pd.DatetimeIndex,
116
+ step: str,
117
+ ticks: Sequence[pd.Timestamp],
118
+ frequency: str = "M",
119
+ ) -> tuple[list[int], list[str]]:
120
+ """The first bar of each period of *step* that starts at a tick.
121
+
122
+ A period with no bar of its own (a gap in the data) gets no label, so
123
+ a label always names the bar under it and no two labels repeat. The
124
+ labels read as on the date axes of the line charts: the year where
125
+ a year starts, else the month (``mar.``), the first one with its year
126
+ (``may. 2024``). Quarterly bars (*frequency* ``"Q"``) on a month
127
+ step name their quarter instead, with its year on the first label and
128
+ on every first quarter (``1T 2024``, ``2T``, ``3T``).
129
+ """
130
+ n = int(step[:-1])
131
+ span = (
132
+ pd.DateOffset(years=n)
133
+ if step.endswith("Y")
134
+ else pd.DateOffset(months=n)
135
+ )
136
+ positions: list[int] = []
137
+ texts: list[str] = []
138
+ for tick in ticks:
139
+ i = int(dates.searchsorted(tick))
140
+ if i < len(dates) and dates[i] < tick + span:
141
+ positions.append(i)
142
+ # the year on a year step and where a year starts, as the
143
+ # date axes do; the first month carries its year too
144
+ if step.endswith("Y"):
145
+ texts.append(str(dates[i].year))
146
+ elif frequency == "Q":
147
+ texts.append(
148
+ quarter_label(
149
+ dates[i], year=not texts or dates[i].quarter == 1
150
+ )
151
+ )
152
+ elif tick.month == 1:
153
+ texts.append(str(dates[i].year))
154
+ else:
155
+ texts.append(month_label(dates[i], year=not texts))
156
+ return positions, texts
157
+
158
+
159
+ def _fallback_slots(
160
+ dates: pd.DatetimeIndex, every: int
161
+ ) -> tuple[list[int], list[str]]:
162
+ """Every *every*-th bar, in the coarsest format that tells them apart."""
163
+ positions = list(range(0, len(dates), every))
164
+ rows = [[label(dates[i]) for i in positions] for label in _FALLBACK_LABELS]
165
+ return positions, next(
166
+ (texts for texts in rows if len(set(texts)) == len(texts)), rows[-1]
167
+ )
168
+
169
+
170
+ def bar_date_ticks(
171
+ fig: Figure,
172
+ ax: Axes,
173
+ dates: pd.DatetimeIndex,
174
+ *,
175
+ compact: bool = False,
176
+ rotation: float | None = None,
177
+ pin_start: bool = True,
178
+ ) -> None:
179
+ """Label one bar per calendar period, as many periods as fit.
180
+
181
+ The candidates are the calendar steps of the date axes (every year,
182
+ every 2, 5... years and, over spans up to ``date_monthly_max_months``,
183
+ every month or quarter), finest first, none finer than the bars
184
+ themselves (:func:`~tesorotools.artists._dates.data_frequency`):
185
+ yearly bars read ``2023 2024 2025`` and not ``dic. 2023 dic. dic.``,
186
+ quarterly ones ``1T 2024 2T 3T`` (over up to three times
187
+ ``date_monthly_max_months``); each labels the first bar of
188
+ its period, and the finest whose labels fit across the axis (at
189
+ *rotation*, flat when ``None``) and stay within the mode's
190
+ ``date_max_labels`` wins. When no calendar step suits the span, every
191
+ k-th bar is labelled instead, k as small as fits. With *pin_start*
192
+ the first bar is labelled too (its year, or month), as the date axes
193
+ of ``date_show_start`` do, so the reader sees when the series starts.
194
+ """
195
+ cfg = COMPACT_CONFIG if compact else LINE_CONFIG
196
+ frequency = data_frequency(dates)
197
+ # a quarter is a third of the bars a month gives over the same span:
198
+ # quarterly bars name their quarters over three times the span
199
+ months = int(cfg.get("date_monthly_max_months", 24))
200
+ layouts = date_layouts(
201
+ dates.min(),
202
+ dates.max(),
203
+ step="auto",
204
+ max_labels=date_max_labels("default", compact=compact),
205
+ monthly_max_months=months * (3 if frequency == "Q" else 1),
206
+ pin_start=pin_start,
207
+ )
208
+ too_fine = _TOO_FINE.get(frequency, ())
209
+ candidates = [
210
+ _calendar_slots(dates, layout.step, layout.ticks, frequency)
211
+ for layout in layouts
212
+ if layout.step not in too_fine
213
+ ]
214
+ candidates = [c for c in candidates if len(c[0]) >= 2]
215
+ # no calendar step suits the span, or none fits: every k-th bar, from
216
+ # the k that keeps within the label count up to a single label
217
+ most = date_max_labels("default", compact=compact)
218
+ first = max(1, -(-len(dates) // most)) # ceil
219
+ candidates += [
220
+ _fallback_slots(dates, every) for every in range(first, len(dates) + 1)
221
+ ]
222
+ for positions, texts in candidates:
223
+ ax.set_xticks( # type: ignore[reportUnknownMemberType]
224
+ positions
225
+ )
226
+ ax.set_xticklabels( # type: ignore[reportUnknownMemberType]
227
+ texts
228
+ )
229
+ _set_rotation(ax, rotation or 0)
230
+ if not labels_collide(fig, ax.get_xticklabels(), compact=compact):
231
+ return