radiocosmology/cora

No conversion path for dtype: dtype('<U5')

Closed this issue · 5 comments

Hi, I try to run the cora-makesky command on a cluster but met with the following error. Instead I run cora on my laptop and it works well. Then I replace the packages including numpy, h5py and healpy of the cluster to be the same versions of my laptop but it still has error...

Loading data for galaxy simulation. SHTing to give random maps Applying phi weighting Transforming to freq Rescaling freq Scaling by T Rotating Traceback (most recent call last): File "/home/jianyao/.local/bin/cora-makesky", line 11, in <module> load_entry_point('cora==2.1.1', 'console_scripts', 'cora-makesky')() File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/home/jianyao/.local/lib/python2.7/site-packages/cora-2.1.1-py2.7-linux-x86_64.egg/cora/scripts/makesky.py", line 91, in foreground write_map(ctx.obj.filename, cs, gal.frequencies, ctx.obj.freq_width, ctx.obj.include_pol) File "/home/jianyao/.local/lib/python2.7/site-packages/cora-2.1.1-py2.7-linux-x86_64.egg/cora/scripts/makesky.py", line 240, in write_map dset = f.create_dataset('map', data=data) File "/home/jianyao/anaconda2/lib/python2.7/site-packages/h5py/_hl/group.py", line 139, in create_dataset self[name] = dset File "/home/jianyao/anaconda2/lib/python2.7/site-packages/h5py/_hl/group.py", line 371, in __setitem__ h5o.link(obj.id, self.id, name, lcpl=lcpl, lapl=self._lapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5o.pyx", line 202, in h5py.h5o.link RuntimeError: Unable to create link (name already exists)

jrs65 commented

Hi @YJHelloWorld, this usually happens when the target output file already exists, but it gives a useless error message. I've just merged #25 into master, which gives an explicit error message when the file already exists. I'm going to close this issue, but if that doesn't resolve your problems please feel free to re-open the issue. Thanks!

Hi @jrs65 , thanks for replying. Indeed the map.h5 already exists but when I delete this file and rerun the code it has new error which seems to still has some relation with h5py:
Loading data for galaxy simulation. SHTing to give random maps Applying phi weighting Transforming to freq Rescaling freq Scaling by T Rotating Traceback (most recent call last): File "/home/jianyao/.local/bin/cora-makesky", line 11, in <module> load_entry_point('cora==2.1.1', 'console_scripts', 'cora-makesky')() File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/home/jianyao/.local/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/home/jianyao/.local/lib/python2.7/site-packages/cora-2.1.1-py2.7-linux-x86_64.egg/cora/scripts/makesky.py", line 91, in foreground write_map(ctx.obj.filename, cs, gal.frequencies, ctx.obj.freq_width, ctx.obj.include_pol) File "/home/jianyao/.local/lib/python2.7/site-packages/cora-2.1.1-py2.7-linux-x86_64.egg/cora/scripts/makesky.py", line 241, in write_map dset.attrs['axis'] = np.array(['freq', 'pol', 'pixel']) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "/home/jianyao/anaconda2/lib/python2.7/site-packages/h5py/_hl/attrs.py", line 95, in __setitem__ self.create(name, data=value, dtype=base.guess_dtype(value)) File "/home/jianyao/anaconda2/lib/python2.7/site-packages/h5py/_hl/attrs.py", line 177, in create htype = h5t.py_create(original_dtype, logical=True) File "h5py/h5t.pyx", line 1630, in h5py.h5t.py_create File "h5py/h5t.pyx", line 1652, in h5py.h5t.py_create File "h5py/h5t.pyx", line 1713, in h5py.h5t.py_create TypeError: No conversion path for dtype: dtype('<U5')

jrs65 commented

Hey @YJHelloWorld. Sorry, that's an also an issue for you. I also think I fixed that in #25 so try upgrading to the latest master. Let me know if that works for you!

Yes it works now. Thanks a lot!

jrs65 commented

Great. Sorry for the issues!