Skip to content
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

Merged
merged 60 commits into from
Jan 4, 2021
Merged

live logs initial #4902

merged 60 commits into from
Jan 4, 2021

Conversation

pared
Copy link
Contributor

@pared pared commented Nov 16, 2020

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

Related to iterative/dvc.org#1966

@pared pared force-pushed the dvclive branch 2 times, most recently from 77a6f4e to 0e0c54a Compare November 20, 2020 12:58
Comment on lines +60 to +89
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
Copy link
Contributor Author

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.

@pared pared force-pushed the dvclive branch 3 times, most recently from 0c98b9f to 0da7756 Compare November 23, 2020 12:01
@pared pared changed the title [WIP] live logs initial live logs initial Nov 23, 2020
@pared pared marked this pull request as ready for review November 23, 2020 12:02
@pared pared changed the title live logs initial [WIP] live logs initial Nov 24, 2020
@pared pared force-pushed the dvclive branch 8 times, most recently from d4527cd to 96d4168 Compare November 25, 2020 16:19
@pared pared force-pushed the dvclive branch 5 times, most recently from a2fafda to 9fa336f Compare November 27, 2020 17:57
Comment on lines 8 to 14
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)
Copy link
Contributor Author

@pared pared Nov 27, 2020

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.

logger = logging.getLogger(__name__)


class CmdLogs(CmdBase):
Copy link
Contributor Author

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:
Copy link
Contributor Author

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.

@pared pared changed the title [WIP] live logs initial live logs initial Nov 27, 2020
@pared pared requested review from skshetry and pmrowla November 27, 2020 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants