mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
Warn when calling Task.force_requirements_env_freeze()/Task.force_store_standalone_script() after Task.init() (#1425)
Some checks failed
CodeQL / Analyze (python) (push) Has been cancelled
Some checks failed
CodeQL / Analyze (python) (push) Has been cancelled
This commit is contained in:
parent
52e0538182
commit
ecfd2b46f4
@ -2539,6 +2539,11 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
|||||||
:param requirements_file: (Optional) Pass a requirements.txt file to specify the required packages (instead of
|
:param requirements_file: (Optional) Pass a requirements.txt file to specify the required packages (instead of
|
||||||
``pip freeze`` or automatic analysis). This will overwrite any existing requirement listing.
|
``pip freeze`` or automatic analysis). This will overwrite any existing requirement listing.
|
||||||
"""
|
"""
|
||||||
|
if not running_remotely() and hasattr(cls, "current_task") and cls.current_task():
|
||||||
|
get_logger("task").warning(
|
||||||
|
"Requirements env freeze ignored, "
|
||||||
|
"Task.force_requirements_env_freeze() must be called before Task.init()"
|
||||||
|
)
|
||||||
cls._force_use_pip_freeze = requirements_file if requirements_file else bool(force)
|
cls._force_use_pip_freeze = requirements_file if requirements_file else bool(force)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -2551,6 +2556,11 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
|||||||
|
|
||||||
:param force: Set force storing the main python file as a single standalone script
|
:param force: Set force storing the main python file as a single standalone script
|
||||||
"""
|
"""
|
||||||
|
if not running_remotely() and hasattr(cls, "current_task") and cls.current_task():
|
||||||
|
get_logger("task").warning(
|
||||||
|
"Store standalone script ignored, "
|
||||||
|
"Task.force_store_standalone_script() must be called before Task.init()"
|
||||||
|
)
|
||||||
cls._force_store_standalone_script = bool(force)
|
cls._force_store_standalone_script = bool(force)
|
||||||
|
|
||||||
def _set_random_seed_used(self, random_seed: Optional[int]) -> ():
|
def _set_random_seed_used(self, random_seed: Optional[int]) -> ():
|
||||||
|
Loading…
Reference in New Issue
Block a user