Pymatgen module generate vampire ucf file but error

when I use pymatgen python module to generate vampire ucf file, it put an error.

Traceback (most recent call last):
  File "/opt/anaconda3/lib/python3.9/site-packages/IPython/core/", line 3444, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-9dee7c724d05>", line 1, in <module>
    runfile('/Users/xbunax/PycharmProjects/pythonProject/', wdir='/Users/xbunax/PycharmProjects/pythonProject')
  File "/Users/xbunax/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/223.7571.203/", line 198, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "/Users/xbunax/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/223.7571.203/", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Users/xbunax/PycharmProjects/pythonProject/", line 15, in <module>
    vc = VampireCaller(magmoms)
  File "/opt/anaconda3/lib/python3.9/site-packages/monty/", line 113, in decorated
    return _callable(*args, **kwargs)
  File "/opt/anaconda3/lib/python3.9/site-packages/pymatgen/command_line/", line 110, in __init__
    hmapper = HeisenbergMapper(ordered_structures, energies, cutoff=3.0, tol=0.02)
  File "/opt/anaconda3/lib/python3.9/site-packages/pymatgen/analysis/magnetism/", line 78, in __init__
    hs = HeisenbergScreener(ordered_structures, energies, screen=False)
  File "/opt/anaconda3/lib/python3.9/site-packages/pymatgen/analysis/magnetism/", line 708, in __init__
    structures, energies = self._do_cleanup(structures, energies)
  File "/opt/anaconda3/lib/python3.9/site-packages/pymatgen/analysis/magnetism/", line 741, in _do_cleanup
    ordered_structures = [
  File "/opt/anaconda3/lib/python3.9/site-packages/pymatgen/analysis/magnetism/", line 742, in <listcomp>
  File "/opt/anaconda3/lib/python3.9/site-packages/pymatgen/analysis/magnetism/", line 150, in __init__
    structure = structure.copy()
AttributeError: 'float' object has no attribute 'copy'

This is my codes

from pymatgen.command_line.vampire_caller import VampireCaller

from mp_api.client import MPRester

mpr = MPRester('API_KEY')
structure = mpr.get_structure_by_material_id('mp-30409')
magmoms = structure.site_properties['magmom']

# Create a VampireCaller object with ferromagnetic order and default parameters
vc = VampireCaller(magmoms)

# Generate the ucf file

I read the source code of vampireacaller,the parameters notes says that

 ordered_structures (list): Structure objects with magmoms.

I think the error is about the type of the structure parameter. But I don’t know how to solve this.If someone has the example code to generate ucf file. It will be grateful.

Thread closed due to inactivity, please open a new thread to address related issues.