Skip to content

Commit

Permalink
feat(api): fixed typing and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Salem SAOUDI committed Dec 5, 2024
1 parent 0ab1a40 commit 90d5172
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/antares/model/study.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def create_variant_api(api_config: APIconf, study_id: str, variant_name: str) ->
api_config: API configuration
study_id: The id of the study to create a variant of
variant_name: the name of the new variant
Returns: The variant in the form of a Study object
"""
factory = ServiceFactory(api_config, study_id)
api_service = factory.create_study_service()
Expand Down Expand Up @@ -304,10 +305,15 @@ def create_variant(self, variant_name: str) -> "Study":
Args:
variant_name: the name of the new variant
Returns: The variant in the form of a Study object
"""
variant_id = self._study_service.create_variant(variant_name)
config = self._study_service.config
variant = read_study_api(config, variant_id)

if isinstance(config, APIconf):
variant = read_study_api(config, variant_id)
else:
raise TypeError("Expected config to be of type APIconf")

return variant

Expand Down
1 change: 1 addition & 0 deletions src/antares/service/base_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ def create_variant(self, variant_name: str) -> str:
Args:
variant_name: the name of the new variant
Returns: id of the variant
"""
pass

Expand Down

0 comments on commit 90d5172

Please sign in to comment.