dfm-python 0.1.5__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.
- dfm_python-0.1.5/.gitignore +209 -0
- dfm_python-0.1.5/.python-version +1 -0
- dfm_python-0.1.5/CHANGELOG.md +54 -0
- dfm_python-0.1.5/LICENSE +21 -0
- dfm_python-0.1.5/MANIFEST.in +32 -0
- dfm_python-0.1.5/PKG-INFO +572 -0
- dfm_python-0.1.5/README.md +530 -0
- dfm_python-0.1.5/config/example_config.yaml +149 -0
- dfm_python-0.1.5/config/example_config_macro_data.yaml +214 -0
- dfm_python-0.1.5/data/example_macro_data.csv +18 -0
- dfm_python-0.1.5/data/sample_data.csv +193 -0
- dfm_python-0.1.5/pyproject.toml +57 -0
- dfm_python-0.1.5/scripts/inference.py +226 -0
- dfm_python-0.1.5/scripts/train.py +282 -0
- dfm_python-0.1.5/spec/example_spec.csv +13 -0
- dfm_python-0.1.5/src/__init__.py +17 -0
- dfm_python-0.1.5/src/dfm_python/__init__.py +60 -0
- dfm_python-0.1.5/src/dfm_python/config.py +556 -0
- dfm_python-0.1.5/src/dfm_python/data_loader.py +540 -0
- dfm_python-0.1.5/src/dfm_python/dfm.py +3120 -0
- dfm_python-0.1.5/src/dfm_python/kalman.py +455 -0
- dfm_python-0.1.5/src/dfm_python/news.py +742 -0
- dfm_python-0.1.5/src/dfm_python/utils/__init__.py +27 -0
- dfm_python-0.1.5/src/dfm_python/utils/aggregation.py +258 -0
- dfm_python-0.1.5/src/dfm_python/utils/data_utils.py +165 -0
- dfm_python-0.1.5/src/test/__init__.py +2 -0
- dfm_python-0.1.5/src/test/test_dfm.py +460 -0
- dfm_python-0.1.5/src/test/test_kalman.py +325 -0
- dfm_python-0.1.5/src/test/test_news.py +229 -0
- dfm_python-0.1.5/src/test/test_synthetic.py +135 -0
- dfm_python-0.1.5/test_comprehensive.py +510 -0
- dfm_python-0.1.5/uv.lock +1247 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
outputs/
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
# Usually these files are written by a python script from a template
|
|
33
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
34
|
+
*.manifest
|
|
35
|
+
*.spec
|
|
36
|
+
|
|
37
|
+
# Installer logs
|
|
38
|
+
pip-log.txt
|
|
39
|
+
pip-delete-this-directory.txt
|
|
40
|
+
|
|
41
|
+
# Unit test / coverage reports
|
|
42
|
+
htmlcov/
|
|
43
|
+
.tox/
|
|
44
|
+
.nox/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
.cache
|
|
48
|
+
nosetests.xml
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.cover
|
|
51
|
+
*.py.cover
|
|
52
|
+
.hypothesis/
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
cover/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
.pybuilder/
|
|
78
|
+
target/
|
|
79
|
+
|
|
80
|
+
# Jupyter Notebook
|
|
81
|
+
.ipynb_checkpoints
|
|
82
|
+
|
|
83
|
+
# IPython
|
|
84
|
+
profile_default/
|
|
85
|
+
ipython_config.py
|
|
86
|
+
|
|
87
|
+
# pyenv
|
|
88
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
89
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
90
|
+
# .python-version
|
|
91
|
+
|
|
92
|
+
# pipenv
|
|
93
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
94
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
95
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
96
|
+
# install all needed dependencies.
|
|
97
|
+
#Pipfile.lock
|
|
98
|
+
|
|
99
|
+
# UV
|
|
100
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
101
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
102
|
+
# commonly ignored for libraries.
|
|
103
|
+
#uv.lock
|
|
104
|
+
|
|
105
|
+
# poetry
|
|
106
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
107
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
108
|
+
# commonly ignored for libraries.
|
|
109
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
110
|
+
#poetry.lock
|
|
111
|
+
#poetry.toml
|
|
112
|
+
|
|
113
|
+
# pdm
|
|
114
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
115
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
116
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
117
|
+
#pdm.lock
|
|
118
|
+
#pdm.toml
|
|
119
|
+
.pdm-python
|
|
120
|
+
.pdm-build/
|
|
121
|
+
|
|
122
|
+
# pixi
|
|
123
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
124
|
+
#pixi.lock
|
|
125
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
126
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
127
|
+
.pixi
|
|
128
|
+
|
|
129
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
130
|
+
__pypackages__/
|
|
131
|
+
|
|
132
|
+
# Celery stuff
|
|
133
|
+
celerybeat-schedule
|
|
134
|
+
celerybeat.pid
|
|
135
|
+
|
|
136
|
+
# SageMath parsed files
|
|
137
|
+
*.sage.py
|
|
138
|
+
|
|
139
|
+
# Environments
|
|
140
|
+
.env
|
|
141
|
+
.envrc
|
|
142
|
+
.venv
|
|
143
|
+
env/
|
|
144
|
+
venv/
|
|
145
|
+
ENV/
|
|
146
|
+
env.bak/
|
|
147
|
+
venv.bak/
|
|
148
|
+
|
|
149
|
+
# Spyder project settings
|
|
150
|
+
.spyderproject
|
|
151
|
+
.spyproject
|
|
152
|
+
|
|
153
|
+
# Rope project settings
|
|
154
|
+
.ropeproject
|
|
155
|
+
|
|
156
|
+
# mkdocs documentation
|
|
157
|
+
/site
|
|
158
|
+
|
|
159
|
+
# mypy
|
|
160
|
+
.mypy_cache/
|
|
161
|
+
.dmypy.json
|
|
162
|
+
dmypy.json
|
|
163
|
+
|
|
164
|
+
# Pyre type checker
|
|
165
|
+
.pyre/
|
|
166
|
+
|
|
167
|
+
# pytype static type analyzer
|
|
168
|
+
.pytype/
|
|
169
|
+
|
|
170
|
+
# Cython debug symbols
|
|
171
|
+
cython_debug/
|
|
172
|
+
|
|
173
|
+
# PyCharm
|
|
174
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
175
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
176
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
177
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
178
|
+
#.idea/
|
|
179
|
+
|
|
180
|
+
# Abstra
|
|
181
|
+
# Abstra is an AI-powered process automation framework.
|
|
182
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
183
|
+
# Learn more at https://abstra.io/docs
|
|
184
|
+
.abstra/
|
|
185
|
+
|
|
186
|
+
# Visual Studio Code
|
|
187
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
188
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
189
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
190
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
191
|
+
# .vscode/
|
|
192
|
+
|
|
193
|
+
# Ruff stuff:
|
|
194
|
+
.ruff_cache/
|
|
195
|
+
|
|
196
|
+
# PyPI configuration file
|
|
197
|
+
.pypirc
|
|
198
|
+
|
|
199
|
+
# Cursor
|
|
200
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
201
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
202
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
203
|
+
.cursorignore
|
|
204
|
+
.cursorindexingignore
|
|
205
|
+
|
|
206
|
+
# Marimo
|
|
207
|
+
marimo/_static/
|
|
208
|
+
marimo/_lsp/
|
|
209
|
+
__marimo__/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.4] - 2024-11-07
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Fixed critical bug: `ff` variable scoping issue in `init_conditions()` causing dimension mismatch errors in multi-block models with different factor counts
|
|
7
|
+
- Fixed `A_temp` variable scoping issue that could cause incorrect computations when OLS regression fails for some blocks
|
|
8
|
+
- Fixed `bl_idxM` and `bl_idxQ` initialization issue that could cause AttributeError when no blocks are processed
|
|
9
|
+
- Removed unreachable code in `init_conditions()` else branch
|
|
10
|
+
- Improved empty array handling in `em_step()` for quarterly series constraints
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Enhanced variable scoping safety by resetting block-specific variables at start of each iteration
|
|
14
|
+
- Improved error handling for edge cases with empty arrays
|
|
15
|
+
|
|
16
|
+
## [0.1.3] - 2024-11-07
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- Comprehensive README with detailed inputs/outputs documentation
|
|
20
|
+
- Clock-based mixed-frequency framework documentation
|
|
21
|
+
- Enhanced module-level docstrings throughout the codebase
|
|
22
|
+
- Detailed API reference with examples
|
|
23
|
+
- Improved error messages with context and solutions
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Optimized code performance (removed redundant computations)
|
|
27
|
+
- Improved memory usage (replaced unnecessary copies with views)
|
|
28
|
+
- Enhanced code documentation and comments
|
|
29
|
+
- Updated package description and metadata
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
- Removed duplicate `frequencies_array` computation
|
|
33
|
+
- Fixed `optNaN` dictionary mutation issue
|
|
34
|
+
- Improved code organization and clarity
|
|
35
|
+
|
|
36
|
+
### Documentation
|
|
37
|
+
- Complete input/output specifications
|
|
38
|
+
- 5 comprehensive usage examples
|
|
39
|
+
- Troubleshooting guide with solutions
|
|
40
|
+
- Architecture overview
|
|
41
|
+
- Clock-based framework explanation
|
|
42
|
+
|
|
43
|
+
## [0.1.2] - Previous release
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
- Fixed `ModuleNotFoundError: No module named 'utils'` by moving utils into dfm_python package
|
|
47
|
+
- Improved import paths and package structure
|
|
48
|
+
|
|
49
|
+
## [0.1.1] - Initial release
|
|
50
|
+
|
|
51
|
+
- Initial PyPI release
|
|
52
|
+
- Core DFM estimation functionality
|
|
53
|
+
- Mixed-frequency data support
|
|
54
|
+
- News decomposition
|
dfm_python-0.1.5/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ywcpar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Include only the DFM module (src/nowcasting)
|
|
2
|
+
# Exclude all application-specific code (adapters, database, scripts, config, etc.)
|
|
3
|
+
|
|
4
|
+
include README.md
|
|
5
|
+
include LICENSE
|
|
6
|
+
include pyproject.toml
|
|
7
|
+
|
|
8
|
+
# Include only the nowcasting package
|
|
9
|
+
recursive-include src/nowcasting *.py
|
|
10
|
+
|
|
11
|
+
# Exclude application-specific directories
|
|
12
|
+
prune adapters
|
|
13
|
+
prune database
|
|
14
|
+
prune scripts
|
|
15
|
+
prune services
|
|
16
|
+
prune config
|
|
17
|
+
prune migrations
|
|
18
|
+
prune tests
|
|
19
|
+
prune assets
|
|
20
|
+
|
|
21
|
+
# Include README (already specified above, but be explicit)
|
|
22
|
+
include README.md
|
|
23
|
+
|
|
24
|
+
# Exclude other application-specific files (but keep README.md)
|
|
25
|
+
exclude *.yaml
|
|
26
|
+
exclude *.yml
|
|
27
|
+
exclude *.csv
|
|
28
|
+
exclude *.sql
|
|
29
|
+
exclude *.lock
|
|
30
|
+
exclude .gitignore
|
|
31
|
+
exclude .env*
|
|
32
|
+
|