Skip to content

[WIP] (PR74) Docs/Add a tutorial notebook - legacy to GEMS converter - #199

Open
GuillaumeMaistre wants to merge 40 commits into
mainfrom
docs/tuto-antares-legacy-converter
Open

[WIP] (PR74) Docs/Add a tutorial notebook - legacy to GEMS converter#199
GuillaumeMaistre wants to merge 40 commits into
mainfrom
docs/tuto-antares-legacy-converter

Conversation

@GuillaumeMaistre

Copy link
Copy Markdown
Collaborator

Process ID

Process:
DOC-02

Description

Solves issue #181

It adds :

Impact Analysis

It adds a new e2e test for validating the tutorial notebook behavior

Checklist

  • E2E tests pass (or confirmed not affected)
  • Library version bumped if library changed (library.version in libraries/<library>.yml)
  • Changelog entry added if library changed (libraries/CHANGELOG-<library>.md)
  • Release notes entry added if language-level change (doc/0_Home/4_release_notes.md)
  • Compatibility matrix updated if applicable (COMPATIBILITY.md)
  • Documentation updated or confirmed up to date
  • AGENTS.md reviewed for impact and updated if needed

@GuillaumeMaistre GuillaumeMaistre added documentation Improvements or additions to documentation rtei labels Jul 13, 2026
@GuillaumeMaistre GuillaumeMaistre linked an issue Jul 13, 2026 that may be closed by this pull request
20 tasks
@GuillaumeMaistre GuillaumeMaistre changed the title Docs/tuto antares legacy converter [WIP] (PR74) Docs/Add a tutorial notebook - legacy to GEMS converter Jul 13, 2026
@GuillaumeMaistre

Copy link
Copy Markdown
Collaborator Author

I encountered this error from GemsPy v0.1.3 inside the notebook :

code :

from gems_craft.study.folder import load_study
 
study = load_study(study_dir)

error :

---------------------------------------------------------------------------
ValidationError                           Traceback (most recent call last)
File ~/Documents/GEMS/GEMS/.venv/lib/python3.12/site-packages/gems_craft/model/parsing.py:126, in parse_yaml_library(input, schema)
    125 try:
--> 126     return schema.model_validate(tree["library"])
    127 except ValidationError as e:
 
File ~/Documents/GEMS/GEMS/.venv/lib/python3.12/site-packages/pydantic/main.py:732, in BaseModel.model_validate(cls, obj, strict, extra, from_attributes, context, by_alias, by_name)
    727     raise PydanticUserError(
    728         'At least one of `by_alias` or `by_name` must be set to True.',
    729         code='validate-by-alias-and-name-false',
    730     )
--> 732 return cls.__pydantic_validator__.validate_python(
    733     obj,
    734     strict=strict,
    735     extra=extra,
    736     from_attributes=from_attributes,
    737     context=context,
    738     by_alias=by_alias,
    739     by_name=by_name,
    740 )
 
ValidationError: 1 validation error for LibrarySchema
port-types.0.area-connection
  Extra inputs are not permitted [type=extra_forbidden, input_value={'injection-to-balance': ...ied-energy-bound': None}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.13/v/extra_forbidden
 
During handling of the above exception, another exception occurred:
 
ValueError                                Traceback (most recent call last)
Cell In[7], line 10
      6 
      7 study_dir = output_path / study.name
      8 
      9 print("STUDY LOADING")
---> 10 study = load_study(study_dir)
     11 print("\tStudy loaded")
     12 
     13 optim_config = OptimConfig(
 
File ~/Documents/GEMS/GEMS/.venv/lib/python3.12/site-packages/gems_craft/study/folder.py:46, in load_study(study_dir)
     44 for lib_file in lib_folder.glob("*.yml"):
     45     with lib_file.open() as lib:
---> 46         input_libraries.append(parse_yaml_library(lib))
     48 with system_file.open() as c:
     49     input_study = parse_yaml_system(c)
 
File ~/Documents/GEMS/GEMS/.venv/lib/python3.12/site-packages/gems_craft/model/parsing.py:128, in parse_yaml_library(input, schema)
    126     return schema.model_validate(tree["library"])
    127 except ValidationError as e:
--> 128     raise ValueError(f"An error occurred during parsing: {e}")
 
ValueError: An error occurred during parsing: 1 validation error for LibrarySchema
port-types.0.area-connection
  Extra inputs are not permitted [type=extra_forbidden, input_value={'injection-to-balance': ...ied-energy-bound': None}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.13/v/extra_forbidden

@GuillaumeMaistre

GuillaumeMaistre commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

I encountered this error from GemsPy v0.1.3 inside the notebook :
[...]

I used a deprecated antares-legacy-models library without this area-connection part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation rtei

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOC-02] Add tutorial antares-legacy to GEMS converter

1 participant