You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FileNotFoundError Traceback (most recent call last)
Cell In[4], line 1
----> 1 A, y_data, info = Deconvolution2D(dim=256, phantom="cookie").get_components()
File ~/anaconda3/envs/cuqipypre/lib/python3.10/site-packages/cuqi/testproblem/testproblem.py:1279, in Deconvolution2D.init(self, dim, PSF, PSF_param, PSF_size, BC, phantom, noise_type, noise_std, prior)
1277 phantom = phantom.lower().replace("-", "")
1278 if hasattr(cuqi.data, phantom):
-> 1279 x_exact2D = getattr(cuqi.data, phantom)(size=dim)
1280 else:
1281 raise ValueError(f"Phantom {phantom} not found in cuqi.data phantom library.")
File ~/anaconda3/envs/cuqipypre/lib/python3.10/site-packages/cuqi/data/_data.py:344, in cookie(size, grayscale)
320 """ Cartoon-style image of a cookie.
321
322 The image is generated from the cookie.png color image file in cuqi/data.
(...)
340
341 """
343 # Read cookie.png file and convert to rgb
--> 344 stream = pkg_resources.resource_stream(name, 'cookie.png')
345 cookie = plt.imread(stream)
347 # Convert to rgb
File ~/anaconda3/envs/cuqipypre/lib/python3.10/site-packages/pkg_resources/init.py:1219, in ResourceManager.resource_stream(self, package_or_requirement, resource_name)
1217 def resource_stream(self, package_or_requirement, resource_name):
1218 """Return a readable file-like object for specified resource"""
-> 1219 return get_provider(package_or_requirement).get_resource_stream(
1220 self, resource_name
1221 )
Description
I try to import the cookie phantom using Deconvolution2D
Example to reproduce
Tested on two different machines after installing CUQIpy 0.8.0, and also with prerelease after 0.8.0
FileNotFoundError Traceback (most recent call last)
Cell In[4], line 1
----> 1 A, y_data, info = Deconvolution2D(dim=256, phantom="cookie").get_components()
File ~/anaconda3/envs/cuqipypre/lib/python3.10/site-packages/cuqi/testproblem/testproblem.py:1279, in Deconvolution2D.init(self, dim, PSF, PSF_param, PSF_size, BC, phantom, noise_type, noise_std, prior)
1277 phantom = phantom.lower().replace("-", "")
1278 if hasattr(cuqi.data, phantom):
-> 1279 x_exact2D = getattr(cuqi.data, phantom)(size=dim)
1280 else:
1281 raise ValueError(f"Phantom {phantom} not found in cuqi.data phantom library.")
File ~/anaconda3/envs/cuqipypre/lib/python3.10/site-packages/cuqi/data/_data.py:344, in cookie(size, grayscale)
320 """ Cartoon-style image of a cookie.
321
322 The image is generated from the cookie.png color image file in cuqi/data.
(...)
340
341 """
343 # Read cookie.png file and convert to rgb
--> 344 stream = pkg_resources.resource_stream(name, 'cookie.png')
345 cookie = plt.imread(stream)
347 # Convert to rgb
File ~/anaconda3/envs/cuqipypre/lib/python3.10/site-packages/pkg_resources/init.py:1219, in ResourceManager.resource_stream(self, package_or_requirement, resource_name)
1217 def resource_stream(self, package_or_requirement, resource_name):
1218 """Return a readable file-like object for specified resource"""
-> 1219 return get_provider(package_or_requirement).get_resource_stream(
1220 self, resource_name
1221 )
File ~/anaconda3/envs/cuqipypre/lib/python3.10/site-packages/pkg_resources/init.py:1724, in DefaultProvider.get_resource_stream(self, manager, resource_name)
1723 def get_resource_stream(self, manager, resource_name):
-> 1724 return open(self._fn(self.module_path, resource_name), 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/home/jakj/anaconda3/envs/cuqipypre/lib/python3.10/site-packages/cuqi/data/cookie.png'
And checking in that folder gives no cookie:
ls /home/jakj/anaconda3/envs/cuqipypre/lib/python3.10/site-packages/cuqi/data
astronaut.npz camera.npz cat.npz _data.py init.py pycache satellite.mat
The text was updated successfully, but these errors were encountered: