Skip to content

[DNMY] openapi ingestion part 1 - #5

Draft
jd-lara wants to merge 15 commits into
psy6from
jd/openapi_ingestion
Draft

[DNMY] openapi ingestion part 1#5
jd-lara wants to merge 15 commits into
psy6from
jd/openapi_ingestion

Conversation

@jd-lara

@jd-lara jd-lara commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

This is a first pass to populate the OpenAPI models from the table data. The PR extends the data we parse and uses the old way to populate time series data.

The parser is also reflecting some gaps in the source data that need to patched upstream

jd-lara added 15 commits July 31, 2026 15:52
Implement comprehensive OpenAPI schema support with 14 component modules:
- accessors, attributes: data extraction and attribute handling
- branch, dc_branch, generation, load: power system components
- cost, service, time_series: operational and time-dependent data
- build, container, identity, topology, units: structural support
- serialize: JSON serialization logic

Each module provides full coverage for its domain with proper type handling and validation.
Create full test coverage for OpenAPI components:
- 16 test modules covering all component types
- Acceptance tests validating end-to-end functionality
- Test infrastructure updates (Artifacts.toml, Project.toml)
- RTS descriptor configuration for testing

Tests verify schema compliance, data loading, serialization, and topology validation.
Include scripts for:
- build_psy5_reference.jl: Build reference data from PSY5 source
- compare_structure.jl: Validate structural consistency
- compare_values.jl: Validate data value consistency
- fix_rts_data.jl: RTS data correction utilities

These support development iteration and validation workflows.
- Add OpenAPI schema support dependencies to Project.toml
- Update power_system_inputs.json with OpenAPI schema definitions
- Refactor power system table data tests for improved coverage

Resolves compatibility with new OpenAPI-based data handling.
Document setup for PSY6 development with local PowerOpenAPI clone:
- Prerequisites and environment setup
- Instructions for cloning and configuring PowerOpenAPI.jl
- Script usage and workflow examples
- Notes on development utilities

Provides clear guidance for contributors working with OpenAPI integration.
Create utility script to load RTS-GMLC test data and export system JSON
in both SI and natural gas unit systems for manual verification and validation.

Script provides:
- Automatic loading of test data from LazyArtifacts
- System creation with proper error handling
- JSON export in both unit systems
- Metadata file for tracking exports

Usage: julia --project=. scripts/export_system_json.jl [output_dir]
Rename .claude/claude.md to .claude/CLAUDE.md. The lowercase name only
loaded because macOS is case-insensitive; on Linux and in CI it was
silently ignored.

Replace .claude/Sienna.md with the shared `sienna-psy6` skill, which loads
on invocation instead of being read in full every session. The 12 copies
across the psy6 workspace had drifted into 6 distinct versions.
Compose the canonical PC.SystemDocument instead of duplicating its state
(components, associations, ext, unit_system all move onto document); delete
serialize.jl's hand-rolled JSON envelope in favor of PC.write_document, which
restores honest ext emission; IdRegistry now delegates id allocation to
PC.next_id!(document) instead of keeping its own counter; emit base_power
(system base) on Area, LoadZone and TwoTerminalGenericHVDCLine, the types with
no device base of their own; route the TW/GW/kW, TWh/GWh/kWh and degree/radian
branches of convert_units! through PC.UNIT_VOCABULARY instead of hand-duplicated
literals, keeping the hour/minute/second conversions the schema deliberately
excludes from the vocabulary.
…ired-check test, inline single-use constants
…plementalAttributeAssociation

Service membership moved back to its own specialized table on the schema side.
add_service_association! now constructs PO.ServiceAssociation rows via a new
get_service_associations accessor, drops the attribute_type argument, and both
service.jl call sites drop it too. Thread the three new SystemDocument fields
(plant_associations, combined_cycle_associations, service_associations) through
serialize.jl's hand-copy constructor. Update tests that asserted on the old
unified-table shape and row counts.
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