-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
live logs initial #4902
live logs initial #4902
Conversation
77a6f4e
to
0e0c54a
Compare
if tree.isdir(path_info): | ||
plot_files = [] | ||
for pi in tree.walk_files(path_info): | ||
plot_files.append( | ||
(pi, relpath(pi, self.repo.root_dir)) | ||
) | ||
else: | ||
plot_files = [ | ||
(path_info, relpath(path_info, self.repo.root_dir)) | ||
] | ||
|
||
for path, repo_path in plot_files: | ||
data[rev].update({repo_path: {"props": props}}) | ||
|
||
# Load data from git or dvc cache | ||
try: | ||
with tree.open(path) as fd: | ||
data[rev][repo_path]["data"] = fd.read() | ||
except FileNotFoundError: | ||
# This might happen simply because cache is absent | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We start to support dir
plots: all the files in the directory marked as plots
will be treated the same way, and additional config provided with dvc plots modify
will be applied to each one of them.
I intend to write support for "granular" config in such use case, though it will probably require some reworking on dvc.yaml
side and is not essential to make logs/live metrics work.
0c98b9f
to
0da7756
Compare
d4527cd
to
96d4168
Compare
a2fafda
to
9fa336f
Compare
dvc/api/dvclive.py
Outdated
def summary(path: str, revs: List[str] = None): | ||
try: | ||
root = Repo.find_root() | ||
except NotDvcRepoError: | ||
root = os.getcwd() | ||
|
||
Repo(root_dir=root, uninitialized=True).logs.summarize(path, revs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we need that after introducing live
command. Might get deleted later.
dvc/command/logs.py
Outdated
logger = logging.getLogger(__name__) | ||
|
||
|
||
class CmdLogs(CmdBase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this command for a scenarion as in iterative/dvclive#7
dvc/repo/logs.py
Outdated
logger = logging.getLogger(__name__) | ||
|
||
|
||
class Logs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming dvclive
/logs
is not set in stone. It will probably be changed. Ideas are welcomed.
Co-authored-by: Ruslan Kuprieiev <[email protected]>
Co-authored-by: Ruslan Kuprieiev <[email protected]>
Co-authored-by: Ruslan Kuprieiev <[email protected]>
β I have followed the Contributing to DVC checklist.
π If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Thank you for the contribution - we'll try to review it as soon as possible. π
Related to iterative/dvc.org#1966