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

Implement log_artifact method for live #464

Merged
merged 8 commits into from
Mar 9, 2023
Merged

Conversation

karajan1001
Copy link
Contributor

@karajan1001 karajan1001 commented Feb 15, 2023

fix: #378


# train.py
import time
from pathlib import Path

from dvclive import Live

Path("data").write_text(str(time.time()))
with Live(save_dvc_exp=True) as live:
    live.log_artifact("data")
$ git init
$ dvc init
$ git add train.py
$ git commit -m "init"
$ python train.py
$ git show 6d1a79f
commit 6d1a79fa891e3582a6a9ef93f4e826e5eee5bbe4 (refs/exps/ad/10dbdb6aa0c13b73f48ed8416a65dd57d94899/duddy-yews)
Author: David de la Iglesia Castro <[email protected]>
Date:   Mon Feb 20 15:23:14 2023 +0100

    dvc: commit experiment duddy-yews

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3af0ccb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/data
diff --git a/data.dvc b/data.dvc
new file mode 100644
index 0000000..3088b76
--- /dev/null
+++ b/data.dvc
@@ -0,0 +1,4 @@
+outs:
+- md5: 11d1fcb11076f6c57252cc495d65fb9a
+  size: 17
+  path: data

@karajan1001 karajan1001 requested a review from daavoo February 15, 2023 08:10
daavoo
daavoo previously requested changes Feb 15, 2023
src/dvclive/live.py Outdated Show resolved Hide resolved
src/dvclive/live.py Outdated Show resolved Hide resolved
src/dvclive/live.py Outdated Show resolved Hide resolved
tests/test_dvc.py Outdated Show resolved Hide resolved
src/dvclive/live.py Outdated Show resolved Hide resolved
- Don't use `commit`
- Don't raise error
- Add `test_log_artifact`
@daavoo daavoo dismissed their stale review February 20, 2023 14:10

Outdated

@daavoo daavoo requested a review from dberenbaum February 20, 2023 14:21
@dberenbaum
Copy link
Collaborator

@daavoo Sorry for the potential change in direction here, but I worry it's not very useful to add a .dvc file:

  • Inside pipelines, this doesn't make sense.
  • Without pipelines, it makes the transition to pipelines harder.

See #468 for an alternative to help with the pipeline transition. We could keep the initial scope narrow to not completely block log_artifact if we can agree on the direction.

Copy link
Collaborator

@dberenbaum dberenbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dberenbaum
Copy link
Collaborator

@daavoo Sorry for the potential change in direction here, but I worry it's not very useful to add a .dvc file:

* Inside pipelines, this doesn't make sense.

* Without pipelines, it makes the transition to pipelines harder.

See #468 for an alternative to help with the pipeline transition. We could keep the initial scope narrow to not completely block log_artifact if we can agree on the direction.

Discussed with @daavoo to not block to wait for #468. Inside pipelines, this can even be used as is if the artifact is not specified as a pipeline output.

I'm trying to help address the transition to pipelines with iterative/dvc#9138.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 92.20% and project coverage change: -0.17 ⚠️

Comparison is base (5b3ffc2) 96.08% compared to head (58075d4) 95.92%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #464      +/-   ##
==========================================
- Coverage   96.08%   95.92%   -0.17%     
==========================================
  Files          38       39       +1     
  Lines        2401     2451      +50     
  Branches      199      203       +4     
==========================================
+ Hits         2307     2351      +44     
- Misses         55       59       +4     
- Partials       39       41       +2     
Impacted Files Coverage Δ
src/dvclive/live.py 91.51% <68.42%> (-1.69%) ⬇️
tests/conftest.py 93.93% <100.00%> (+5.70%) ⬆️
tests/test_dvc.py 100.00% <100.00%> (ø)
tests/test_log_artifact.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@daavoo daavoo merged commit 90a5bc6 into iterative:main Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

log_artifact
4 participants