Skip to content

Commit 99ef319

Browse files
committed
Added comments.
1 parent 066d555 commit 99ef319

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

ads/model/datascience_model_group.py

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,24 @@ def create(
473473
max_wait_time: int = DEFAULT_WAIT_TIME,
474474
poll_interval: int = DEFAULT_POLL_INTERVAL,
475475
) -> "DataScienceModelGroup":
476+
"""Creates the datascience model group.
477+
478+
Parameters
479+
----------
480+
wait_for_completion: bool
481+
Flag set for whether to wait for model group to be created before proceeding.
482+
Defaults to True.
483+
max_wait_time: int
484+
Maximum amount of time to wait in seconds (Defaults to 1200).
485+
Negative implies infinite wait time.
486+
poll_interval: int
487+
Poll interval in seconds (Defaults to 10).
488+
489+
Returns
490+
-------
491+
DataScienceModelGroup
492+
The instance of DataScienceModelGroup.
493+
"""
476494
response = self.dsc_model_group.create(
477495
create_model_group_details=CreateModelGroupDetails(
478496
**batch_convert_case(self._build_model_group_details(), "snake")
@@ -568,9 +586,28 @@ def update(
568586
max_wait_time: int = DEFAULT_WAIT_TIME,
569587
poll_interval: int = DEFAULT_POLL_INTERVAL,
570588
) -> "DataScienceModelGroup":
589+
"""Updates a datascience model group.
590+
591+
Parameters
592+
----------
593+
wait_for_completion: bool
594+
Flag set for whether to wait for model group to be updated before proceeding.
595+
Defaults to True.
596+
max_wait_time: int
597+
Maximum amount of time to wait in seconds (Defaults to 1200).
598+
Negative implies infinite wait time.
599+
poll_interval: int
600+
Poll interval in seconds (Defaults to 10).
601+
602+
Returns
603+
-------
604+
DataScienceModelGroup
605+
The instance of DataScienceModelGroup.
606+
"""
571607
update_model_group_details = OCIDataScienceModelGroup(
572608
**self._build_model_group_details()
573609
).to_oci_model(UpdateModelGroupDetails)
610+
574611
response = self.dsc_model_group.update(
575612
update_model_group_details=update_model_group_details,
576613
wait_for_completion=wait_for_completion,
@@ -586,6 +623,24 @@ def activate(
586623
max_wait_time: int = DEFAULT_WAIT_TIME,
587624
poll_interval: int = DEFAULT_POLL_INTERVAL,
588625
) -> "DataScienceModelGroup":
626+
"""Activates a datascience model group.
627+
628+
Parameters
629+
----------
630+
wait_for_completion: bool
631+
Flag set for whether to wait for model group to be activated before proceeding.
632+
Defaults to True.
633+
max_wait_time: int
634+
Maximum amount of time to wait in seconds (Defaults to 1200).
635+
Negative implies infinite wait time.
636+
poll_interval: int
637+
Poll interval in seconds (Defaults to 10).
638+
639+
Returns
640+
-------
641+
DataScienceModelGroup
642+
The instance of DataScienceModelGroup.
643+
"""
589644
response = self.dsc_model_group.activate(
590645
wait_for_completion=wait_for_completion,
591646
max_wait_time=max_wait_time,
@@ -600,6 +655,24 @@ def deactivate(
600655
max_wait_time: int = DEFAULT_WAIT_TIME,
601656
poll_interval: int = DEFAULT_POLL_INTERVAL,
602657
) -> "DataScienceModelGroup":
658+
"""Deactivates a datascience model group.
659+
660+
Parameters
661+
----------
662+
wait_for_completion: bool
663+
Flag set for whether to wait for model group to be deactivated before proceeding.
664+
Defaults to True.
665+
max_wait_time: int
666+
Maximum amount of time to wait in seconds (Defaults to 1200).
667+
Negative implies infinite wait time.
668+
poll_interval: int
669+
Poll interval in seconds (Defaults to 10).
670+
671+
Returns
672+
-------
673+
DataScienceModelGroup
674+
The instance of DataScienceModelGroup.
675+
"""
603676
response = self.dsc_model_group.deactivate(
604677
wait_for_completion=wait_for_completion,
605678
max_wait_time=max_wait_time,
@@ -614,6 +687,24 @@ def delete(
614687
max_wait_time: int = DEFAULT_WAIT_TIME,
615688
poll_interval: int = DEFAULT_POLL_INTERVAL,
616689
) -> "DataScienceModelGroup":
690+
"""Deletes a datascience model group.
691+
692+
Parameters
693+
----------
694+
wait_for_completion: bool
695+
Flag set for whether to wait for model group to be deleted before proceeding.
696+
Defaults to True.
697+
max_wait_time: int
698+
Maximum amount of time to wait in seconds (Defaults to 1200).
699+
Negative implies infinite wait time.
700+
poll_interval: int
701+
Poll interval in seconds (Defaults to 10).
702+
703+
Returns
704+
-------
705+
DataScienceModelGroup
706+
The instance of DataScienceModelGroup.
707+
"""
617708
response = self.dsc_model_group.delete(
618709
wait_for_completion=wait_for_completion,
619710
max_wait_time=max_wait_time,
@@ -667,6 +758,18 @@ def list(
667758

668759
@classmethod
669760
def from_id(cls, model_group_id: str) -> "DataScienceModelGroup":
761+
"""Loads the model group instance from ocid.
762+
763+
Parameters
764+
----------
765+
model_group_id: str
766+
The ocid of model group.
767+
768+
Returns
769+
-------
770+
DataScienceModelGroup
771+
The DataScienceModelGroup instance (self).
772+
"""
670773
oci_model_group = OCIDataScienceModelGroup.from_id(model_group_id)
671774
return cls()._update_from_oci_model(oci_model_group)
672775

0 commit comments

Comments
 (0)