Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added JSON import and export capabilities to TargetPlatformModel #1311

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

lior-dikstein
Copy link
Collaborator

@lior-dikstein lior-dikstein commented Jan 5, 2025

Added the 'load_target_platform_model' and 'export_target_platform_model' functions to import and export 'TargetPlatformModel' instances to JSON files with robust validation and error handling. It also includes comprehensive tests for both the 'export_target_platform_model' and 'load_target_platform_model' functions, covering valid use cases, edge cases, and error scenarios.

Pull Request Description:

Checklist before requesting a review:

  • I set the appropriate labels on the pull request.
  • I have added/updated the release note draft (if necessary).
  • I have updated the documentation to reflect my changes (if necessary).
  • All function and files are well documented.
  • All function and classes have type hints.
  • There is a licenses in all file.
  • The function and variable names are informative.
  • I have checked for code duplications.
  • I have added new unittest (if necessary).

…el functions to import and export TargetPlatformModel instances to JSON files with robust validation and error handling. It also includes comprehensive tests for both the 'export_target_platform_model' and 'load_target_platform_model' functions, covering valid use cases, edge cases, and error scenarios.
import json


def load_target_platform_model(tp_model_or_path: Union[TargetPlatformModel, str]) -> TargetPlatformModel:
Copy link
Collaborator

Choose a reason for hiding this comment

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

change tp model to tpc everywhere in this function (function, variables names, cimments...)
because we know that we are going to change the terminology, but this won't be changed automatically with the refactor to the class name

@ofirgo ofirgo removed the request for review from irenaby January 6, 2025 08:24
@lior-dikstein lior-dikstein merged commit cd6e3be into main Jan 6, 2025
42 checks passed
@lior-dikstein lior-dikstein deleted the tpc_refactor_phase5 branch January 6, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants