From 0d6b2239bdb55d4c1a59605d5bea65f722c899c8 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Mon, 17 Feb 2020 20:53:19 -0600 Subject: [PATCH 1/2] api: update to latest definitions to match iterative/dvc.org/pull/908 --- dvc/api.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dvc/api.py b/dvc/api.py index def9e8cf5b..ed3a77e16e 100644 --- a/dvc/api.py +++ b/dvc/api.py @@ -18,10 +18,10 @@ def __init__(self, url): def get_url(path, repo=None, rev=None, remote=None): - """ - Returns the full URL to the data artifact specified by its `path` in a - `repo`. - NOTE: There is no guarantee that the file actually exists in that location. + """Returns URL to the storage location of a data artifact tracked + by DVC, specified by its path in a repo. + + NOTE: There's no guarantee that the file actually exists in that location. """ with _make_repo(repo, rev=rev) as _repo: _require_dvc(_repo) @@ -31,7 +31,7 @@ def get_url(path, repo=None, rev=None, remote=None): def open(path, repo=None, rev=None, remote=None, mode="r", encoding=None): - """Context manager to open a file artifact as a file object.""" + """Context manager to open a tracked file as a file object.""" args = (path,) kwargs = { "repo": repo, @@ -63,7 +63,7 @@ def _open(path, repo=None, rev=None, remote=None, mode="r", encoding=None): def read(path, repo=None, rev=None, remote=None, mode="r", encoding=None): - """Returns the contents of a file artifact.""" + """Returns the contents of a tracked file.""" with open( path, repo=repo, rev=rev, remote=remote, mode=mode, encoding=encoding ) as fd: @@ -84,5 +84,6 @@ def _make_repo(repo_url=None, rev=None): def _require_dvc(repo): + """Raises UrlNotDvcRepoError if repo is not a DVC repository.""" if not isinstance(repo, Repo): raise UrlNotDvcRepoError(repo.url) From 6b14cef8327dc46be4721825aeceae52dfa9f259 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sun, 23 Feb 2020 06:34:04 +0200 Subject: [PATCH 2/2] Update dvc/api.py --- dvc/api.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dvc/api.py b/dvc/api.py index ed3a77e16e..d1312baaf3 100644 --- a/dvc/api.py +++ b/dvc/api.py @@ -84,6 +84,5 @@ def _make_repo(repo_url=None, rev=None): def _require_dvc(repo): - """Raises UrlNotDvcRepoError if repo is not a DVC repository.""" if not isinstance(repo, Repo): raise UrlNotDvcRepoError(repo.url)