yohou 0.1.0a1__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 (350) hide show
  1. yohou-0.1.0a1/.copier-answers.yml +17 -0
  2. yohou-0.1.0a1/.editorconfig +30 -0
  3. yohou-0.1.0a1/.git-cliff.toml +102 -0
  4. yohou-0.1.0a1/.gitattributes +2 -0
  5. yohou-0.1.0a1/.github/ISSUE_TEMPLATE/bug_report.yml +46 -0
  6. yohou-0.1.0a1/.github/ISSUE_TEMPLATE/config.yml +8 -0
  7. yohou-0.1.0a1/.github/ISSUE_TEMPLATE/feature_request.yml +38 -0
  8. yohou-0.1.0a1/.github/PULL_REQUEST_TEMPLATE.md +37 -0
  9. yohou-0.1.0a1/.github/dependabot.yml +19 -0
  10. yohou-0.1.0a1/.github/workflows/changelog.yml +110 -0
  11. yohou-0.1.0a1/.github/workflows/nightly.yml +92 -0
  12. yohou-0.1.0a1/.github/workflows/pr-title.yml +46 -0
  13. yohou-0.1.0a1/.github/workflows/publish-release.yml +138 -0
  14. yohou-0.1.0a1/.github/workflows/tests.yml +182 -0
  15. yohou-0.1.0a1/.gitignore +145 -0
  16. yohou-0.1.0a1/.pre-commit-config.yaml +50 -0
  17. yohou-0.1.0a1/.readthedocs.yml +25 -0
  18. yohou-0.1.0a1/CHANGELOG.md +11 -0
  19. yohou-0.1.0a1/CODE_OF_CONDUCT.md +43 -0
  20. yohou-0.1.0a1/CONTRIBUTING.md +3 -0
  21. yohou-0.1.0a1/LICENSE +69 -0
  22. yohou-0.1.0a1/PKG-INFO +180 -0
  23. yohou-0.1.0a1/README.md +149 -0
  24. yohou-0.1.0a1/docs/assets/.gitkeep +0 -0
  25. yohou-0.1.0a1/docs/assets/README.md +35 -0
  26. yohou-0.1.0a1/docs/assets/favicon.png +0 -0
  27. yohou-0.1.0a1/docs/assets/logo.png +0 -0
  28. yohou-0.1.0a1/docs/assets/logo_dark.png +0 -0
  29. yohou-0.1.0a1/docs/assets/logo_light.png +0 -0
  30. yohou-0.1.0a1/docs/assets/made_by_stateful-y.png +0 -0
  31. yohou-0.1.0a1/docs/examples/.gitkeep +2 -0
  32. yohou-0.1.0a1/docs/hooks.py +565 -0
  33. yohou-0.1.0a1/docs/index.md +65 -0
  34. yohou-0.1.0a1/docs/javascripts/readthedocs.js +44 -0
  35. yohou-0.1.0a1/docs/material/overrides/main.html +24 -0
  36. yohou-0.1.0a1/docs/pages/api/base.md +48 -0
  37. yohou-0.1.0a1/docs/pages/api/compose.md +57 -0
  38. yohou-0.1.0a1/docs/pages/api/datasets.md +42 -0
  39. yohou-0.1.0a1/docs/pages/api/index.md +18 -0
  40. yohou-0.1.0a1/docs/pages/api/interval.md +43 -0
  41. yohou-0.1.0a1/docs/pages/api/metrics.md +145 -0
  42. yohou-0.1.0a1/docs/pages/api/model-selection.md +39 -0
  43. yohou-0.1.0a1/docs/pages/api/plotting.md +154 -0
  44. yohou-0.1.0a1/docs/pages/api/point.md +29 -0
  45. yohou-0.1.0a1/docs/pages/api/preprocessing.md +183 -0
  46. yohou-0.1.0a1/docs/pages/api/stationarity.md +71 -0
  47. yohou-0.1.0a1/docs/pages/api/testing.md +524 -0
  48. yohou-0.1.0a1/docs/pages/api/utils.md +250 -0
  49. yohou-0.1.0a1/docs/pages/development/changelog.md +3 -0
  50. yohou-0.1.0a1/docs/pages/development/contributing.md +603 -0
  51. yohou-0.1.0a1/docs/pages/development/developing-estimators.md +48 -0
  52. yohou-0.1.0a1/docs/pages/development/index.md +12 -0
  53. yohou-0.1.0a1/docs/pages/examples/compose.md +43 -0
  54. yohou-0.1.0a1/docs/pages/examples/datasets.md +61 -0
  55. yohou-0.1.0a1/docs/pages/examples/index.md +425 -0
  56. yohou-0.1.0a1/docs/pages/examples/interval.md +37 -0
  57. yohou-0.1.0a1/docs/pages/examples/metrics.md +31 -0
  58. yohou-0.1.0a1/docs/pages/examples/model-selection.md +49 -0
  59. yohou-0.1.0a1/docs/pages/examples/plotting.md +55 -0
  60. yohou-0.1.0a1/docs/pages/examples/point.md +49 -0
  61. yohou-0.1.0a1/docs/pages/examples/preprocessing.md +55 -0
  62. yohou-0.1.0a1/docs/pages/examples/quickstart.md +7 -0
  63. yohou-0.1.0a1/docs/pages/examples/stationarity.md +25 -0
  64. yohou-0.1.0a1/docs/pages/getting-started/index.md +76 -0
  65. yohou-0.1.0a1/docs/pages/getting-started/installation.md +66 -0
  66. yohou-0.1.0a1/docs/pages/getting-started/overview.md +60 -0
  67. yohou-0.1.0a1/docs/pages/integrations/index.md +31 -0
  68. yohou-0.1.0a1/docs/pages/user-guide/advanced.md +50 -0
  69. yohou-0.1.0a1/docs/pages/user-guide/core-concepts.md +46 -0
  70. yohou-0.1.0a1/docs/pages/user-guide/forecasting.md +39 -0
  71. yohou-0.1.0a1/docs/pages/user-guide/index.md +24 -0
  72. yohou-0.1.0a1/docs/pages/user-guide/interval-forecasting.md +33 -0
  73. yohou-0.1.0a1/docs/pages/user-guide/model-selection.md +39 -0
  74. yohou-0.1.0a1/docs/pages/user-guide/preprocessing.md +75 -0
  75. yohou-0.1.0a1/docs/pages/user-guide/stationarity.md +43 -0
  76. yohou-0.1.0a1/docs/pages/user-guide/visualization.md +87 -0
  77. yohou-0.1.0a1/examples/compose/column_transformer.py +347 -0
  78. yohou-0.1.0a1/examples/compose/decomposition_variations.py +351 -0
  79. yohou-0.1.0a1/examples/compose/feature_union.py +301 -0
  80. yohou-0.1.0a1/examples/compose/forecasted_feature_advanced.py +332 -0
  81. yohou-0.1.0a1/examples/compose/local_panel_forecaster.py +375 -0
  82. yohou-0.1.0a1/examples/compose/panel_pipelines.py +442 -0
  83. yohou-0.1.0a1/examples/compose/pipeline_composition.py +347 -0
  84. yohou-0.1.0a1/examples/datasets/__init__.py +1 -0
  85. yohou-0.1.0a1/examples/datasets/air_passengers.py +179 -0
  86. yohou-0.1.0a1/examples/datasets/australian_tourism.py +218 -0
  87. yohou-0.1.0a1/examples/datasets/australian_tourism_forecasting.py +349 -0
  88. yohou-0.1.0a1/examples/datasets/ett_m1.py +211 -0
  89. yohou-0.1.0a1/examples/datasets/ett_m1_multivariate.py +307 -0
  90. yohou-0.1.0a1/examples/datasets/store_sales.py +216 -0
  91. yohou-0.1.0a1/examples/datasets/sunspots.py +211 -0
  92. yohou-0.1.0a1/examples/datasets/vic_electricity.py +212 -0
  93. yohou-0.1.0a1/examples/datasets/walmart_forecasting.py +332 -0
  94. yohou-0.1.0a1/examples/datasets/walmart_sales.py +218 -0
  95. yohou-0.1.0a1/examples/interval/__init__.py +1 -0
  96. yohou-0.1.0a1/examples/interval/catboost_multiquantile.py +282 -0
  97. yohou-0.1.0a1/examples/interval/conformal_conformity_scorers.py +345 -0
  98. yohou-0.1.0a1/examples/interval/conformal_forecasting.py +325 -0
  99. yohou-0.1.0a1/examples/interval/distance_similarity.py +453 -0
  100. yohou-0.1.0a1/examples/interval/interval_reduction.py +262 -0
  101. yohou-0.1.0a1/examples/interval/panel_intervals.py +259 -0
  102. yohou-0.1.0a1/examples/metrics/__init__.py +1 -0
  103. yohou-0.1.0a1/examples/metrics/aggregation_modes.py +381 -0
  104. yohou-0.1.0a1/examples/metrics/conformity_scorers.py +407 -0
  105. yohou-0.1.0a1/examples/metrics/interval_metrics.py +313 -0
  106. yohou-0.1.0a1/examples/metrics/point_metrics.py +334 -0
  107. yohou-0.1.0a1/examples/metrics/time_weighted_scoring.py +313 -0
  108. yohou-0.1.0a1/examples/model_selection/__init__.py +1 -0
  109. yohou-0.1.0a1/examples/model_selection/cv_splitters.py +234 -0
  110. yohou-0.1.0a1/examples/model_selection/hyperparameter_search.py +297 -0
  111. yohou-0.1.0a1/examples/model_selection/interval_search.py +288 -0
  112. yohou-0.1.0a1/examples/model_selection/multi_metric_search.py +317 -0
  113. yohou-0.1.0a1/examples/model_selection/nixtla_forecasters.py +305 -0
  114. yohou-0.1.0a1/examples/model_selection/nixtla_panel.py +274 -0
  115. yohou-0.1.0a1/examples/model_selection/optuna_search.py +316 -0
  116. yohou-0.1.0a1/examples/model_selection/panel_cross_validation.py +252 -0
  117. yohou-0.1.0a1/examples/plotting/__init__.py +0 -0
  118. yohou-0.1.0a1/examples/plotting/correlation.py +262 -0
  119. yohou-0.1.0a1/examples/plotting/decomposition.py +164 -0
  120. yohou-0.1.0a1/examples/plotting/evaluation.py +541 -0
  121. yohou-0.1.0a1/examples/plotting/exploration.py +334 -0
  122. yohou-0.1.0a1/examples/plotting/forecasting_visualization.py +349 -0
  123. yohou-0.1.0a1/examples/plotting/model_selection.py +221 -0
  124. yohou-0.1.0a1/examples/plotting/seasonal.py +293 -0
  125. yohou-0.1.0a1/examples/plotting/signal_processing.py +346 -0
  126. yohou-0.1.0a1/examples/point/__init__.py +1 -0
  127. yohou-0.1.0a1/examples/point/catboost_forecasting.py +196 -0
  128. yohou-0.1.0a1/examples/point/feature_forecasting.py +328 -0
  129. yohou-0.1.0a1/examples/point/multi_column_forecasting.py +344 -0
  130. yohou-0.1.0a1/examples/point/naive_forecasters.py +243 -0
  131. yohou-0.1.0a1/examples/point/observe_predict_workflow.py +385 -0
  132. yohou-0.1.0a1/examples/point/panel_data.py +351 -0
  133. yohou-0.1.0a1/examples/point/panel_forecasting.py +307 -0
  134. yohou-0.1.0a1/examples/point/reduction_forecaster.py +349 -0
  135. yohou-0.1.0a1/examples/preprocessing/__init__.py +1 -0
  136. yohou-0.1.0a1/examples/preprocessing/advanced_imputation.py +266 -0
  137. yohou-0.1.0a1/examples/preprocessing/data_cleaning.py +307 -0
  138. yohou-0.1.0a1/examples/preprocessing/function_transformer.py +331 -0
  139. yohou-0.1.0a1/examples/preprocessing/panel_preprocessing.py +298 -0
  140. yohou-0.1.0a1/examples/preprocessing/resampling.py +223 -0
  141. yohou-0.1.0a1/examples/preprocessing/resampling_advanced.py +284 -0
  142. yohou-0.1.0a1/examples/preprocessing/signal_processing.py +306 -0
  143. yohou-0.1.0a1/examples/preprocessing/sklearn_wrappers.py +399 -0
  144. yohou-0.1.0a1/examples/preprocessing/window_transformers.py +281 -0
  145. yohou-0.1.0a1/examples/quickstart.py +919 -0
  146. yohou-0.1.0a1/examples/stationarity/__init__.py +1 -0
  147. yohou-0.1.0a1/examples/stationarity/decomposition.py +306 -0
  148. yohou-0.1.0a1/examples/stationarity/fourier_tuning.py +297 -0
  149. yohou-0.1.0a1/examples/stationarity/panel_stationarity.py +309 -0
  150. yohou-0.1.0a1/examples/stationarity/stationarity_transforms.py +338 -0
  151. yohou-0.1.0a1/justfile +70 -0
  152. yohou-0.1.0a1/mkdocs.yml +177 -0
  153. yohou-0.1.0a1/noxfile.py +265 -0
  154. yohou-0.1.0a1/pyproject.toml +224 -0
  155. yohou-0.1.0a1/src/yohou/__init__.py +69 -0
  156. yohou-0.1.0a1/src/yohou/_version.py +34 -0
  157. yohou-0.1.0a1/src/yohou/base/__init__.py +19 -0
  158. yohou-0.1.0a1/src/yohou/base/forecaster.py +735 -0
  159. yohou-0.1.0a1/src/yohou/base/panel.py +480 -0
  160. yohou-0.1.0a1/src/yohou/base/reduction.py +590 -0
  161. yohou-0.1.0a1/src/yohou/base/standard.py +279 -0
  162. yohou-0.1.0a1/src/yohou/base/transformer.py +393 -0
  163. yohou-0.1.0a1/src/yohou/base/utils.py +301 -0
  164. yohou-0.1.0a1/src/yohou/compose/__init__.py +19 -0
  165. yohou-0.1.0a1/src/yohou/compose/column_forecaster.py +959 -0
  166. yohou-0.1.0a1/src/yohou/compose/column_transformer.py +1219 -0
  167. yohou-0.1.0a1/src/yohou/compose/decomposition_pipeline.py +727 -0
  168. yohou-0.1.0a1/src/yohou/compose/feature_pipeline.py +983 -0
  169. yohou-0.1.0a1/src/yohou/compose/feature_union.py +824 -0
  170. yohou-0.1.0a1/src/yohou/compose/forecasted_feature_forecaster.py +721 -0
  171. yohou-0.1.0a1/src/yohou/compose/local_panel_forecaster.py +616 -0
  172. yohou-0.1.0a1/src/yohou/compose/utils.py +122 -0
  173. yohou-0.1.0a1/src/yohou/datasets/__init__.py +21 -0
  174. yohou-0.1.0a1/src/yohou/datasets/data/__init__.py +1 -0
  175. yohou-0.1.0a1/src/yohou/datasets/data/air_passengers.parquet +0 -0
  176. yohou-0.1.0a1/src/yohou/datasets/data/australian_tourism.parquet +0 -0
  177. yohou-0.1.0a1/src/yohou/datasets/data/ett_m1.parquet +0 -0
  178. yohou-0.1.0a1/src/yohou/datasets/data/store_sales.parquet +0 -0
  179. yohou-0.1.0a1/src/yohou/datasets/data/sunspots.parquet +0 -0
  180. yohou-0.1.0a1/src/yohou/datasets/data/vic_electricity.parquet +0 -0
  181. yohou-0.1.0a1/src/yohou/datasets/data/walmart_sales.parquet +0 -0
  182. yohou-0.1.0a1/src/yohou/datasets/loaders.py +244 -0
  183. yohou-0.1.0a1/src/yohou/interval/__init__.py +14 -0
  184. yohou-0.1.0a1/src/yohou/interval/base.py +605 -0
  185. yohou-0.1.0a1/src/yohou/interval/reduction.py +508 -0
  186. yohou-0.1.0a1/src/yohou/interval/similarity.py +239 -0
  187. yohou-0.1.0a1/src/yohou/interval/split_conformal.py +647 -0
  188. yohou-0.1.0a1/src/yohou/interval/utils.py +37 -0
  189. yohou-0.1.0a1/src/yohou/metrics/__init__.py +58 -0
  190. yohou-0.1.0a1/src/yohou/metrics/base.py +1032 -0
  191. yohou-0.1.0a1/src/yohou/metrics/conformity.py +507 -0
  192. yohou-0.1.0a1/src/yohou/metrics/conformity_base.py +182 -0
  193. yohou-0.1.0a1/src/yohou/metrics/interval.py +1019 -0
  194. yohou-0.1.0a1/src/yohou/metrics/point.py +1491 -0
  195. yohou-0.1.0a1/src/yohou/model_selection/__init__.py +19 -0
  196. yohou-0.1.0a1/src/yohou/model_selection/search.py +2150 -0
  197. yohou-0.1.0a1/src/yohou/model_selection/split.py +679 -0
  198. yohou-0.1.0a1/src/yohou/model_selection/utils.py +577 -0
  199. yohou-0.1.0a1/src/yohou/plotting/__init__.py +65 -0
  200. yohou-0.1.0a1/src/yohou/plotting/_utils.py +485 -0
  201. yohou-0.1.0a1/src/yohou/plotting/diagnostics.py +2404 -0
  202. yohou-0.1.0a1/src/yohou/plotting/evaluation.py +1583 -0
  203. yohou-0.1.0a1/src/yohou/plotting/exploration.py +969 -0
  204. yohou-0.1.0a1/src/yohou/plotting/forecasting.py +1157 -0
  205. yohou-0.1.0a1/src/yohou/plotting/model_selection.py +403 -0
  206. yohou-0.1.0a1/src/yohou/plotting/signal.py +417 -0
  207. yohou-0.1.0a1/src/yohou/point/__init__.py +11 -0
  208. yohou-0.1.0a1/src/yohou/point/base.py +370 -0
  209. yohou-0.1.0a1/src/yohou/point/naive.py +203 -0
  210. yohou-0.1.0a1/src/yohou/point/reduction.py +270 -0
  211. yohou-0.1.0a1/src/yohou/preprocessing/__init__.py +81 -0
  212. yohou-0.1.0a1/src/yohou/preprocessing/function.py +505 -0
  213. yohou-0.1.0a1/src/yohou/preprocessing/imputation.py +705 -0
  214. yohou-0.1.0a1/src/yohou/preprocessing/outlier.py +422 -0
  215. yohou-0.1.0a1/src/yohou/preprocessing/resampling.py +458 -0
  216. yohou-0.1.0a1/src/yohou/preprocessing/signal.py +831 -0
  217. yohou-0.1.0a1/src/yohou/preprocessing/sklearn_base.py +345 -0
  218. yohou-0.1.0a1/src/yohou/preprocessing/sklearn_wrappers.py +802 -0
  219. yohou-0.1.0a1/src/yohou/preprocessing/window.py +777 -0
  220. yohou-0.1.0a1/src/yohou/py.typed +1 -0
  221. yohou-0.1.0a1/src/yohou/stationarity/__init__.py +26 -0
  222. yohou-0.1.0a1/src/yohou/stationarity/base.py +418 -0
  223. yohou-0.1.0a1/src/yohou/stationarity/seasonality.py +499 -0
  224. yohou-0.1.0a1/src/yohou/stationarity/transformers.py +1340 -0
  225. yohou-0.1.0a1/src/yohou/stationarity/trend.py +135 -0
  226. yohou-0.1.0a1/src/yohou/testing/__init__.py +298 -0
  227. yohou-0.1.0a1/src/yohou/testing/common.py +80 -0
  228. yohou-0.1.0a1/src/yohou/testing/forecaster.py +991 -0
  229. yohou-0.1.0a1/src/yohou/testing/generators.py +1014 -0
  230. yohou-0.1.0a1/src/yohou/testing/interval.py +249 -0
  231. yohou-0.1.0a1/src/yohou/testing/metadata_routing.py +224 -0
  232. yohou-0.1.0a1/src/yohou/testing/panel.py +156 -0
  233. yohou-0.1.0a1/src/yohou/testing/point.py +68 -0
  234. yohou-0.1.0a1/src/yohou/testing/reduction.py +54 -0
  235. yohou-0.1.0a1/src/yohou/testing/scorer.py +532 -0
  236. yohou-0.1.0a1/src/yohou/testing/search.py +983 -0
  237. yohou-0.1.0a1/src/yohou/testing/splitter.py +346 -0
  238. yohou-0.1.0a1/src/yohou/testing/transformer.py +1342 -0
  239. yohou-0.1.0a1/src/yohou/utils/__init__.py +90 -0
  240. yohou-0.1.0a1/src/yohou/utils/discovery.py +264 -0
  241. yohou-0.1.0a1/src/yohou/utils/panel.py +392 -0
  242. yohou-0.1.0a1/src/yohou/utils/polars.py +106 -0
  243. yohou-0.1.0a1/src/yohou/utils/tabularization.py +68 -0
  244. yohou-0.1.0a1/src/yohou/utils/tags.py +286 -0
  245. yohou-0.1.0a1/src/yohou/utils/validate_data.py +849 -0
  246. yohou-0.1.0a1/src/yohou/utils/validation.py +1515 -0
  247. yohou-0.1.0a1/src/yohou/utils/weighting.py +411 -0
  248. yohou-0.1.0a1/tests/base/__init__.py +0 -0
  249. yohou-0.1.0a1/tests/base/test_base_functions.py +485 -0
  250. yohou-0.1.0a1/tests/base/test_panel_strategy.py +184 -0
  251. yohou-0.1.0a1/tests/compose/__init__.py +1 -0
  252. yohou-0.1.0a1/tests/compose/test_column_forecaster.py +1137 -0
  253. yohou-0.1.0a1/tests/compose/test_column_transformer.py +237 -0
  254. yohou-0.1.0a1/tests/compose/test_decomposer.py +449 -0
  255. yohou-0.1.0a1/tests/compose/test_forecasted_feature_forecaster.py +619 -0
  256. yohou-0.1.0a1/tests/compose/test_local_panel_forecaster.py +334 -0
  257. yohou-0.1.0a1/tests/compose/test_metadata_routing.py +551 -0
  258. yohou-0.1.0a1/tests/compose/test_pipeline.py +162 -0
  259. yohou-0.1.0a1/tests/compose/test_utils.py +206 -0
  260. yohou-0.1.0a1/tests/conftest.py +898 -0
  261. yohou-0.1.0a1/tests/datasets/test_loaders.py +106 -0
  262. yohou-0.1.0a1/tests/integration/__init__.py +0 -0
  263. yohou-0.1.0a1/tests/integration/conftest.py +474 -0
  264. yohou-0.1.0a1/tests/integration/test_composition_correctness.py +963 -0
  265. yohou-0.1.0a1/tests/integration/test_cv_pipelines.py +610 -0
  266. yohou-0.1.0a1/tests/integration/test_decomposition_algebra.py +1184 -0
  267. yohou-0.1.0a1/tests/integration/test_deep_nesting.py +670 -0
  268. yohou-0.1.0a1/tests/integration/test_e2e_pipelines.py +1714 -0
  269. yohou-0.1.0a1/tests/integration/test_interval_compositions.py +715 -0
  270. yohou-0.1.0a1/tests/integration/test_metadata_routing.py +1104 -0
  271. yohou-0.1.0a1/tests/integration/test_panel_compositions.py +1124 -0
  272. yohou-0.1.0a1/tests/integration/test_reduction_correctness.py +981 -0
  273. yohou-0.1.0a1/tests/integration/test_scoring_compositions.py +797 -0
  274. yohou-0.1.0a1/tests/integration/test_state_lifecycle.py +1002 -0
  275. yohou-0.1.0a1/tests/integration/test_stride_horizon.py +743 -0
  276. yohou-0.1.0a1/tests/integration/test_transformer_compositions.py +782 -0
  277. yohou-0.1.0a1/tests/interval/__init__.py +0 -0
  278. yohou-0.1.0a1/tests/interval/test_panel.py +100 -0
  279. yohou-0.1.0a1/tests/interval/test_reduction.py +340 -0
  280. yohou-0.1.0a1/tests/interval/test_similarity.py +233 -0
  281. yohou-0.1.0a1/tests/interval/test_split_conformal.py +306 -0
  282. yohou-0.1.0a1/tests/interval/test_utils.py +84 -0
  283. yohou-0.1.0a1/tests/metrics/__init__.py +0 -0
  284. yohou-0.1.0a1/tests/metrics/test_aggregation_methods.py +605 -0
  285. yohou-0.1.0a1/tests/metrics/test_column_subselection.py +300 -0
  286. yohou-0.1.0a1/tests/metrics/test_conformity.py +171 -0
  287. yohou-0.1.0a1/tests/metrics/test_interval.py +476 -0
  288. yohou-0.1.0a1/tests/metrics/test_parameter_validation.py +535 -0
  289. yohou-0.1.0a1/tests/metrics/test_point.py +943 -0
  290. yohou-0.1.0a1/tests/model_selection/__init__.py +0 -0
  291. yohou-0.1.0a1/tests/model_selection/test_search.py +464 -0
  292. yohou-0.1.0a1/tests/model_selection/test_split.py +387 -0
  293. yohou-0.1.0a1/tests/model_selection/test_utils.py +112 -0
  294. yohou-0.1.0a1/tests/plotting/__init__.py +0 -0
  295. yohou-0.1.0a1/tests/plotting/conftest.py +80 -0
  296. yohou-0.1.0a1/tests/plotting/test_diagnostics.py +531 -0
  297. yohou-0.1.0a1/tests/plotting/test_evaluation.py +875 -0
  298. yohou-0.1.0a1/tests/plotting/test_exploration.py +271 -0
  299. yohou-0.1.0a1/tests/plotting/test_forecasting.py +345 -0
  300. yohou-0.1.0a1/tests/plotting/test_model_selection.py +258 -0
  301. yohou-0.1.0a1/tests/plotting/test_panel.py +383 -0
  302. yohou-0.1.0a1/tests/plotting/test_signal.py +155 -0
  303. yohou-0.1.0a1/tests/plotting/test_utils.py +172 -0
  304. yohou-0.1.0a1/tests/point/__init__.py +0 -0
  305. yohou-0.1.0a1/tests/point/test_naive.py +150 -0
  306. yohou-0.1.0a1/tests/point/test_panel.py +118 -0
  307. yohou-0.1.0a1/tests/point/test_reduction.py +540 -0
  308. yohou-0.1.0a1/tests/preprocessing/__init__.py +0 -0
  309. yohou-0.1.0a1/tests/preprocessing/test_function.py +376 -0
  310. yohou-0.1.0a1/tests/preprocessing/test_imputation.py +253 -0
  311. yohou-0.1.0a1/tests/preprocessing/test_outlier.py +106 -0
  312. yohou-0.1.0a1/tests/preprocessing/test_resampling.py +301 -0
  313. yohou-0.1.0a1/tests/preprocessing/test_signal.py +500 -0
  314. yohou-0.1.0a1/tests/preprocessing/test_sklearn.py +1089 -0
  315. yohou-0.1.0a1/tests/preprocessing/test_window.py +538 -0
  316. yohou-0.1.0a1/tests/stationarity/__init__.py +1 -0
  317. yohou-0.1.0a1/tests/stationarity/test_seasonality.py +611 -0
  318. yohou-0.1.0a1/tests/stationarity/test_transformers.py +737 -0
  319. yohou-0.1.0a1/tests/stationarity/test_trend.py +235 -0
  320. yohou-0.1.0a1/tests/test_common.py +326 -0
  321. yohou-0.1.0a1/tests/test_edge_cases.py +91 -0
  322. yohou-0.1.0a1/tests/test_estimator_checks.py +178 -0
  323. yohou-0.1.0a1/tests/test_examples.py +112 -0
  324. yohou-0.1.0a1/tests/test_panel_boundaries.py +102 -0
  325. yohou-0.1.0a1/tests/test_reproducibility.py +70 -0
  326. yohou-0.1.0a1/tests/testing/__init__.py +1 -0
  327. yohou-0.1.0a1/tests/testing/assertions.py +94 -0
  328. yohou-0.1.0a1/tests/testing/test_common.py +103 -0
  329. yohou-0.1.0a1/tests/testing/test_forecaster.py +167 -0
  330. yohou-0.1.0a1/tests/testing/test_generator_conditions.py +541 -0
  331. yohou-0.1.0a1/tests/testing/test_generators.py +135 -0
  332. yohou-0.1.0a1/tests/testing/test_interval.py +87 -0
  333. yohou-0.1.0a1/tests/testing/test_metadata_routing.py +110 -0
  334. yohou-0.1.0a1/tests/testing/test_panel.py +56 -0
  335. yohou-0.1.0a1/tests/testing/test_point.py +49 -0
  336. yohou-0.1.0a1/tests/testing/test_reduction.py +56 -0
  337. yohou-0.1.0a1/tests/testing/test_scorer.py +108 -0
  338. yohou-0.1.0a1/tests/testing/test_splitter.py +132 -0
  339. yohou-0.1.0a1/tests/testing/test_transformer.py +250 -0
  340. yohou-0.1.0a1/tests/testing/test_utilities.py +216 -0
  341. yohou-0.1.0a1/tests/utils/__init__.py +0 -0
  342. yohou-0.1.0a1/tests/utils/test_discovery.py +71 -0
  343. yohou-0.1.0a1/tests/utils/test_panel.py +565 -0
  344. yohou-0.1.0a1/tests/utils/test_parameter_validation.py +341 -0
  345. yohou-0.1.0a1/tests/utils/test_polars.py +218 -0
  346. yohou-0.1.0a1/tests/utils/test_tabularization.py +144 -0
  347. yohou-0.1.0a1/tests/utils/test_tags.py +247 -0
  348. yohou-0.1.0a1/tests/utils/test_validate_data.py +727 -0
  349. yohou-0.1.0a1/tests/utils/test_validation.py +1335 -0
  350. yohou-0.1.0a1/tests/utils/test_weighting.py +272 -0
@@ -0,0 +1,17 @@
1
+ # This file is used by Copier to track the template version
2
+ # and enable template updates in generated projects
3
+
4
+ _commit: b1350d0e5e9792ccf86faba9ee3899075a622462
5
+ _src_path: gh:stateful-y/python-package-copier
6
+ author_email: gtauzin@stateful-y.io
7
+ author_name: Guillaume Tauzin
8
+ description: A time series forecasting package based on Scikit-Learn and Polars
9
+ github_username: stateful-y
10
+ include_actions: True
11
+ include_examples: True
12
+ license: Apache-2.0
13
+ max_python_version: '3.14'
14
+ min_python_version: '3.11'
15
+ package_name: yohou
16
+ project_name: Yohou
17
+ project_slug: yohou
@@ -0,0 +1,30 @@
1
+ # EditorConfig helps maintain consistent coding styles across different editors and IDEs
2
+ # See https://editorconfig.org
3
+
4
+ root = true
5
+
6
+ [*]
7
+ charset = utf-8
8
+ end_of_line = lf
9
+ insert_final_newline = true
10
+ trim_trailing_whitespace = true
11
+
12
+ [*.py]
13
+ indent_style = space
14
+ indent_size = 4
15
+ max_line_length = 120
16
+
17
+ [*.{yml,yaml,toml}]
18
+ indent_style = space
19
+ indent_size = 2
20
+
21
+ [*.{json,md}]
22
+ indent_style = space
23
+ indent_size = 2
24
+
25
+ [Makefile]
26
+ indent_style = tab
27
+
28
+ [*.{sh,bash}]
29
+ indent_style = space
30
+ indent_size = 2
@@ -0,0 +1,102 @@
1
+ # git-cliff configuration for changelog generation
2
+ # See: https://git-cliff.org/docs/configuration
3
+
4
+ [changelog]
5
+ # changelog header
6
+ header = """
7
+ # Changelog
8
+
9
+ All notable changes to this project will be documented in this file.
10
+
11
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
12
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
13
+
14
+ """
15
+ # template for the changelog body
16
+ body = """
17
+ {%- if version %}
18
+ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
19
+ {%- set release_type = "" %}
20
+ {%- if version is matching("v?[0-9]+\\.0\\.0") %}
21
+ {%- set release_type = "major" %}
22
+ {%- elif version is matching("v?[0-9]+\\.[0-9]+\\.0") %}
23
+ {%- set release_type = "minor" %}
24
+ {%- else %}
25
+ {%- set release_type = "patch" %}
26
+ {%- endif %}
27
+
28
+ This **{{ release_type }} release** includes {{ commits | length }} commit{%- if commits | length != 1 %}s{%- endif %}.
29
+ {% else %}
30
+ ## [Unreleased]
31
+ {%- endif %}
32
+ {%- for group, commits in commits | group_by(attribute="group") %}
33
+
34
+ ### {{ group | striptags | trim | upper_first }}
35
+ {%- for commit in commits %}
36
+ - {{ commit.message | upper_first }}{%- if commit.remote.pr_number %} ([#{{ commit.remote.pr_number }}](https://github.com/stateful-y/yohou/pull/{{ commit.remote.pr_number }})){%- endif %}{%- if commit.remote.username %} by @{{ commit.remote.username }}{%- endif %}
37
+ {%- endfor %}
38
+ {%- endfor %}
39
+ {%- set new_contributors = commits | filter(attribute="remote.username") | map(attribute="remote.username") | unique %}
40
+ {%- if new_contributors | length > 0 %}
41
+
42
+ ### Contributors
43
+
44
+ Thanks to all contributors for this release:
45
+ {%- for contributor in new_contributors %}
46
+ - @{{ contributor }}
47
+ {%- endfor %}
48
+ {%- endif %}
49
+
50
+ """
51
+ # template for the changelog footer
52
+ footer = """
53
+ <!-- generated by git-cliff -->
54
+ """
55
+ # remove the leading and trailing whitespace from the templates
56
+ trim = true
57
+ # postprocessors to apply to the generated changelog
58
+ postprocessors = []
59
+
60
+ [git]
61
+ # parse the commits based on https://www.conventionalcommits.org
62
+ conventional_commits = true
63
+ # filter out the commits that are not conventional
64
+ filter_unconventional = true
65
+ # process each line of a commit as an individual commit
66
+ split_commits = false
67
+ # regex for preprocessing the commit messages
68
+ commit_preprocessors = [
69
+ # Remove issue numbers from commits
70
+ { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
71
+ ]
72
+ # regex for parsing and grouping commits
73
+ commit_parsers = [
74
+ { message = "^feat", group = "<!-- 0 -->Features" },
75
+ { message = "^fix", group = "<!-- 1 -->Bug Fixes" },
76
+ { message = "^doc", group = "<!-- 2 -->Documentation" },
77
+ { message = "^perf", group = "<!-- 3 -->Performance" },
78
+ { message = "^refactor", group = "<!-- 4 -->Refactoring" },
79
+ { message = "^style", group = "<!-- 5 -->Styling" },
80
+ { message = "^test", group = "<!-- 6 -->Testing" },
81
+ { message = "^chore\\(release\\)", skip = true },
82
+ { message = "^chore\\(deps.*\\)", skip = true },
83
+ { message = "^chore\\(pr\\)", skip = true },
84
+ { message = "^chore\\(pull\\)", skip = true },
85
+ { message = "^chore|^ci", group = "<!-- 7 -->Miscellaneous Tasks" },
86
+ { body = ".*security", group = "<!-- 8 -->Security" },
87
+ { message = "^revert", group = "<!-- 9 -->Revert" },
88
+ ]
89
+ # protect breaking changes from being skipped due to matching a skipping commit_parser
90
+ protect_breaking_commits = false
91
+ # filter out the commits that are not matched by commit parsers
92
+ filter_commits = false
93
+ # sort the tags topologically
94
+ topo_order = false
95
+ # sort the commits inside sections by oldest/newest order
96
+ sort_commits = "oldest"
97
+ # limit the number of commits included in the changelog.
98
+ # limit_commits = 42
99
+
100
+ [remote.github]
101
+ owner = "stateful-y"
102
+ repo = "yohou"
@@ -0,0 +1,2 @@
1
+ *.parquet filter=lfs diff=lfs merge=lfs -text
2
+ *.csv filter=lfs diff=lfs merge=lfs -text
@@ -0,0 +1,46 @@
1
+ name: Bug Report
2
+ description: Report a bug or unexpected behavior
3
+ title: "[Bug]: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: textarea
7
+ id: description
8
+ attributes:
9
+ label: What happened?
10
+ description: Describe the bug and what you expected to happen
11
+ placeholder: |
12
+ When I... I expected... but instead...
13
+ validations:
14
+ required: true
15
+
16
+ - type: textarea
17
+ id: reproduction
18
+ attributes:
19
+ label: How to reproduce
20
+ placeholder: |
21
+ ```python
22
+ # Minimal code example
23
+ ```
24
+ validations:
25
+ required: true
26
+
27
+ - type: textarea
28
+ id: environment
29
+ attributes:
30
+ label: Environment
31
+ placeholder: |
32
+ OS: Ubuntu 22.04
33
+ Python: 3.11.5
34
+ Version: 0.1.0
35
+ value: |
36
+ OS:
37
+ Python:
38
+ Version:
39
+ validations:
40
+ required: true
41
+
42
+ - type: textarea
43
+ id: additional
44
+ attributes:
45
+ label: Additional context
46
+ description: Logs, stack traces, or anything else that might help
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Question or Discussion
4
+ url: https://github.com/stateful-y/yohou/discussions
5
+ about: Please use GitHub Discussions for questions and general discussions
6
+ - name: Documentation
7
+ url: https://stateful-y.github.io/yohou/
8
+ about: Check the documentation for guides and API references
@@ -0,0 +1,38 @@
1
+ name: Feature Request
2
+ description: Suggest a new feature or enhancement
3
+ title: "[Feature]: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: textarea
7
+ id: description
8
+ attributes:
9
+ label: Feature description
10
+ description: What would you like to see?
11
+ placeholder: I would like to be able to...
12
+ validations:
13
+ required: true
14
+
15
+ - type: textarea
16
+ id: motivation
17
+ attributes:
18
+ label: Why is this needed?
19
+ description: What problem does this solve?
20
+ placeholder: This would help with...
21
+ validations:
22
+ required: true
23
+
24
+ - type: textarea
25
+ id: example
26
+ attributes:
27
+ label: Example usage
28
+ description: Show how you'd like to use this feature (optional)
29
+ render: python
30
+ placeholder: |
31
+ from yohou import new_feature
32
+ result = new_feature()
33
+
34
+ - type: textarea
35
+ id: additional
36
+ attributes:
37
+ label: Additional context
38
+ description: Alternatives considered, implementation ideas, examples, etc.
@@ -0,0 +1,37 @@
1
+ ## Description
2
+
3
+ <!-- Provide a brief description of the changes in this PR -->
4
+
5
+ ## Type of Change
6
+
7
+ <!-- Mark the relevant option with an "x" -->
8
+
9
+ - [ ] Bug fix (non-breaking change that fixes an issue)
10
+ - [ ] New feature (non-breaking change that adds functionality)
11
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12
+ - [ ] Documentation update
13
+ - [ ] Refactoring (no functional changes)
14
+ - [ ] Other (please describe):
15
+
16
+ ## Motivation and Context
17
+
18
+ <!-- Why is this change required? What problem does it solve? -->
19
+ <!-- If it fixes an open issue, please link to the issue here -->
20
+
21
+ Fixes #
22
+
23
+ ## Checklist
24
+
25
+ <!-- Mark completed items with an "x" -->
26
+
27
+ - [ ] My code follows the code style of this project
28
+ - [ ] I have run `just format` to format my code
29
+ - [ ] I have run `just check` to verify type annotations
30
+ - [ ] I have updated the documentation accordingly
31
+ - [ ] I have added tests to cover my changes
32
+ - [ ] All new and existing tests passed
33
+ - [ ] My changes generate no new warnings
34
+
35
+ ## Additional Notes
36
+
37
+ <!-- Add any other context about the PR here -->
@@ -0,0 +1,19 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ labels:
9
+ - "dependencies"
10
+ - "github-actions"
11
+
12
+ # Maintain dependencies for pip
13
+ - package-ecosystem: "pip"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "weekly"
17
+ labels:
18
+ - "dependencies"
19
+ - "python"
@@ -0,0 +1,110 @@
1
+ name: Build and create changelog PR
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ env:
9
+ dists-artifact-name: python-package-distributions
10
+
11
+ jobs:
12
+ changelog:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: write
16
+ pull-requests: write
17
+ env:
18
+ GIT_LFS_SKIP_SMUDGE: 1
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v6
22
+ with:
23
+ fetch-depth: 0
24
+
25
+ - name: Install git-cliff
26
+ uses: taiki-e/install-action@v2
27
+ with:
28
+ tool: git-cliff
29
+
30
+ - name: Generate changelog
31
+ id: changelog
32
+ run: |
33
+ # Get the tag name
34
+ TAG_NAME="${GITHUB_REF#refs/tags/}"
35
+
36
+ # Generate changelog for this release only
37
+ RELEASE_NOTES=$(git-cliff --config .git-cliff.toml --latest --strip header)
38
+
39
+ # Prepend new release to existing CHANGELOG.md without regenerating entire file
40
+ git-cliff --config .git-cliff.toml --latest --prepend CHANGELOG.md
41
+
42
+ # Save release notes to output and file
43
+ echo "notes<<EOF" >> $GITHUB_OUTPUT
44
+ echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT
45
+ echo "EOF" >> $GITHUB_OUTPUT
46
+
47
+ echo "version=${TAG_NAME}" >> $GITHUB_OUTPUT
48
+
49
+ - name: Install uv
50
+ uses: astral-sh/setup-uv@v7
51
+
52
+ - name: Run pre-commit on generated CHANGELOG
53
+ run: |
54
+ # Run pre-commit to ensure the generated file is properly formatted
55
+ uvx pre-commit run --files CHANGELOG.md || true
56
+
57
+ - name: Create Pull Request for CHANGELOG
58
+ uses: peter-evans/create-pull-request@v8
59
+ with:
60
+ token: ${{ secrets.CHANGELOG_AUTOMATION_TOKEN }}
61
+ add-paths: |
62
+ CHANGELOG.md
63
+ commit-message: "chore(release): update CHANGELOG.md for ${{ steps.changelog.outputs.version }}"
64
+ title: "chore(release): update CHANGELOG.md for ${{ steps.changelog.outputs.version }}"
65
+ body: |
66
+ Automated CHANGELOG.md update for release ${{ steps.changelog.outputs.version }}
67
+
68
+ Generated by git-cliff from conventional commits.
69
+
70
+ This PR was automatically created by the release workflow.
71
+ branch: changelog-${{ steps.changelog.outputs.version }}
72
+ base: main
73
+ delete-branch: true
74
+ author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
75
+ committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
76
+ signoff: true
77
+ labels: |
78
+ changelog
79
+ automated
80
+
81
+ build:
82
+ runs-on: ubuntu-latest
83
+ needs:
84
+ - changelog
85
+ steps:
86
+ - name: Checkout repository
87
+ uses: actions/checkout@v6
88
+ with:
89
+ fetch-depth: 0
90
+ ref: main
91
+ lfs: true
92
+
93
+ - name: Install the latest version of uv
94
+ uses: astral-sh/setup-uv@v7
95
+ with:
96
+ enable-cache: true
97
+ cache-dependency-glob: "pyproject.toml"
98
+ github-token: ${{ secrets.GITHUB_TOKEN }}
99
+
100
+ - name: Build package
101
+ run: uv build --python 3.11 --python-preference only-managed --sdist --wheel . --out-dir dist
102
+
103
+ - name: Check distributions
104
+ run: uvx twine check dist/*
105
+
106
+ - name: Store the distribution packages
107
+ uses: actions/upload-artifact@v6
108
+ with:
109
+ name: ${{ env.dists-artifact-name }}
110
+ path: dist/*
@@ -0,0 +1,92 @@
1
+ name: Nightly Build
2
+
3
+ on:
4
+ schedule:
5
+ # Run every day at 2:30 AM UTC
6
+ - cron: "30 2 * * *"
7
+ workflow_dispatch: # Allow manual triggering
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
15
+ env:
16
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
17
+ steps:
18
+ - uses: actions/checkout@v6
19
+ with:
20
+ lfs: true
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v7
24
+ with:
25
+ enable-cache: true
26
+ cache-dependency-glob: "pyproject.toml"
27
+
28
+ - name: Set up Python ${{ matrix.python-version }}
29
+ run: uv python install ${{ matrix.python-version }}
30
+
31
+ - name: Install nox
32
+ run: uv tool install nox
33
+
34
+ - name: Run tests with coverage
35
+ run: nox -s test_coverage
36
+
37
+ - name: Run docstring tests
38
+ run: nox -s test_docstrings
39
+
40
+ - name: Upload coverage reports
41
+ uses: codecov/codecov-action@v5
42
+ if: ${{ matrix.python-version == '3.12' && env.CODECOV_TOKEN != '' }}
43
+ with:
44
+ token: ${{ env.CODECOV_TOKEN }}
45
+
46
+ create-issue-on-failure:
47
+ needs: test
48
+ if: ${{ failure() }}
49
+ runs-on: ubuntu-latest
50
+ permissions:
51
+ issues: write
52
+ steps:
53
+ - uses: actions/checkout@v6
54
+
55
+ - name: Create issue on failure
56
+ uses: actions/github-script@v8
57
+ with:
58
+ script: |
59
+ const title = '🔴 Nightly build failed';
60
+ const body = `The nightly build failed on ${{ github.sha }}.
61
+
62
+ **Workflow run:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
63
+ **Branch:** ${{ github.ref_name }}
64
+ **Commit:** ${{ github.sha }}
65
+
66
+ Please investigate and fix the issue.`;
67
+
68
+ // Check if there's already an open issue for nightly build failures
69
+ const issues = await github.rest.issues.listForRepo({
70
+ owner: context.repo.owner,
71
+ repo: context.repo.repo,
72
+ state: 'open',
73
+ labels: 'nightly-build-failure'
74
+ });
75
+
76
+ if (issues.data.length === 0) {
77
+ await github.rest.issues.create({
78
+ owner: context.repo.owner,
79
+ repo: context.repo.repo,
80
+ title: title,
81
+ body: body,
82
+ labels: ['nightly-build-failure', 'bug']
83
+ });
84
+ } else {
85
+ // Add a comment to the existing issue
86
+ await github.rest.issues.createComment({
87
+ owner: context.repo.owner,
88
+ repo: context.repo.repo,
89
+ issue_number: issues.data[0].number,
90
+ body: `Another nightly build failure occurred:\n\n${body}`
91
+ });
92
+ }
@@ -0,0 +1,46 @@
1
+ name: Validate PR Title
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, edited, synchronize, reopened]
6
+ branches: [main]
7
+
8
+ jobs:
9
+ validate-pr-title:
10
+ name: Validate PR Title
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ pull-requests: read
14
+ steps:
15
+ - name: Validate PR title follows conventional commit format
16
+ uses: amannn/action-semantic-pull-request@v6
17
+ env:
18
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19
+ with:
20
+ # Configure which types are allowed (must match git-cliff config)
21
+ types: |
22
+ feat
23
+ fix
24
+ docs
25
+ style
26
+ refactor
27
+ perf
28
+ test
29
+ build
30
+ ci
31
+ chore
32
+ revert
33
+ # Require a scope for certain types (optional)
34
+ requireScope: false
35
+ # Validate the subject is not empty
36
+ subjectPattern: ^.+$
37
+ subjectPatternError: |
38
+ The subject "{subject}" found in the pull request title "{title}"
39
+ didn't match the configured pattern. Please ensure that the subject
40
+ doesn't start with an uppercase character.
41
+ # Validate the entire PR title (not just the subject)
42
+ validateSingleCommit: false
43
+ # Ignore merge commits
44
+ ignoreLabels: |
45
+ bot
46
+ ignore-semantic-pull-request
@@ -0,0 +1,138 @@
1
+ name: Publish GitHub Release
2
+
3
+ on:
4
+ pull_request:
5
+ types: [closed]
6
+ branches:
7
+ - main
8
+
9
+ env:
10
+ dists-artifact-name: python-package-distributions
11
+
12
+ jobs:
13
+ create-release:
14
+ # Only run if PR was merged and has the changelog label
15
+ if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'changelog')
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ contents: write
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v6
22
+ with:
23
+ fetch-depth: 0
24
+ ref: main
25
+
26
+ - name: Find release tag
27
+ id: find_tag
28
+ run: |
29
+ # Extract version from PR title (e.g., "chore(release): update CHANGELOG.md for v0.2.0" or "v0.1.0-alpha.1")
30
+ PR_TITLE="${{ github.event.pull_request.title }}"
31
+ VERSION=$(echo "$PR_TITLE" | grep -oP 'v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+(\.[0-9]+)?)?' || echo "")
32
+
33
+ if [ -z "$VERSION" ]; then
34
+ echo "No version found in PR title"
35
+ exit 1
36
+ fi
37
+
38
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
39
+
40
+ - name: Extract release notes from CHANGELOG
41
+ id: release_notes
42
+ run: |
43
+ VERSION="${{ steps.find_tag.outputs.version }}"
44
+ # Strip the 'v' prefix for CHANGELOG lookup (e.g., v0.4.0 -> 0.4.0)
45
+ VERSION_NO_V="${VERSION#v}"
46
+
47
+ # Debug: Show what we're working with
48
+ echo "Looking for version: $VERSION_NO_V (from tag: $VERSION)"
49
+ echo "First 100 lines of CHANGELOG.md:"
50
+ head -n 100 CHANGELOG.md
51
+
52
+ # Extract the section for this version from CHANGELOG.md
53
+ # This uses awk to get content between the version header and the next version header
54
+ RELEASE_NOTES=$(awk -v ver="$VERSION_NO_V" '
55
+ /^## \[.*\]/ {
56
+ if (found) exit;
57
+ if ($0 ~ "\\[" ver "\\]") {
58
+ found=1;
59
+ next;
60
+ }
61
+ }
62
+ found {print}
63
+ ' CHANGELOG.md | head -c 50000)
64
+
65
+ if [ -z "$RELEASE_NOTES" ]; then
66
+ echo "ERROR: No release notes found for version $VERSION_NO_V (tag: $VERSION)"
67
+ echo "Available versions in CHANGELOG.md:"
68
+ grep "^## \[" CHANGELOG.md
69
+ exit 1
70
+ fi
71
+
72
+ echo "notes<<EOF" >> $GITHUB_OUTPUT
73
+ echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT
74
+ echo "EOF" >> $GITHUB_OUTPUT
75
+
76
+ - name: Download release artifacts
77
+ uses: dawidd6/action-download-artifact@v6
78
+ with:
79
+ workflow: changelog.yml
80
+ name: ${{ env.dists-artifact-name }}
81
+ path: dist/
82
+ search_artifacts: true
83
+
84
+ - name: Create GitHub Release
85
+ env:
86
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87
+ run: |
88
+ VERSION="${{ steps.find_tag.outputs.version }}"
89
+ gh release create "$VERSION" \
90
+ --title "$VERSION" \
91
+ --notes "${{ steps.release_notes.outputs.notes }}" \
92
+ dist/*
93
+
94
+ pypi-publish:
95
+ name: Publish to PyPI
96
+ needs:
97
+ - create-release
98
+ runs-on: ubuntu-latest
99
+ environment:
100
+ name: pypi
101
+ url: https://pypi.org/p/yohou
102
+ permissions:
103
+ id-token: write
104
+ steps:
105
+ - name: Checkout repository
106
+ uses: actions/checkout@v6
107
+ with:
108
+ fetch-depth: 0
109
+ ref: main
110
+
111
+ - name: Find release tag
112
+ id: find_tag
113
+ run: |
114
+ # Extract version from PR title (e.g., "chore(release): update CHANGELOG.md for v0.2.0")
115
+ PR_TITLE="${{ github.event.pull_request.title }}"
116
+ VERSION=$(echo "$PR_TITLE" | grep -oP 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "")
117
+
118
+ if [ -z "$VERSION" ]; then
119
+ echo "No version found in PR title"
120
+ exit 1
121
+ fi
122
+
123
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
124
+
125
+ - name: Download release artifacts
126
+ uses: dawidd6/action-download-artifact@v6
127
+ with:
128
+ workflow: changelog.yml
129
+ name: ${{ env.dists-artifact-name }}
130
+ path: dist/
131
+ search_artifacts: true
132
+ workflow_conclusion: success
133
+
134
+ - name: Publish to PyPI
135
+ uses: pypa/gh-action-pypi-publish@release/v1
136
+ with:
137
+ attestations: true
138
+ verify-metadata: false