Skip to content

Feature/submodule gems craft#243

Open
Juliette-Gerbaux wants to merge 13 commits into
mainfrom
feature/submodule_gems_craft
Open

Feature/submodule gems craft#243
Juliette-Gerbaux wants to merge 13 commits into
mainfrom
feature/submodule_gems_craft

Conversation

@Juliette-Gerbaux

Copy link
Copy Markdown
Contributor

Process ID

Process: GP-01

Description

This PR splits the former monolithic gems package into three dedicated packages and introduces hybrid GEMS study support.

Package restructuring (gemsgems_craft + gems_runner)

  • gems_craft: I/O and data structures only (no solver dependency) — YAML parsing/writing for libraries, systems, optim-config, scenario builder
  • gems_runner: solver and execution logic — expression language, model resolution, simulation, session
  • All public functions renamed to load_yaml_* / write_yaml_* with Path inputs; stream-based helpers kept as private _parse_yaml_* for tests
  • ScenarioBuilder.load / dump renamed to load_dat / write_dat
  • load_yaml_system and load_yaml_library are now generic (accept a schema TypeVar with default) to support subclass schemas without code duplication

New package: gems_craft_hybrid

  • HybridSystemSchema(SystemSchema): adds area-connections and thermal-capacity-connections (with nested thermal-component: {area, cluster-id})
  • HybridPortTypeSchema(PortTypeSchema): adds area-connection and thermal-capacity-connection
  • HybridLibrarySchema(LibrarySchema): overrides port-types with HybridPortTypeSchema
  • Hybrid studies are read/write only — simulation is not supported in GemsPy (use Antares Simulator)

Documentation

  • AGENTS.md updated with correct package names, CLI, and architecture
  • docs/user-guide/inputs.md extended with hybrid study format and examples
  • docs/agents/python-convention.md and testing.md updated

Impact Analysis

  • gems_craft/: I/O functions renamed — any external code importing from gems must migrate to gems_craft / gems_runner
  • gems_runner/: all internal imports updated; no logic changes, solver output values unchanged
  • gems_craft_hybrid/: new package, additive only
  • Solver output values: no change

Checklist

  • Unit tests pass (pytest)
  • Type checking passes (mypy)
  • Formatting passes (black, isort)
  • pyproject.toml version bumped if applicable
  • AGENTS.md reviewed for impact and updated if needed

Comment thread docs/CHANGELOG.md

All notable changes to GemsPy are documented here.

## [2.0.0] - Unreleased

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe rather 1.0.0 or 0.2.0 ?



class HybridLibrarySchema(LibrarySchema):
port_types: List[HybridPortTypeSchema] = Field(default_factory=list) # type: ignore[assignment]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shall we add "write_yaml" methods in the gems_craft_hybrid module (for lib and system) or shall those methods in gems_craft be sufficient and also manage hybrid cases?

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.

2 participants