Skip to content

Commit

Permalink
docs(tags-db): improve docstring in StudyService
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-laporte-pro committed Feb 7, 2024
1 parent e95c3e3 commit aaaa37b
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions antarest/study/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
)
from antarest.core.filetransfer.model import FileDownloadTaskDTO
from antarest.core.filetransfer.service import FileTransferManager
from antarest.core.interfaces.cache import CacheConstants, ICache
from antarest.core.interfaces.cache import ICache
from antarest.core.interfaces.eventbus import Event, EventType, IEventBus
from antarest.core.jwt import DEFAULT_ADMIN_USER, JWTGroup, JWTUser
from antarest.core.model import JSON, SUB_JSON, PermissionInfo, PublicMode, StudyPermissionType
Expand Down Expand Up @@ -492,18 +492,19 @@ def _try_get_studies_information(self, study: Study) -> t.Optional[StudyMetadata

def get_study_information(self, uuid: str, params: RequestParameters) -> StudyMetadataDTO:
"""
Get study information
Args:
uuid: study uuid
params: request parameters
Retrieve study information.
Returns: study information
Args:
uuid: The UUID of the study.
params: The request parameters.
Returns:
Information about the study.
"""
study = self.get_study(uuid)
assert_permission(params.user, study, StudyPermissionType.READ)
logger.info("study %s metadata asked by user %s", uuid, params.get_user_id())
# todo debounce this with a "update_study_last_access" method updating only every some seconds
logger.info("Study metadata requested for study %s by user %s", uuid, params.get_user_id())
# TODO: Debounce this with an "update_study_last_access" method updating only every few seconds.
study.last_access = datetime.utcnow()
self.repository.save(study)
return self.storage_service.get_storage(study).get_study_information(study)
Expand Down Expand Up @@ -1994,14 +1995,15 @@ def _assert_study_unarchived(self, study: Study, raise_exception: bool = True) -

def _analyse_study(self, metadata: Study) -> StudyContentStatus:
"""
Analyze study integrity
Args:
metadata: study to analyze
Analyzes the integrity of a study.
Returns: VALID if study has any integrity mistakes.
WARNING if studies has mistakes.
ERROR if tree was not able to analyse structuree without raise error.
Args:
metadata: The study to analyze.
Returns:
- VALID if the study has no integrity issues.
- WARNING if the study has some issues.
- ERROR if the tree was unable to analyze the structure without raising an error.
"""
try:
if not isinstance(metadata, RawStudy):
Expand Down

0 comments on commit aaaa37b

Please sign in to comment.