Closed elichad closed 2 years ago
Just looking at this visually, what's going on with castep_labels:S:1
? If I'm reading this correctly, it's NULL
for Si
, but then we have nothing in the column for the muons - that seems like a formatting error to me. But I don't know what the castep_label is supposed to do anyway.
Ahhh. The castep_labels
list comes from ASE: https://gitlab.com/ase/ase/-/blob/master/ase/io/castep.py#L286
My guess is that if the label is NULL, then the species
is used, and if the label is empty, then the castep_custom_species
is used?
And actually, thinking about it, this must be an ASE import problem, because that's all set_meta does (I mixed it up with the sniffer in my mind). And if I try it - yes:
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/home/qci88181/muon-galaxy-tools/.venv/lib/python3.8/site-packages/ase/io/formats.py", line 736, in read
return next(_iread(filename, slice(index, None), format, io,
File "/home/qci88181/muon-galaxy-tools/.venv/lib/python3.8/site-packages/ase/parallel.py", line 275, in new_generator
for result in generator(*args, **kwargs):
File "/home/qci88181/muon-galaxy-tools/.venv/lib/python3.8/site-packages/ase/io/formats.py", line 803, in _iread
for dct in io.read(fd, *args, **kwargs):
File "/home/qci88181/muon-galaxy-tools/.venv/lib/python3.8/site-packages/ase/io/formats.py", line 559, in wrap_read_function
for atoms in read(filename, index, **kwargs):
File "/home/qci88181/muon-galaxy-tools/.venv/lib/python3.8/site-packages/ase/io/extxyz.py", line 773, in read_xyz
yield _read_xyz_frame(fileobj, natoms, properties_parser, nvec)
File "/home/qci88181/muon-galaxy-tools/.venv/lib/python3.8/site-packages/ase/io/extxyz.py", line 416, in _read_xyz_frame
row = tuple([conv(val) for conv, val in zip(convs, vals)])
File "/home/qci88181/muon-galaxy-tools/.venv/lib/python3.8/site-packages/ase/io/extxyz.py", line 416, in <listcomp>
row = tuple([conv(val) for conv, val in zip(convs, vals)])
ValueError: could not convert string to float: 'H:mu'
So it's actually a table formatting problem - [extxyz spec] explains how the Properties work in line 2, and I think the empty label means it skips that column completely when trying to read those lines, and then tries to read H:mu
as the masses
variable.
Technically this is a bug, but not sure anyone will care about fixing it - who's really going to be writing out their customised CASTEP data to XYZ, rather than CELL which it's built for? The bigger problem is that it's ASE outputting a file it then can't read back in.
TL;DR I'll report this to ASE and close this issue.
The extended XYZ files generated by ASE for the allpos file in pm_muairss_write fail the
extxyz
metadata checks in Galaxy.If auto-detected after tool run, number of structures remains at 0 (default).
If same file is uploaded via paste instead:
Example of such a file (from https://raw.githubusercontent.com/muon-spectroscopy-computational-project/muon-galaxy-tools/92b7688a0d7a74028896a42be6f430ce07735d51/pm_muairss_write/test-data/allpos.cell):
My initial assumption is that this is probably something misconfigured in the set_meta of the extxyz datatype.