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

deckgl_template #42

Open
dhruv-anand-aintech opened this issue Oct 10, 2024 · 4 comments
Open

deckgl_template #42

dhruv-anand-aintech opened this issue Oct 10, 2024 · 4 comments

Comments

@dhruv-anand-aintech
Copy link

Might be a missing file in the new 0.4 release

[line 1](vscode-notebook-cell:?execution_count=13&line=1)FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/datamapplot/deckgl_template.html'
{
	"name": "FileNotFoundError",
	"message": "[Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/datamapplot/deckgl_template.html'",
	"stack": "---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Cell In[13], line 1
----> 1 import datamapplot
      2 import numpy as np
      4 datamapplot.create_interactive_plot(
      5     np.array(umap_data[:, :2]),
      6     np.array(hdbscan_labels.astype(str)),
      7     hover_text=df[title_col],
      8 )

File /usr/local/lib/python3.11/site-packages/datamapplot/__init__.py:1
----> 1 from datamapplot.create_plots import create_plot, create_interactive_plot
      2 from datamapplot.plot_rendering import render_plot
      3 from datamapplot.interactive_rendering import render_html

File /usr/local/lib/python3.11/site-packages/datamapplot/create_plots.py:17
     15 from datamapplot.plot_rendering import render_plot
     16 from datamapplot.medoids import medoid
---> 17 from datamapplot.interactive_rendering import (
     18     render_html,
     19     label_text_and_polygon_dataframes,
     20     InteractiveFigure,
     21 )
     24 def create_plot(
     25     data_map_coords,
     26     labels=None,
   (...)
     49     **render_plot_kwds,
     50 ):
     51     \"\"\"Create a static plot from ``data_map_coords`` with text labels provided by ``labels``.
     52     This is the primary function for DataMapPlot and provides the easiest interface to the
     53     static plotting functionality. This function provides a number of options, but also
   (...)
    171 
    172     \"\"\"

File /usr/local/lib/python3.11/site-packages/datamapplot/interactive_rendering.py:28
     25 from datamapplot.alpha_shapes import create_boundary_polygons, smooth_polygon
     26 from datamapplot.medoids import medoid
---> 28 _DECKGL_TEMPLATE_STR = (files(\"datamapplot\") / \"deckgl_template.html\").read_text(
     29     encoding=\"utf-8\"
     30 )
     32 _TOOL_TIP_CSS = \"\"\"
     33             font-size: 0.8em;
     34             font-family: {{title_font_family}};
   (...)
     40             max-width: 25%;
     41 \"\"\"
     43 _NOTEBOOK_NON_INLINE_WORKER = \"\"\"
     44     const parsingWorkerBlob = new Blob([`
     45       async function DecompressBytes(bytes) {
   (...)
     80     `], { type: 'application/javascript' });
     81 \"\"\"

File /usr/local/lib/python3.11/pathlib.py:1058, in Path.read_text(self, encoding, errors)
   1054 \"\"\"
   1055 Open the file in text mode, read it, and close the file.
   1056 \"\"\"
   1057 encoding = io.text_encoding(encoding)
-> 1058 with self.open(mode='r', encoding=encoding, errors=errors) as f:
   1059     return f.read()

File /usr/local/lib/python3.11/pathlib.py:1044, in Path.open(self, mode, buffering, encoding, errors, newline)
   1042 if \"b\" not in mode:
   1043     encoding = io.text_encoding(encoding)
-> 1044 return io.open(self, mode, buffering, encoding, errors, newline)

FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/datamapplot/deckgl_template.html'"
}
@dhruv-anand-aintech dhruv-anand-aintech changed the title dhruv-anand-aintech deckgl_template Oct 10, 2024
@Ibrokhimsadikov
Copy link

I am facing same issue!

@AndreaFrancis
Copy link

I encountered the same issue while working with BERTopic. I resolved it by switching to version 0.3.0, and the error disappeared

@lmcinnes
Copy link
Contributor

This is very odd -- as far as I can tell all the relevant pieces to ensure the file exists are in place. I'll have to see if I can debug the packaging.

@lmcinnes
Copy link
Contributor

So it was a simple issue in the end that messed up the packaging. Hopefully there will be a 0.4.1 on PyPI shortly that should resolve the issue.

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

No branches or pull requests

4 participants