Skip to content

Commit

Permalink
Use is_convertable_to_image|html in create_from
Browse files Browse the repository at this point in the history
  • Loading branch information
shnela committed Sep 19, 2022
1 parent 41bda63 commit bdb5a00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neptune/new/types/atoms/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ def as_pickle(obj) -> "File":
def create_from(value) -> "File":
if isinstance(value, str):
return File(path=value)
elif is_pil_image(value) or is_matplotlib_figure(value):
elif File.is_convertable_to_image(value):
return File.as_image(value)
elif is_plotly_figure(value) or is_altair_chart(value) or is_bokeh_figure(value):
elif File.is_convertable_to_html(value):
return File.as_html(value)
elif is_numpy_array(value):
raise TypeError(
Expand Down

0 comments on commit bdb5a00

Please sign in to comment.