Skip to content
This repository was archived by the owner on Feb 14, 2024. It is now read-only.
This repository was archived by the owner on Feb 14, 2024. It is now read-only.

scipy.misc is missing data files #79

Open
@lesteve

Description

@lesteve

Description

scipy.misc.face() fails since it can not find the associated data file. There are other similar functions that are missing data files in scipy.misc: scipy.misc.electrocardiogram() and scipy.misc.ascent()

The package from emscripten-forge does contain the .dat files. but somehow they are not visible by the kernel.

Reproduce

jupyter lite build --XeusPythonEnv.packages=scipy
jupyter lite serve

Open JupyterLite and start a new notebook with a xeus-python kernel.

from scipy.misc import face

arr = face()

This gives an error:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
/tmp/xpython_42/1607471528.py in <cell line: 3>()
      1 from scipy.misc import face
      2 
----> 3 arr = face()

/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/scipy/misc/_common.py in face(gray)
    220     import bz2
    221     import os
--> 222     with open(os.path.join(os.path.dirname(__file__), 'face.dat'), 'rb') as f:
    223         rawdata = f.read()
    224     data = bz2.decompress(rawdata)

FileNotFoundError: [Errno 44] No such file or directory: '/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/scipy/misc/face.dat'

From the screenshot below, you can see that there are no .dat file in the scipy.misc folder:
image

This does work fine in a Pyodide kernel.
image

Expected behavior

No error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions