Skip to content

feat: AI-add optional YAML workflow configuration - #7

Merged
komaksym merged 4 commits into
mainfrom
codex/optional-yaml-workflow-config
Jul 3, 2026
Merged

feat: AI-add optional YAML workflow configuration#7
komaksym merged 4 commits into
mainfrom
codex/optional-yaml-workflow-config

Conversation

@komaksym

@komaksym komaksym commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds optional grouped-workflow YAML configuration for custom dataset files, separators, feature names/groups, timestamp parsing, calendar settings, and workflow defaults.
  • Adds CLI override merging so explicit command-line args take precedence over YAML while legacy --data-dir usage remains supported.
  • Infers sampling frequency from input data, keeps TSAM grouped periods fixed at 24 hours, records effective config/datasets in the manifest, and supports TSAM mean-preserved representative exports.

Validation

  • Lint: passed (uv run ruff check src/tsam_workflows tests src/approach_1_ALL.ipynb)
  • Typecheck: passed (uv run mypy src/tsam_workflows)
  • Test: passed (uv run pytest; uv run pytest --nbmake src/approach_1_ALL.ipynb)
  • Build/Package: passed (uv build)

Risks / Notes

  • Adds PyYAML as a direct dependency.
  • --data-dir cannot be combined with --config; YAML dataset paths resolve relative to the config file.
  • preserve_column_means: true exports TSAM synthetic mean-preserved representative profiles while retaining medoid dates as provenance.
  • The branch also includes the prior notebook documentation commit that was already local on main.

Breaking changes

  • None

@komaksym komaksym changed the title Add optional YAML workflow configuration feat: Add optional YAML workflow configuration Jul 2, 2026
@komaksym komaksym changed the title feat: Add optional YAML workflow configuration feat: AI-add optional YAML workflow configuration Jul 2, 2026
@komaksym
komaksym marked this pull request as ready for review July 2, 2026 20:21
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Comment thread src/tsam_workflows/cli.py
grouped.add_argument(
"--cluster-method",
choices=SUPPORTED_CLUSTER_METHODS,
default="hierarchical",

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this removed, isn't it still the default?

Comment on lines +133 to +145
class GroupedConfigFile:
"""Validated portable settings loaded from one grouped-workflow YAML file."""

dataset_specs: dict[str, DatasetSpec]
snapshot_column: str = "snapshot"
timestamp_format: str = DEFAULT_TIMESTAMP_FORMAT
year: int = 2025
countries: tuple[str, ...] | None = None
working_clusters: int = 5
non_working_clusters: int = 2
cluster_method: ClusterMethod = "hierarchical"
non_working_weekdays: frozenset[str] = DEFAULT_NON_WORKING_WEEKDAYS
preserve_column_means: bool = False

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need another config dataclass if we already have one above?

Comment thread src/tsam_workflows/grouped.py
@komaksym
komaksym merged commit 9ef3ff7 into main Jul 3, 2026
4 checks passed
@komaksym
komaksym deleted the codex/optional-yaml-workflow-config branch July 4, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant