Ë ±L i ãó—ddlmZddlmZddlmZddlZddlZddlZddlZddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZd Zd ZeGd „d««Ze gd¢dd¬«ddddœ dd„«Zy)é)Ú annotations)Úasdict)Ú dataclassN)Úconvert_positional_args)Ú ArtifactStore)Ú BaseStorage)ÚStudy)Ú FrozenTrial)ÚTrialz artifacts:zapplication/octet-streamcó:—eZdZUdZded<ded<ded<ded<y) Ú ArtifactMetaaþMeta information for an artifact. .. note:: All the artifact meta linked to a study or trial can be listed by :func:`~optuna.artifacts.get_all_artifact_meta`. The artifact meta can be used for :func:`~optuna.artifacts.download_artifact`. Args: artifact_id: The identifier of the artifact. filename: The artifact file name used for the upload. mimetype: A MIME type of the artifact. If not specified, the MIME type is guessed from the file extension. encoding: An encoding of the artifact, which is suitable for use as a Content-Encoding header, e.g., gzip. If not specified, the encoding is guessed from the file extension. ÚstrÚ artifact_idÚfilenameÚmimetypeú str | NoneÚencodingN)Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú__annotations__©óú^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/optuna/artifacts/_upload.pyr r s…ñð(ÓØƒM؃MØÔrr )Ústudy_or_trialÚ file_pathÚartifact_storez4.0.0z6.0.0)Úprevious_positional_arg_namesÚdeprecated_versionÚremoved_version)Ústoragerrc ó—tjj|«}t|t«r|€ |j }nt|t «r|€ |j}|€ td«‚ttj««}tj|«\}} t|||xs |xst|xs| ¬«} t |z} t|tt"f«r<|j$} |j'| | t)j*t-| «««n;|j.} |j1| | t)j*t-| «««t3|d«5}|j5||«ddd«|S#1swY|SxYw)asUpload an artifact to the artifact store. Args: artifact_store: An artifact store. file_path: A path to the file to be uploaded. study_or_trial: A :class:`~optuna.trial.Trial` object, a :class:`~optuna.trial.FrozenTrial`, or a :class:`~optuna.study.Study` object. storage: A storage object. This argument is required only if ``study_or_trial`` is :class:`~optuna.trial.FrozenTrial`. mimetype: A MIME type of the artifact. If not specified, the MIME type is guessed from the file extension. encoding: An encoding of the artifact, which is suitable for use as a ``Content-Encoding`` header (e.g. gzip). If not specified, the encoding is guessed from the file extension. Returns: An artifact ID. Nz$storage is required for FrozenTrial.)rrrrÚrb)ÚosÚpathÚbasenameÚ isinstancer r"r Ú_storageÚ ValueErrorrÚuuidÚuuid4Ú mimetypesÚ guess_typer ÚDEFAULT_MIME_TYPEÚARTIFACTS_ATTR_PREFIXr Ú _trial_idÚset_trial_system_attrÚjsonÚdumpsrÚ _study_idÚset_study_system_attrÚopenÚwrite)rrrr"rrrrÚguess_mimetypeÚguess_encodingÚartifactÚattr_keyÚtrial_idÚstudy_idÚfs rÚupload_artifactr@2sP€ôLw‰w×Ñ  Ó*€Hä.¤%Ô(¨W¨_Ø ×(Ñ(‰Ü N¤EÔ *¨w¨Ø ×)Ñ)ˆà€ÜÐ?Ó@Ð@ä”d—j‘j“lÓ#€KÜ%.×%9Ñ%9¸(Ó%CÑ"€NNÜØØØÒ@˜^Ò@Ô/@ØÒ+˜^ô €Hô % {Ñ2€HÜ.¤5¬+Ð"6Ô7Ø!×+Ñ+ˆØ×%Ñ% h°¼$¿*¹*ÄVÈHÓEUÓ:VÕWà!×+Ñ+ˆØ×%Ñ% h°¼$¿*¹*ÄVÈHÓEUÓ:VÔWä ˆi˜Ó ð- !Ø×ј[¨!Ô,÷-à Ð÷-à Ðús Å E=Å=F)rrrrrzTrial | FrozenTrial | Studyr"zBaseStorage | NonerrrrÚreturnr)Ú __future__rÚ dataclassesrrr3r-r%r+Úoptuna._convert_positional_argsrÚoptuna.artifacts._protocolrÚoptuna.storagesrÚ optuna.studyr Ú optuna.trialr r r0r/r r@rrrúrIsÄðÝ"åÝ!Û ÛÛ Û åCÝ4Ý'ÝÝ$Ýð%ÐØ.Ðð ÷ðó ðñ6Ú"SØØôð#'ØØñ=à!ð=ðð=ð0ð =ð  ð =ð ð =ðð=ð ò=ó ñ =r