MagneticOrderingsWF get_wf() method leading to kwarg error

I am trying to produce a workflow to determine the ground state magnetic ordering of a structure. I am getting an error about unexpected keyword args. For other workflows I have mostly relied on presets from vasp.workflows.presets so maybe I’m not actually using the MagneticOrderingsWF class correctly at all. I would expect the following to return a Fireworks Workflow. Full traceback (making use of stackprinter):

[1]: struct

[1]: Structure Summary
Lattice
    abc : 3.15302065 3.15302065 5.12425282
 angles : 90.0 90.0 119.99999999999999
 volume : 44.117897832868465
      B : -1.5765103249999994 2.730595981556924 1.9306683233340037e-16
      C : 0.0 0.0 5.12425282
PeriodicSite: Li (0.0000, 1.8204, 3.2925) [0.3333, 0.6667, 0.6425]
PeriodicSite: Li (1.5765, 0.9102, 1.8318) [0.6667, 0.3333, 0.3575]
PeriodicSite: Co (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000]
PeriodicSite: O (0.0000, 1.8204, 1.2151) [0.3333, 0.6667, 0.2371]
PeriodicSite: O (1.5765, 0.9102, 3.9092) [0.6667, 0.3333, 0.7629]

[2]: MOWF = MagneticOrderingsWF(struct)
     orig_wf = MOWF.get_wf()

File /Users/dan/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py, line 2963, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
File <ipython-input-9-625e53ec6470>, line 2, in <module>
    1    MOWF = MagneticOrderingsWF(struct)
--> 2    orig_wf = MOWF.get_wf()
    ..................................................
     MOWF = <atomate.vasp.workflows.base.magnetism.MagneticOrderingsWF o
             bject at 0x1c1e0d4940>
     MagneticOrderingsWF = <class 'atomate.vasp.workflows.base.magnetism.MagneticOrderi
                            ngsWF'>
     struct = Structure Summary
              Lattice
                  abc : 3.15302065 3.15302065 5.12425282
               angles : 90.0 90.0 119.99999999999999
               volume : 44.117897832868465
                    B : -1.5765103249999994 2.730595981556924 1.9306683233
               340037e-16
                    C : 0.0 0.0 5.12425282
              PeriodicSite: Li (0.0000, 1.8204, 3.2925) [0.3333, 0.6667, 0
               .6425]
              PeriodicSite: Li (1.5765, 0.9102, 1.8318) [0.6667, 0.3333, 0
               .3575]
              PeriodicSite: Co (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0
               .0000]
              PeriodicSite:...
     MOWF.get_wf = <method 'MagneticOrderingsWF.get_wf' of <atomate.vasp.workfl
                    ows.base.magnetism.MagneticOrderingsWF object at 0x1c1e0d494
                    0> magnetism.py:201>
    ..................................................

File /Users/dan/anaconda3/lib/python3.6/site-packages/atomate/vasp/workflows/base/magnetism.py, line 346, in get_wf
    201  def get_wf(
    202      self, scan=False, perform_bader=True, num_orderings_hard_limit=16, c=None
    203  ):
 (...)
    342              parent_structure=self.sanitized_structure,
    343              origins=ordered_structure_origins,
    344              input_index=self.input_index,
    345              perform_bader=perform_bader,
--> 346              scan=scan,
    347          ),
    ..................................................
     self = <atomate.vasp.workflows.base.magnetism.MagneticOrderingsWF o
             bject at 0x1c1e0d4940>
     scan = False
     perform_bader = True
     num_orderings_hard_limit = 16
     c = {'VASP_CMD': '>>vasp_cmd<<',
          'DB_FILE': '>>db_file<<',
          'user_incar_settings': {'ISYM': 0,
                                  'LASPH': True,
                                  'EDIFFG': -0.05}}
     self.sanitized_structure = Structure Summary
                                Lattice
                                    abc : 3.15302065 3.15302065 5.12425282
                                 angles : 90.0 90.0 119.99999999999999
                                 volume : 44.117897832868465
                                      B : -1.5765103249999994 2.730595981556924 1.9306683233
                                 340037e-16
                                      C : 0.0 0.0 5.12425282
                                PeriodicSite: Li (0.0000, 1.8204, 3.2925) [0.3333, 0.6667, 0
                                 .6425]
                                PeriodicSite: Li (1.5765, 0.9102, 1.8318) [0.6667, 0.3333, 0
                                 .3575]
                                PeriodicSite: Co (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0
                                 .0000]
                                PeriodicSite:...
     ordered_structure_origins = ['fm', 'afm', 'afm', 'afm', 'afm', 'afm', 'afm', 'afm', 'afm
                                  ', 'afm', 'afm', 'afm', ]
     self.input_index = None
    ..................................................

File /Users/dan/anaconda3/lib/python3.6/site-packages/fireworks/core/firework.py, line 70, in __init__
    57   def __init__(self, *args, **kwargs):
 (...)
    66       if self.optional_params is not None:
    67           allowed_params = required_params + self.optional_params
    68           for k in kwargs:
    69               if k not in allowed_params:
--> 70                   raise RuntimeError("Invalid keyword argument specified for: {}. You specified: {}. Allowed values are: {}.".format(self.__class__, k, allowed_params))
    ..................................................
     self = MagneticOrderingsToDB
            {'db_file': '>>db_file<<',
             'wf_uuid': 'be373e28-0d83-495f-835b-46f27135bc3a',
             'auto_generated': False,
             'name': 'MagneticOrderingsToDB',
             'parent_structure': Structure Summary
                                 Lattice
                                     abc : 3.15302065 3.15302065 5.12425
             282
                                  angles : 90.0 90.0 119.99999999999999
                                  volume : 44.117897832868465
             0037e-16
                                       B...
     args = ()
     kwargs = {'db_file': '>>db_file<<',
               'wf_uuid': 'be373e28-0d83-495f-835b-46f27135bc3a',
               'auto_generated': False,
               'name': 'MagneticOrderingsToDB',
               'parent_structure': Structure Summary
                                   Lattice
                                       abc : 3.15302065 3.15302065 5.12425
               282
                                    angles : 90.0 90.0 119.99999999999999
                                    volume : 44.117897832868465
               0037e-16
                                         B : -1.5765103249999994...
     self.optional_params = ['origins', 'input_index', ]
     allowed_params = ['db_file', 'wf_uuid', 'parent_structure', 'perform_bader',
                       'scan', 'origins', 'input_index', ]
     required_params = ['db_file', 'wf_uuid', 'parent_structure', 'perform_bader',
                        'scan', ]
     k = 'auto_generated'
     self.__class__ = <class 'atomate.vasp.firetasks.parse_outputs.MagneticOrderin
                       gsToDB'>
    ..................................................

---- (full traceback above) ----
File /Users/dan/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py, line 2963, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
File <ipython-input-9-625e53ec6470>, line 2, in <module>
    orig_wf = MOWF.get_wf()
File /Users/dan/anaconda3/lib/python3.6/site-packages/atomate/vasp/workflows/base/magnetism.py, line 346, in get_wf
    scan=scan,
File /Users/dan/anaconda3/lib/python3.6/site-packages/fireworks/core/firework.py, line 70, in __init__
    raise RuntimeError("Invalid keyword argument specified for: {}. You specified: {}. Allowed values are: {}.".format(self.__class__, k, allowed_params))

RuntimeError: Invalid keyword argument specified for: <class 'atomate.vasp.firetasks.parse_outputs.MagneticOrderingsToDB'>. You specified: auto_generated. Allowed values are: ['db_file', 'wf_uuid', 'parent_structure', 'perform_bader', 'scan', 'origins', 'input_index'].

``

I assume that ‘auto_generated’ and ‘name’ should be allowed as they look to be set to sensible values?



···
  A : 3.15302065 0.0 1.9306683233340037e-16
                A : 3.15302065 0.0 1.9306683233340037e-16
                                  A : 3.15302065 0.0 1.9306683233340037e-16
                                   A : 3.15302065 0.0 1.930668323334
                                     A : 3.15302065 0.0 1.930668323334

Hi Dan,

This has been fixed in master but not in the released version yet.

This is as a result of more strict checking for keyword args, which is helping us find a few places where there are old args that don’t do anything any more.

My one note if using this workflow is to be mindful of the version of enumlib you have installed. The version available on the conda matsci channel should be fine, but the latest version compiled from source has a known bug.

Best,

Matt

I just pushed v0.9.3 which should include the patch (I didn’t realize that commit had a bugfix in it, otherwise I would have released earlier!)

Hopefully it works now.

···

On Friday, August 30, 2019 at 7:58:19 AM UTC-7, Matthew Horton wrote:

Hi Dan,

This has been fixed in master but not in the released version yet.

This is as a result of more strict checking for keyword args, which is helping us find a few places where there are old args that don’t do anything any more.

My one note if using this workflow is to be mindful of the version of enumlib you have installed. The version available on the conda matsci channel should be fine, but the latest version compiled from source has a known bug.

Best,

Matt

Thanks both, it’s all working fine now!

···

On Friday, August 30, 2019 at 5:43:03 PM UTC+1, Anubhav Jain wrote:

I just pushed v0.9.3 which should include the patch (I didn’t realize that commit had a bugfix in it, otherwise I would have released earlier!)

Hopefully it works now.

On Friday, August 30, 2019 at 7:58:19 AM UTC-7, Matthew Horton wrote:

Hi Dan,

This has been fixed in master but not in the released version yet.

This is as a result of more strict checking for keyword args, which is helping us find a few places where there are old args that don’t do anything any more.

My one note if using this workflow is to be mindful of the version of enumlib you have installed. The version available on the conda matsci channel should be fine, but the latest version compiled from source has a known bug.

Best,

Matt