tesorotools-python 0.1.8__tar.gz → 0.1.10__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.
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/.gitignore +2 -1
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/PKG-INFO +1 -1
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/_common.py +36 -7
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/box_plot.py +2 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/lint.py +28 -10
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/palette.py +2 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/presentation/__init__.py +28 -1
- tesorotools_python-0.1.10/src/tesorotools/presentation/builder.py +2172 -0
- tesorotools_python-0.1.10/src/tesorotools/presentation/charts.py +109 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/presentation/cli.py +3 -5
- tesorotools_python-0.1.10/src/tesorotools/presentation/fit.py +147 -0
- tesorotools_python-0.1.10/src/tesorotools/presentation/glossary.py +154 -0
- tesorotools_python-0.1.10/src/tesorotools/presentation/lint.py +790 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/presentation/markdown.py +450 -45
- tesorotools_python-0.1.10/src/tesorotools/presentation/native.py +275 -0
- tesorotools_python-0.1.10/src/tesorotools/presentation/sections.py +71 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/presentation/skeleton.md +2 -2
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/presentation/skill/SKILL.md +157 -30
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/presentation/skill/reglas.md +5 -3
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/__init__.py +10 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/app.py +171 -1
- tesorotools_python-0.1.10/src/tesorotools/web/period.py +220 -0
- tesorotools_python-0.1.8/src/tesorotools/presentation/builder.py +0 -1175
- tesorotools_python-0.1.8/src/tesorotools/presentation/charts.py +0 -61
- tesorotools_python-0.1.8/src/tesorotools/presentation/lint.py +0 -183
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/pyproject.toml +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/_build_context.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/_registry.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/_dates.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/bar_line.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/barh_plot.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/compact.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/intraday_plot.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/line_plot.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/matrix.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/plotly_backend.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/sankey.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/scatter.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/sharing.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/shock_plot.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/stacked.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/tikz_backend.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/type_curve.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/vector_plot.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/artists/waterfall.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/README.md +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/fonts/CabinetGrotesk-Black.otf +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/fonts/CabinetGrotesk-Bold.otf +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/fonts/CabinetGrotesk-Extrabold.otf +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/fonts/CabinetGrotesk-Extralight.otf +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/fonts/CabinetGrotesk-Light.otf +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/fonts/CabinetGrotesk-Medium.otf +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/fonts/CabinetGrotesk-Regular.otf +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/fonts/CabinetGrotesk-Thin.otf +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/fonts/README.md +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/nota_template.dotx +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/plots.yaml +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/template.docx +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/assets/tesoro.mplstyle +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/data_sources/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/data_sources/debug.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/database/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/database/local.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/database/push.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/database/shared.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/dependencies/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/dependencies/node.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/dependencies/resolution.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/driver.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/cli.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/scaffold.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/article/main.tex.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/article/sections/01-introduccion.tex +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/article/sections/02-analisis.tex +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/article/sections/03-conclusiones.tex +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/beamer/main.tex.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/beamer/slides/01-contexto.tex +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/beamer/slides/02-analisis.tex +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/beamer/slides/03-conclusiones.tex +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/beamer/style/beamerthemeTesoro.sty +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/book/appendices/a-fuentes.tex +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/book/chapters/01-introduccion.tex +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/book/chapters/02-analisis.tex +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/book/frontmatter/resumen.tex +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/book/main.tex.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/common/README.md.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/common/dot-gitignore +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/common/dot-vscode/settings.json +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/common/figures/dot-gitkeep +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/common/fonts/README.md +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/common/latexmkrc +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/common/refs.bib +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/common/style/tesoro.sty +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/common/style/tesorobrand.sty.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/latex/templates/common/style/tesorolocal.sty.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/manifest.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/builder.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/charts.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/cli.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/inline.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/issues.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/markdown.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/pdf.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/skeleton.md +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/skill/SKILL.md +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/skill/reglas.md +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/note/template.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/offsets/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/offsets/offsets.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/offsets/outliers.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/orchestration.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/pipeline/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/pipeline/diagnose.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/pipeline/engine.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/pipeline/rules.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/presentation/house.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/presentation/pdf.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/presentation/template.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/providers/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/providers/base.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/providers/bde.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/providers/ecb.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/providers/fred.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/providers/imf_irfcl.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/providers/lseg.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/py.typed +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/content/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/content/content.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/content/images.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/content/section.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/content/subtitle.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/content/table.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/content/text.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/content/title.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/document.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/render/report.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/scaffold.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/testing/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/testing/compare.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/utils/__init__.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/utils/config.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/utils/format.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/utils/globals.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/utils/matplotlib.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/utils/series.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/utils/shortcuts.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/utils/template.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/brand.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/cli.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/components.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/formatting.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/launcher.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/palette.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/plotting.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/scaffold.py +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/Dockerfile.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/README.md.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/dot-dockerignore.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/dot-gitignore.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/dot-streamlit/config.toml.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/pyproject.toml.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/src/$package/__init__.py.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/src/$package/cli.py.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/src/$package/main.py.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/src/$package/sections.py.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/tests/__init__.py.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/templates/tests/test_app.py.tmpl +0 -0
- {tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/web/theme.py +0 -0
|
@@ -403,9 +403,18 @@ class Legend:
|
|
|
403
403
|
values work in compact and in full-size charts, so a
|
|
404
404
|
compact chart in a Word table can carry its labels under
|
|
405
405
|
the plot when the text above it already reads as a title.
|
|
406
|
+
``font_pt`` fixes the size of the legend text (a slide wants it
|
|
407
|
+
as big as the ticks) and ``min_entries=2`` drops the legend of a
|
|
408
|
+
chart with a single series.
|
|
406
409
|
"""
|
|
407
410
|
|
|
408
|
-
def __init__(
|
|
411
|
+
def __init__(
|
|
412
|
+
self,
|
|
413
|
+
ncol: int | None = None,
|
|
414
|
+
position: str = "auto",
|
|
415
|
+
font_pt: float | None = None,
|
|
416
|
+
min_entries: int = 1,
|
|
417
|
+
) -> None:
|
|
409
418
|
if position not in LEGEND_POSITIONS:
|
|
410
419
|
raise ValueError(
|
|
411
420
|
f"legend position must be one of {LEGEND_POSITIONS}: "
|
|
@@ -413,6 +422,12 @@ class Legend:
|
|
|
413
422
|
)
|
|
414
423
|
self.ncol = ncol
|
|
415
424
|
self.position = position
|
|
425
|
+
#: Size of the legend text (points); ``None`` keeps the house
|
|
426
|
+
#: size (``compact.legend_font_pt``, never above the ticks).
|
|
427
|
+
self.font_pt = font_pt
|
|
428
|
+
#: Fewer entries than this draw no legend: ``2`` leaves a chart
|
|
429
|
+
#: of a single series without one.
|
|
430
|
+
self.min_entries = min_entries
|
|
416
431
|
|
|
417
432
|
@classmethod
|
|
418
433
|
def from_yaml(cls, loader: TemplateLoader, node: MappingNode) -> Self:
|
|
@@ -1562,6 +1577,8 @@ def place_legend(
|
|
|
1562
1577
|
ncol: int | None = None,
|
|
1563
1578
|
position: str = "auto",
|
|
1564
1579
|
entries: tuple[list[Any], list[str]] | None = None,
|
|
1580
|
+
font_pt: float | None = None,
|
|
1581
|
+
min_entries: int = 1,
|
|
1565
1582
|
) -> MplLegend | None:
|
|
1566
1583
|
"""Place the figure legend, compact-aware, from the labelled artists.
|
|
1567
1584
|
|
|
@@ -1575,17 +1592,21 @@ def place_legend(
|
|
|
1575
1592
|
``entries`` passes precomputed ``(handles, labels)`` instead of reading
|
|
1576
1593
|
them off *ax* -- for charts whose series span several axes (a
|
|
1577
1594
|
``twinx`` secondary y-axis), in the order the legend should list them.
|
|
1578
|
-
|
|
1595
|
+
``font_pt`` sets the size of the legend text. Returns ``None``
|
|
1596
|
+
(drawing nothing) when there are no labels, or fewer than
|
|
1597
|
+
``min_entries``.
|
|
1579
1598
|
"""
|
|
1580
1599
|
handles, labels = (
|
|
1581
1600
|
entries if entries is not None else ax.get_legend_handles_labels()
|
|
1582
1601
|
)
|
|
1583
|
-
if not labels:
|
|
1602
|
+
if not labels or len(labels) < min_entries:
|
|
1584
1603
|
return None
|
|
1585
1604
|
side = resolve_legend_position(position, compact=compact)
|
|
1586
1605
|
fig_w_px: float = fig.get_size_inches()[0] * fig.dpi
|
|
1587
1606
|
if compact:
|
|
1588
1607
|
legend_kw = compact_legend_kwargs(ax)
|
|
1608
|
+
if font_pt is not None:
|
|
1609
|
+
legend_kw["fontsize"] = font_pt
|
|
1589
1610
|
if ncol is None:
|
|
1590
1611
|
ncol = auto_ncol(
|
|
1591
1612
|
ax, labels, available_width_px=fig_w_px, **legend_kw
|
|
@@ -1603,8 +1624,12 @@ def place_legend(
|
|
|
1603
1624
|
**legend_kw,
|
|
1604
1625
|
)
|
|
1605
1626
|
if ncol is None:
|
|
1606
|
-
ncol = auto_ncol(
|
|
1607
|
-
|
|
1627
|
+
ncol = auto_ncol(
|
|
1628
|
+
ax, labels, available_width_px=fig_w_px, fontsize=font_pt
|
|
1629
|
+
)
|
|
1630
|
+
return legend_band(
|
|
1631
|
+
ax, handles, labels, ncol=ncol, position=side, fontsize=font_pt
|
|
1632
|
+
)
|
|
1608
1633
|
|
|
1609
1634
|
|
|
1610
1635
|
def legend_layout(legend: Legend | None) -> dict[str, Any]:
|
|
@@ -1620,9 +1645,13 @@ def legend_layout(legend: Legend | None) -> dict[str, Any]:
|
|
|
1620
1645
|
fig, ax, compact=self.compact, **legend_layout(self.legend)
|
|
1621
1646
|
)
|
|
1622
1647
|
"""
|
|
1648
|
+
if legend is None:
|
|
1649
|
+
return {"ncol": None, "position": "auto"}
|
|
1623
1650
|
return {
|
|
1624
|
-
"ncol": legend.ncol
|
|
1625
|
-
"position": legend.position
|
|
1651
|
+
"ncol": legend.ncol,
|
|
1652
|
+
"position": legend.position,
|
|
1653
|
+
"font_pt": legend.font_pt,
|
|
1654
|
+
"min_entries": legend.min_entries,
|
|
1626
1655
|
}
|
|
1627
1656
|
|
|
1628
1657
|
|
|
@@ -500,6 +500,8 @@ class BoxPlot(FigureLifecycle):
|
|
|
500
500
|
)
|
|
501
501
|
if self.compact:
|
|
502
502
|
kw = compact_legend_kwargs(ax)
|
|
503
|
+
if self.legend.font_pt is not None:
|
|
504
|
+
kw["fontsize"] = self.legend.font_pt
|
|
503
505
|
ncol = self.legend.ncol or auto_ncol(
|
|
504
506
|
ax, labels, available_width_px=fig_w_px, **kw
|
|
505
507
|
)
|
|
@@ -17,7 +17,7 @@ from __future__ import annotations
|
|
|
17
17
|
|
|
18
18
|
import re
|
|
19
19
|
import unicodedata
|
|
20
|
-
from collections.abc import Callable, Iterator, Sequence
|
|
20
|
+
from collections.abc import Callable, Collection, Iterable, Iterator, Sequence
|
|
21
21
|
from dataclasses import dataclass
|
|
22
22
|
from pathlib import Path
|
|
23
23
|
|
|
@@ -357,9 +357,9 @@ _RULES: tuple[_Rule, ...] = (
|
|
|
357
357
|
"las siglas no llevan plural gráfico (las IIC, no las IICs)",
|
|
358
358
|
),
|
|
359
359
|
_r(
|
|
360
|
-
r"\b(?:ECB|IMF|BIS|FSB|OECD|ESRB|EIB)\b",
|
|
360
|
+
r"\b(?:ECB|IMF|BIS|FSB|OECD|ESRB|EIB|GDP|CPI)\b",
|
|
361
361
|
"siglas",
|
|
362
|
-
"usa la sigla española (BCE, FMI, BPI, CEF, OCDE, JERS, BEI)",
|
|
362
|
+
"usa la sigla española (BCE, FMI, BPI, CEF, OCDE, JERS, BEI, PIB, IPC)",
|
|
363
363
|
_outside_title,
|
|
364
364
|
"todo",
|
|
365
365
|
),
|
|
@@ -560,10 +560,18 @@ def _scope_texts(text: str, scope: str) -> Iterator[_Rule]:
|
|
|
560
560
|
_CROSS_REF = re.compile(r"\[@[^\]]*\]")
|
|
561
561
|
|
|
562
562
|
|
|
563
|
-
def _text_issues(
|
|
564
|
-
|
|
563
|
+
def _text_issues(
|
|
564
|
+
line: int, text: str, scope: str, only: Collection[str] | None = None
|
|
565
|
+
) -> Iterator[Issue]:
|
|
566
|
+
"""The text rules of *scope* (``todo``, ``texto`` or ``prosa``).
|
|
567
|
+
|
|
568
|
+
*only* keeps the rules with those names (the presentations take a
|
|
569
|
+
part of them).
|
|
570
|
+
"""
|
|
565
571
|
text = _CROSS_REF.sub(" ", _URL.sub(" ", text))
|
|
566
572
|
for rule in _scope_texts(text, scope):
|
|
573
|
+
if only is not None and rule.rule not in only:
|
|
574
|
+
continue
|
|
567
575
|
for match in rule.pattern.finditer(text):
|
|
568
576
|
if rule.keep is None or rule.keep(text, match):
|
|
569
577
|
yield Issue(
|
|
@@ -990,16 +998,26 @@ def _acronym_issues(
|
|
|
990
998
|
title; well-known indices, benchmarks, currencies and sources need no
|
|
991
999
|
expansion (*known* adds more).
|
|
992
1000
|
"""
|
|
993
|
-
|
|
1001
|
+
texts: list[tuple[int, str]] = []
|
|
994
1002
|
appendix = False
|
|
995
1003
|
for block in source.blocks:
|
|
996
1004
|
if isinstance(block, Heading) and block.level == 1:
|
|
997
1005
|
appendix = is_appendix(block.text)
|
|
998
|
-
if appendix
|
|
1006
|
+
if not appendix and isinstance(
|
|
999
1007
|
block, (Paragraph, Bullet, Numbered, Heading)
|
|
1000
1008
|
):
|
|
1001
|
-
|
|
1002
|
-
|
|
1009
|
+
texts.append((block.line, block.text))
|
|
1010
|
+
return _first_use_issues(texts, known)
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
def _first_use_issues(
|
|
1014
|
+
texts: Iterable[tuple[int, str]], known: Collection[str] = frozenset()
|
|
1015
|
+
) -> Iterator[Issue]:
|
|
1016
|
+
"""Acronyms of *texts* (``(line, text)`` in order) whose first
|
|
1017
|
+
appearance is not «Full name (ACR)» nor explained right after it."""
|
|
1018
|
+
seen: set[str] = set()
|
|
1019
|
+
for line, raw in texts:
|
|
1020
|
+
text = _AUTHOR_CITATION.sub(" ", _plain_text(raw))
|
|
1003
1021
|
for match in _ACRONYM.finditer(text):
|
|
1004
1022
|
acronym = match.group(0)
|
|
1005
1023
|
if (
|
|
@@ -1017,7 +1035,7 @@ def _acronym_issues(
|
|
|
1017
1035
|
):
|
|
1018
1036
|
continue
|
|
1019
1037
|
yield Issue(
|
|
1020
|
-
|
|
1038
|
+
line,
|
|
1021
1039
|
"siglas",
|
|
1022
1040
|
f"«{acronym}»: en su primera aparición, escribe el nombre"
|
|
1023
1041
|
f" completo y la sigla entre paréntesis («... ({acronym})»),"
|
|
@@ -31,6 +31,8 @@ BLUE_PALE = "AEBAE7"
|
|
|
31
31
|
BLUE_FAINT = "ECF0FD"
|
|
32
32
|
#: Secondary text: captions, metadata, stale rows.
|
|
33
33
|
GREY = "6D6D6D"
|
|
34
|
+
#: Plot area of the slide charts, under white grid lines.
|
|
35
|
+
GREY_PANEL = "EFEFEF"
|
|
34
36
|
#: Tesoro yellow: highlights of the presentations (bands, frames, the
|
|
35
37
|
#: section subtitles of the index) and its light shade for fills.
|
|
36
38
|
YELLOW = "FFBD4C"
|
{tesorotools_python-0.1.8 → tesorotools_python-0.1.10}/src/tesorotools/presentation/__init__.py
RENAMED
|
@@ -23,35 +23,51 @@ from tesorotools.presentation.builder import (
|
|
|
23
23
|
Chart,
|
|
24
24
|
Figure,
|
|
25
25
|
Figures,
|
|
26
|
+
Flow,
|
|
27
|
+
FlowStep,
|
|
26
28
|
Matrix,
|
|
29
|
+
Milestone,
|
|
27
30
|
Presentation,
|
|
28
31
|
Scheme,
|
|
29
32
|
Steps,
|
|
30
33
|
Table,
|
|
34
|
+
Timeline,
|
|
31
35
|
month_text,
|
|
32
36
|
)
|
|
33
37
|
from tesorotools.presentation.charts import (
|
|
34
38
|
SLIDE_CHART_CM,
|
|
35
39
|
SLIDE_FONT_PT,
|
|
40
|
+
SLIDE_STYLE,
|
|
36
41
|
slide_chart_size,
|
|
42
|
+
slide_style,
|
|
37
43
|
)
|
|
38
44
|
from tesorotools.presentation.cli import skill_text
|
|
39
|
-
from tesorotools.presentation.
|
|
45
|
+
from tesorotools.presentation.glossary import acronyms
|
|
46
|
+
from tesorotools.presentation.lint import check, headline_issues, style_issues
|
|
40
47
|
from tesorotools.presentation.markdown import (
|
|
48
|
+
DeckExtras,
|
|
41
49
|
DeckSource,
|
|
42
50
|
PresentationError,
|
|
51
|
+
RenderedChart,
|
|
43
52
|
SlideRenderer,
|
|
44
53
|
assemble,
|
|
45
54
|
build,
|
|
46
55
|
parse,
|
|
47
56
|
read,
|
|
48
57
|
)
|
|
58
|
+
from tesorotools.presentation.native import (
|
|
59
|
+
NATIVE_KINDS,
|
|
60
|
+
add_native_chart,
|
|
61
|
+
data_notes,
|
|
62
|
+
)
|
|
49
63
|
from tesorotools.presentation.template import LAYOUTS, open_template
|
|
50
64
|
|
|
51
65
|
__all__ = [
|
|
52
66
|
"LAYOUTS",
|
|
67
|
+
"NATIVE_KINDS",
|
|
53
68
|
"SLIDE_CHART_CM",
|
|
54
69
|
"SLIDE_FONT_PT",
|
|
70
|
+
"SLIDE_STYLE",
|
|
55
71
|
"Alternative",
|
|
56
72
|
"Alternatives",
|
|
57
73
|
"Assessment",
|
|
@@ -59,24 +75,35 @@ __all__ = [
|
|
|
59
75
|
"Band",
|
|
60
76
|
"Bands",
|
|
61
77
|
"Chart",
|
|
78
|
+
"DeckExtras",
|
|
62
79
|
"DeckSource",
|
|
63
80
|
"Figure",
|
|
64
81
|
"Figures",
|
|
82
|
+
"Flow",
|
|
83
|
+
"FlowStep",
|
|
65
84
|
"Matrix",
|
|
85
|
+
"Milestone",
|
|
66
86
|
"Presentation",
|
|
67
87
|
"PresentationError",
|
|
88
|
+
"RenderedChart",
|
|
68
89
|
"Scheme",
|
|
69
90
|
"SlideRenderer",
|
|
70
91
|
"Steps",
|
|
71
92
|
"Table",
|
|
93
|
+
"Timeline",
|
|
94
|
+
"acronyms",
|
|
95
|
+
"add_native_chart",
|
|
72
96
|
"assemble",
|
|
73
97
|
"build",
|
|
74
98
|
"check",
|
|
99
|
+
"data_notes",
|
|
75
100
|
"month_text",
|
|
76
101
|
"open_template",
|
|
77
102
|
"parse",
|
|
78
103
|
"read",
|
|
79
104
|
"skill_text",
|
|
80
105
|
"slide_chart_size",
|
|
106
|
+
"headline_issues",
|
|
107
|
+
"slide_style",
|
|
81
108
|
"style_issues",
|
|
82
109
|
]
|