scaffold.data.artifact_manager.artifact_id_manager ================================================== .. py:module:: scaffold.data.artifact_manager.artifact_id_manager Attributes ---------- .. autoapisummary:: scaffold.data.artifact_manager.artifact_id_manager.FILESYSTEM scaffold.data.artifact_manager.artifact_id_manager.logger Functions --------- .. autoapisummary:: scaffold.data.artifact_manager.artifact_id_manager.get_new_afid scaffold.data.artifact_manager.artifact_id_manager.validate_input_afid scaffold.data.artifact_manager.artifact_id_manager.validate_or_generate_target_afid Module Contents --------------- .. py:function:: get_new_afid(artifact_manager: scaffold.data.artifact_manager.base.ArtifactManager, prefix: str = None) -> str Get a new artifact id. The identifiers are triplets of random words, to make them more distinguishable for the human eye, plus the timestamp to ensure uniqueness. Optionally, a prefix can be added to the id. :param prefix: String to be added to the uid, empty by default :returns: String in form of prefix__new_id__timestamp .. py:function:: validate_input_afid(artifact_manager: scaffold.data.artifact_manager.base.ArtifactManager, afid: str) -> None Validates input afid, i.e. an afid that is meant to be existing in the artifact store, as it is needed as input to a entrypoint. :param afid: An artifact id that is supposed to be existing in the artifact store. :raises ValueError if an afid was given, but it does not exist in the artifact store.: .. py:function:: validate_or_generate_target_afid(artifact_manager: scaffold.data.artifact_manager.base.ArtifactManager, afid: Optional[str] = None, prefix: Optional[str] = None) -> str Validates a given target afid or generates a new one. Takes the given afid and checks its validity, raises a ValueError if not. If the given afid is None, a new afid is returned with the optional prefix. Can be used when validating any afid parameters that are meant for targets. Target afids refer to the ids for artifacts that will be generated by your entrypoint and therefore should not exist yet, in contrast to "input afids" which are ids for artifacts an entrypoint needs as input to do something, and therefore _should_ exist in the artifact store. :param afid: An artifact id that is supposed to be not used yet on the server, default None. :param prefix: Only used when afid is None. Will be the prefix of the new afid. :raises ValueError if an afid was given, but it already exists in the artifact store.: :returns: Either the given afid if its valid, or a new one. .. py:data:: FILESYSTEM .. py:data:: logger