hackingmaterials / atomate

atomate is a powerful software for computational materials science and contains pre-built workflows.
https://hackingmaterials.github.io/atomate
Other
240 stars 172 forks source link

LepsFW no longer works due to deprecated decorator #160

Closed computron closed 6 years ago

computron commented 6 years ago

@matk86 can you fix soon? All LepsFW will fail until fixed.

Run this

from atomate.vasp.fireworks import LepsFW
from pymatgen import Lattice, Structure

coords = [[0, 0, 0], [0.75, 0.5, 0.75]]
lattice = Lattice([[3.8401979337, 0.00, 0.00],
                        [1.9200989668, 3.3257101909, 0.00],
                        [0.00, -2.2171384943, 3.1355090603]])
struct = Structure(lattice, ["Si"] * 2, coords)

lfw = LepsFW(struct)

print(lfw)

You'll hit this error

/Users/ajain/PycharmProjects/scratch_work/scratch/scratch3.py:10: DeprecationWarning: LepsFW is deprecated
This firework will be removed soon. Use DFPTFW and/or RamanFW fireworks.
  lfw = LepsFW(struct)
Traceback (most recent call last):
  File "/Users/ajain/PycharmProjects/scratch_work/scratch/scratch3.py", line 10, in <module>
    lfw = LepsFW(struct)
  File "/Users/ajain/Documents/code_matgen/monty/monty/dev.py", line 54, in wrapped
    return old(*args, **kwargs)
  File "/Users/ajain/Documents/code_matgen/atomate/atomate/vasp/fireworks/core.py", line 244, in __init__
    super(LepsFW, self).__init__(t, parents=parents, name="{}-{}".format(
TypeError: super() argument 1 must be type, not function
shyuep commented 6 years ago

In this case, do not use @deprecated and just simple add a warnings.warn in the init method somewhere.

computron commented 6 years ago

Good suggestion, closed via 7a3053aac3ef5ee69183205fac917382071ea955