gvar-toolbox 0.1.0__py3-none-any.whl

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 (122) hide show
  1. gvar/__init__.py +28 -0
  2. gvar/__main__.py +19 -0
  3. gvar/_build_stamp.py +15 -0
  4. gvar/argspec.py +1834 -0
  5. gvar/auggvar.py +1047 -0
  6. gvar/auggvar_compare.py +424 -0
  7. gvar/checkpoints.py +420 -0
  8. gvar/cli.py +520 -0
  9. gvar/compat.py +351 -0
  10. gvar/core/__init__.py +1 -0
  11. gvar/core/bootstrap.py +2038 -0
  12. gvar/core/cointegration.py +305 -0
  13. gvar/core/conditional.py +131 -0
  14. gvar/core/contemp.py +215 -0
  15. gvar/core/correlations.py +79 -0
  16. gvar/core/critical_values.py +173 -0
  17. gvar/core/diagnostics.py +192 -0
  18. gvar/core/diagnostics_est.py +98 -0
  19. gvar/core/dominant_unit.py +863 -0
  20. gvar/core/exogeneity.py +378 -0
  21. gvar/core/forecast.py +109 -0
  22. gvar/core/foreign.py +363 -0
  23. gvar/core/identification.py +351 -0
  24. gvar/core/impulse.py +879 -0
  25. gvar/core/joins.py +88 -0
  26. gvar/core/lowmem.py +44 -0
  27. gvar/core/lowmem_shrink.py +142 -0
  28. gvar/core/matlab_rng.py +533 -0
  29. gvar/core/persistence.py +44 -0
  30. gvar/core/restricted.py +96 -0
  31. gvar/core/selection.py +351 -0
  32. gvar/core/solve.py +223 -0
  33. gvar/core/stability.py +269 -0
  34. gvar/core/tcdecomp.py +186 -0
  35. gvar/core/tvweights.py +383 -0
  36. gvar/core/unitroot.py +202 -0
  37. gvar/core/varx.py +81 -0
  38. gvar/core/weights.py +547 -0
  39. gvar/defaults.py +1850 -0
  40. gvar/demo/__init__.py +4 -0
  41. gvar/demo/compare.py +222 -0
  42. gvar/demo/fetch.py +256 -0
  43. gvar/doctor/__init__.py +5 -0
  44. gvar/doctor/budget.py +131 -0
  45. gvar/doctor/calib.py +81 -0
  46. gvar/doctor/cli.py +159 -0
  47. gvar/doctor/env.py +690 -0
  48. gvar/doctor/ladder.py +582 -0
  49. gvar/doctor/parity.py +62 -0
  50. gvar/doctor/privacy.py +126 -0
  51. gvar/doctor/report.py +146 -0
  52. gvar/doctor/run.py +431 -0
  53. gvar/doctor/schema/doctor-report-2.json +269 -0
  54. gvar/evaluate.py +513 -0
  55. gvar/explore.py +1204 -0
  56. gvar/forecast_benchmarks.py +146 -0
  57. gvar/forecast_dm.py +503 -0
  58. gvar/forecast_eval.py +1841 -0
  59. gvar/forecast_stats.py +184 -0
  60. gvar/forecast_targets.py +165 -0
  61. gvar/horizons.py +148 -0
  62. gvar/io/__init__.py +2 -0
  63. gvar/io/artifacts.py +353 -0
  64. gvar/io/biff.py +393 -0
  65. gvar/io/countrydata_export.py +141 -0
  66. gvar/io/custom_workbook.py +289 -0
  67. gvar/io/ddps_trade.py +158 -0
  68. gvar/io/dots.py +342 -0
  69. gvar/io/drop.py +575 -0
  70. gvar/io/extend.py +289 -0
  71. gvar/io/fc_eval_sheets.py +538 -0
  72. gvar/io/full_dataset.py +106 -0
  73. gvar/io/full_output.py +4480 -0
  74. gvar/io/graphs_export.py +408 -0
  75. gvar/io/legacy_adapter.py +2102 -0
  76. gvar/io/main_settings.py +823 -0
  77. gvar/io/matlab_tree_export.py +906 -0
  78. gvar/io/microfit_export.py +225 -0
  79. gvar/io/naming.py +139 -0
  80. gvar/io/output_classification.py +236 -0
  81. gvar/io/ppp_gdp.py +558 -0
  82. gvar/io/regional_export.py +316 -0
  83. gvar/io/run_join.py +228 -0
  84. gvar/io/sources.py +647 -0
  85. gvar/io/tc_decomposition.py +129 -0
  86. gvar/io/time_varying.py +51 -0
  87. gvar/io/transforms.py +520 -0
  88. gvar/io/uploads.py +957 -0
  89. gvar/io/variables.py +433 -0
  90. gvar/levels_dependent.py +216 -0
  91. gvar/mcp_server.py +5227 -0
  92. gvar/model_shape.py +20 -0
  93. gvar/pipeline.py +3398 -0
  94. gvar/plots.py +230 -0
  95. gvar/present.py +963 -0
  96. gvar/provenance.py +215 -0
  97. gvar/refusals.py +95 -0
  98. gvar/regional_aggregation.py +179 -0
  99. gvar/regions.py +233 -0
  100. gvar/report.py +280 -0
  101. gvar/service/__init__.py +19 -0
  102. gvar/service/data.py +127 -0
  103. gvar/service/refine.py +112 -0
  104. gvar/service/run.py +146 -0
  105. gvar/spec/__init__.py +12 -0
  106. gvar/spec/catalogue.py +813 -0
  107. gvar/spec/foreign.py +150 -0
  108. gvar/spec/model.py +301 -0
  109. gvar/spec/route.py +715 -0
  110. gvar/spec/rules.py +91 -0
  111. gvar/spec/sentences.py +29 -0
  112. gvar/spec/spec_schema.json +1739 -0
  113. gvar/spec/strip.py +931 -0
  114. gvar/spec/validate.py +2091 -0
  115. gvar/spec/workbook.py +1398 -0
  116. gvar/spec/xlsx.py +283 -0
  117. gvar/wording.py +57 -0
  118. gvar_toolbox-0.1.0.dist-info/METADATA +37 -0
  119. gvar_toolbox-0.1.0.dist-info/RECORD +122 -0
  120. gvar_toolbox-0.1.0.dist-info/WHEEL +5 -0
  121. gvar_toolbox-0.1.0.dist-info/entry_points.txt +3 -0
  122. gvar_toolbox-0.1.0.dist-info/top_level.txt +1 -0
gvar/__init__.py ADDED
@@ -0,0 +1,28 @@
1
+ """GVAR Toolbox 2.0, ported to Python.
2
+
3
+ Validated against the MATLAB Brief and Full Demo outputs across ten
4
+ checkpoints, from trade weights through to 40-quarter forecasts.
5
+
6
+ from gvar.io import legacy_adapter
7
+ from gvar import models, pipeline
8
+
9
+ data = legacy_adapter.load("gvar.xls", flows="flows.xls")
10
+ result = pipeline.run(data)
11
+ """
12
+ def _resolve_version() -> str:
13
+ """Single source of truth: the exact same chain gvar.provenance uses
14
+ for the MCP gvar_version tool and every exported workbook's About
15
+ sheet (deploy-time stamp, then installed package metadata, then
16
+ pyproject.toml's own `version =` line -- see
17
+ gvar.provenance.engine_version_info's docstring for why each rung
18
+ exists), so this attribute cannot drift from what production
19
+ reports the way it just did: pyproject.toml moved to "0.27.1" in
20
+ e696a28 (a real gvar/core/exogeneity.py fix), on the same commit
21
+ this hardcoded literal was left at "0.27.0" -- nothing re-synced it,
22
+ and nothing would have caught a second one-line release bump doing
23
+ the same thing again."""
24
+ from . import provenance
25
+ return provenance.engine_version()
26
+
27
+
28
+ __version__ = _resolve_version()
gvar/__main__.py ADDED
@@ -0,0 +1,19 @@
1
+ """`python -m gvar`: `doctor` goes to gvar.doctor.cli, anything else to gvar.cli.main."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+
7
+
8
+ def _run() -> int:
9
+ if sys.argv[1:2] == ["doctor"]:
10
+ from .doctor.cli import main as doctor_main
11
+
12
+ return doctor_main(sys.argv[2:])
13
+ from .cli import main
14
+
15
+ return main()
16
+
17
+
18
+ if __name__ == "__main__":
19
+ raise SystemExit(_run())
gvar/_build_stamp.py ADDED
@@ -0,0 +1,15 @@
1
+ """Placeholder. Overwritten by `.github/workflows/deploy-space.yml`'s
2
+ "Generate build stamp" step right before it uploads `gvar/` to the
3
+ Hugging Face Space, so the built container carries real values without
4
+ needing `.git` or a `pip install` of this package (neither is present
5
+ there -- see `gvar/provenance.py`'s module docstring for why).
6
+
7
+ In any OTHER checkout -- local dev, CI, a sandbox -- these stay `None`
8
+ and `gvar.provenance` falls through to its runtime-read layer (git,
9
+ then pyproject.toml) instead. Do not hand-edit these values; edit the
10
+ workflow step that generates them.
11
+ """
12
+ COMMIT_SHA = None
13
+ COMMIT_TIME = None
14
+ ENGINE_VERSION = None
15
+ BUILD_TIME = None