Conversation
Ras container
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive schema documentation system and consolidates JSON schemas for the FFRD container specifications, with a focus on creating automated documentation generation for JSON schemas and establishing base image specifications.
- Creates automated schema documentation generation with cross-reference support
- Implements new base schemas for actions, data sources, and storage configurations
- Adds RAS v6.6.0 container implementation with unsteady simulation support
Reviewed Changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| reference/ras/v660/schemas/action.ras.run_unsteady_simulation.json | New schema defining RAS unsteady simulation action with input/output validation |
| reference/ras/v660/run_unsteady.py | Main execution script for RAS unsteady simulations with S3/FS support |
| reference/ras/v660/parsers/unsteady_simulation_config.py | Configuration parser with attribute substitution and dataclass definitions |
| reference/json_to_md.py | Schema documentation generator with reference resolution and markdown output |
| reference/base/validate.py | Updated JSON schema validator supporting Draft 2020-12 specification |
| reference/base/schemas/*.json | Base schema definitions for actions, data sources, and storage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| "description": "Schema for an unsteady HEC-RAS simulation action. Combines action metadata, attribute substitutions, input data sources, outputs, and store configuration.", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "./action.json#/$defs/Action" |
There was a problem hiding this comment.
The reference path './action.json#/$defs/Action' may not resolve correctly from this location. Based on the file structure, this should likely reference '../../base/schemas/action.json#/$defs/Action' to point to the base schemas directory.
| "$ref": "./action.json#/$defs/Action" | |
| "$ref": "../../base/schemas/action.json#/$defs/Action" |
| "type": "array", | ||
| "description": "Input data sources required for the unsteady simulation.", | ||
| "items": { | ||
| "$ref": "./data.json#/$defs/DataSource" |
There was a problem hiding this comment.
The reference path './data.json#/$defs/DataSource' may not resolve correctly from this location. Based on the file structure, this should likely reference '../../base/schemas/data.json#/$defs/DataSource' to point to the base schemas directory.
| "$ref": "./data.json#/$defs/DataSource" | |
| "$ref": "../../base/schemas/data.json#/$defs/DataSource" |
| "type": "array", | ||
| "description": "Output data sources produced by the unsteady simulation.", | ||
| "items": { | ||
| "$ref": "./data.json#/$defs/DataSource" |
There was a problem hiding this comment.
The reference path './data.json#/$defs/DataSource' may not resolve correctly from this location. Based on the file structure, this should likely reference '../../base/schemas/data.json#/$defs/DataSource' to point to the base schemas directory.
| # local_paths = output.create_local_output_paths(local_source) | ||
|
|
||
| # # Get the file types dynamically from the OutputPaths object | ||
| # file_types = [field.name for field in fields(output.paths) if getattr(output.paths, field.name)] | ||
|
|
||
| # # Process the files for upload | ||
| # try: | ||
| # for file_type in file_types: | ||
| # local_path = local_paths[file_type] | ||
| # if not local_path or not os.path.exists(local_path): | ||
| # print(f"❌ Local file not found: {local_path}") | ||
| # return False | ||
| # s3_path = f"s3://{output.store_root}/{getattr(output.paths, file_type)}" | ||
| # subprocess.call([UPLOAD, s3_path, "--path", local_path]) | ||
|
|
||
| # except Exception as e: | ||
| # print(f"❌ Error uploading files for output '{output_name}': {e}") | ||
| # return False | ||
|
|
||
| # return True | ||
|
|
||
|
|
There was a problem hiding this comment.
Large block of commented code should be removed rather than left in the codebase. If this functionality might be needed later, consider using version control history or creating a separate branch.
| # local_paths = output.create_local_output_paths(local_source) | |
| # # Get the file types dynamically from the OutputPaths object | |
| # file_types = [field.name for field in fields(output.paths) if getattr(output.paths, field.name)] | |
| # # Process the files for upload | |
| # try: | |
| # for file_type in file_types: | |
| # local_path = local_paths[file_type] | |
| # if not local_path or not os.path.exists(local_path): | |
| # print(f"❌ Local file not found: {local_path}") | |
| # return False | |
| # s3_path = f"s3://{output.store_root}/{getattr(output.paths, file_type)}" | |
| # subprocess.call([UPLOAD, s3_path, "--path", local_path]) | |
| # except Exception as e: | |
| # print(f"❌ Error uploading files for output '{output_name}': {e}") | |
| # return False | |
| # return True |
| #!/usr/bin/env python3 | ||
| """ | ||
| JSON Schema Validator for RAS simulation schemas | ||
| Supports JSON Schema Draft 2020-12 with latest jsonschema librarys |
There was a problem hiding this comment.
Spelling error: 'librarys' should be 'libraries'.
| Supports JSON Schema Draft 2020-12 with latest jsonschema librarys | |
| Supports JSON Schema Draft 2020-12 with latest jsonschema libraries |
| "$id": "./action.json", | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "title": "Action", | ||
| "description": "A generic action (e.g. model simulatuion, data or transformation step) with typed inputs/outputs, parameterized paths, and optional operator parameters. See specific action schemas for specialized actions, attrubutes, and parameters.", |
There was a problem hiding this comment.
Multiple spelling errors in the description: 'simulatuion' should be 'simulation' and 'attrubutes' should be 'attributes'.
| "description": "A generic action (e.g. model simulatuion, data or transformation step) with typed inputs/outputs, parameterized paths, and optional operator parameters. See specific action schemas for specialized actions, attrubutes, and parameters.", | |
| "description": "A generic action (e.g. model simulation, data or transformation step) with typed inputs/outputs, parameterized paths, and optional operator parameters. See specific action schemas for specialized actions, attributes, and parameters.", |
| "description": "Map of domain keys to in-file selectors (optional unless required by the specific action)." | ||
| }, | ||
| "store": { | ||
| "$ref": "file:///app/schemas/store.json", |
There was a problem hiding this comment.
The absolute file path reference 'file:///app/schemas/store.json' is likely incorrect and will not resolve properly. This should use a relative reference like './store.json#/$defs/Store' to match the pattern used elsewhere.
| "$ref": "file:///app/schemas/store.json", | |
| "$ref": "./store.json#/$defs/Store", |
| @@ -0,0 +1,25 @@ | |||
| # Action | |||
|
|
|||
| A generic action (e.g. model simulatuion, data or transformation step) with typed inputs/outputs, parameterized paths, and optional operator parameters. See specific action schemas for specialized actions, attrubutes, and parameters. | |||
There was a problem hiding this comment.
Multiple spelling errors in the description: 'simulatuion' should be 'simulation' and 'attrubutes' should be 'attributes'.
| A generic action (e.g. model simulatuion, data or transformation step) with typed inputs/outputs, parameterized paths, and optional operator parameters. See specific action schemas for specialized actions, attrubutes, and parameters. | |
| A generic action (e.g. model simulation, data or transformation step) with typed inputs/outputs, parameterized paths, and optional operator parameters. See specific action schemas for specialized actions, attributes, and parameters. |
Co-authored-by: Brendan Barnes <brendan.barnes856@gmail.com>
Add GitHub Actions workflows for building and testing FFRD images
Summary
This PR implements a comprehensive schema documentation system and consolidates JSON schemas for the FFRD container specifications. The main focus is on creating automated documentation generation for JSON schemas and establishing a solid foundation for base image specifications.
Key Features Added
Automated Schema Documentation Generation
json_to_md.pyscript for converting JSON schemas to markdown documentation$reflinks between schemasSchema Structure Improvements
reference/base/schemas/:action.json- Base action schema with common propertiesdata.json- Data path and source definitionsstore.json- Storage configuration schemareference/ras/v660/schemas/:action.ras.run_unsteady_simulation.json- Extends base action for RAS workflowsDocumentation Enhancements
Infrastructure Updates
Schema Documentation Links
The generated documentation now includes:
docs/draft/base_image/docs/draft/ras_sim/Files Changed
Testing