-
Notifications
You must be signed in to change notification settings - Fork 5
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
image: resolve abolute path from src #39
Conversation
1fc8c2f
to
d9d8ed1
Compare
Codecov Report
@@ Coverage Diff @@
## main #39 +/- ##
==========================================
+ Coverage 95.68% 95.80% +0.11%
==========================================
Files 14 14
Lines 464 477 +13
Branches 76 77 +1
==========================================
+ Hits 444 457 +13
Misses 15 15
Partials 5 5
Continue to review full report at Codecov.
|
d9d8ed1
to
b1b1808
Compare
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.
@pared sorry for my lack of understanding but I'm not sure I follow.
The HTML generated by this P.R. iterative/dvc#7664 looks fine even without this P.R?
HTML there contains absolute paths to the image so when I open the HTML in the browser it renders correctly?
@daavoo Yes, it will work. |
src/dvc_render/image.py
Outdated
@@ -20,17 +22,26 @@ class ImageRenderer(Renderer): | |||
|
|||
EXTENSIONS = {".jpg", ".jpeg", ".gif", ".png"} | |||
|
|||
def partial_html(self) -> str: | |||
def partial_html(self, output_dir=None, **kwargs) -> str: |
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.
Do we need this arg? Afaik if outs
was passed on DVC side, it should be present in self.properties
:
It makes more ense here if we expect this to be used outside DVC 🤔
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.
🤦
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.
After thinking a bit about it, i think that this was a proper approach. out
contains information where to write the images. So in a sense it contains the same information as datapoints.src
just without exact name of the file. When generating HTML via render_html
, we can provide index.html
file path, and it is the one path we are interested in the most. To be sure that our relpath is correct, we need to evaluate index.html
path and calculate relative path to its dirname
. Renamed output_dir
to more informative html_path
.
Related to iterative/dvc#7664