This commit is contained in:
allegroai 2021-10-19 10:39:55 +03:00
parent 94d28ed44f
commit 0bc43a31f4
14 changed files with 37 additions and 32 deletions

View File

@ -12,7 +12,7 @@ from .datasets import Dataset
TaskTypes = Task.TaskTypes
if not PY2:
from .automation.controller import PipelineController
from .automation.controller import PipelineController # noqa: F401
__all__ = [
"__version__",

View File

@ -265,7 +265,7 @@ class Session(TokenManager):
print("Failed getting vaults: {}".format(ex))
def _apply_config_sections(self, local_logger):
# type: (_LocalLogger) -> None
# type: (_LocalLogger) -> None # noqa: F821
default = self.config.get("sdk.apply_environment", False)
if ENV_ENABLE_ENV_CONFIG_SECTION.get(default=default):
try:
@ -753,8 +753,8 @@ class Session(TokenManager):
)
class _LocalLogger:
def __init__(self, l):
self.logger = l
def __init__(self, local_logger):
self.logger = local_logger
def __call__(self):
if not self.logger:

View File

@ -1,4 +1,4 @@
from ....config import config, deferred_config
from ....config import deferred_config
class TaskStopReason(object):

View File

@ -3,7 +3,7 @@ from threading import Thread, Event
from time import time
from ....config import config, deferred_config
from ....config import deferred_config
from ....backend_interface.task.development.stop_signal import TaskStopSignal
from ....backend_api.services import tasks

View File

@ -13,7 +13,7 @@ from threading import Thread, Event
from .util import get_command_output, remove_user_pass_from_url
from ....backend_api import Session
from ....config import config, deferred_config
from ....config import deferred_config
from ....debugging import get_logger
from .detectors import GitEnvDetector, GitDetector, HgEnvDetector, HgDetector, Result as DetectionResult

View File

@ -63,7 +63,8 @@ def deferred_config(key=None, default=Config._MISSING, transform=None, multi=Non
next((ConfigSDKWrapper.get(*a) for a in multi if ConfigSDKWrapper.get(*a)), None))
if transform is None
else (transform() if key is None else transform(ConfigSDKWrapper.get(key, default) if not multi else # noqa
next((ConfigSDKWrapper.get(*a) for a in multi if ConfigSDKWrapper.get(*a)), None)))
next((ConfigSDKWrapper.get(*a) for a in multi
if ConfigSDKWrapper.get(*a)), None)))
)

View File

@ -174,9 +174,9 @@ class CacheManager(object):
# check if someone else holds the lock file
locks = lock_files.get(f.name, [])
for l in locks:
for lck in locks:
try:
a_lock = FileLock(filename=l)
a_lock = FileLock(filename=lck)
a_lock.acquire(timeout=0)
a_lock.release()
a_lock.delete_lock_file()

View File

@ -50,8 +50,8 @@ from .binding.matplotlib_bind import PatchedMatplotlib
from .binding.hydra_bind import PatchHydra
from .binding.click_bind import PatchClick
from .config import (
config, DEV_TASK_NO_REUSE, get_is_master_node, DEBUG_SIMULATE_REMOTE_TASK, PROC_MASTER_ID_ENV_VAR,
DEV_DEFAULT_OUTPUT_URI, deferred_config, )
config, DEV_TASK_NO_REUSE, get_is_master_node, DEBUG_SIMULATE_REMOTE_TASK, DEV_DEFAULT_OUTPUT_URI,
deferred_config, )
from .config import running_remotely, get_remote_task_id
from .config.cache import SessionCache
from .debugging.log import LoggerRoot
@ -1889,10 +1889,10 @@ class Task(_Task):
Set task's script.
Examples:
task.set_script(repository="https://github.com/allegroai/clearml.git",
branch="master",
working_dir="examples/reporting",
entry_point="artifacts.py")
task.set_script(repository='https://github.com/allegroai/clearml.git,
branch='master',
working_dir='examples/reporting',
entry_point='artifacts.py')
:param repository: URL of remote repository.
:param branch: Select specific repository branch / tag.

View File

@ -40,24 +40,26 @@ class Unparser:
self.f.flush()
def fill(self, text=""):
"Indent a piece of text, according to the current indentation level"
"""Indent a piece of text, according to the current indentation level"""
self.f.write("\n" + " " * self._indent + text)
def write(self, text):
"Append a piece of text to the current line."
"""Append a piece of text to the current line."""
self.f.write(six.text_type(text))
def enter(self):
"Print ':', and increase the indentation."
"""Print ':', and increase the indentation."""
self.write(":")
self._indent += 1
def leave(self):
"Decrease the indentation level."
"""Decrease the indentation level."""
self._indent -= 1
def dispatch(self, tree):
"Dispatcher function, dispatching tree type T to method _T."
"""
Dispatcher function, dispatching tree type T to method _T.
"""
if isinstance(tree, list):
for t in tree:
self.dispatch(t)
@ -65,12 +67,14 @@ class Unparser:
meth = getattr(self, "_" + tree.__class__.__name__)
meth(tree)
"""
############### Unparsing methods ######################
# There should be one method per concrete grammar type #
# Constructors should be grouped by sum type. Ideally, #
# this would follow the order in the grammar, but #
# currently doesn't. #
########################################################
"""
def _Module(self, tree):
for stmt in tree.body: