Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import os
import glob
import oommfc as oc
import ubermagtable as ut
import discretisedfield as df
import micromagneticmodel as mm
class Data(mm.Data):
@property
def effective_field(self):
_dict = {'Demag': 'Oxs_Demag::Field',
'Exchange': 'Oxs_UniformExchange::Field',
'UniaxialAnisotropy': 'Oxs_UniaxialAnisotropy::Field',
'Zeeman': 'Oxs_FixedZeeman::Field',
'Hamiltonian': 'Oxs_RungeKuttaEvolve:evolver:Total field'}
td = oc.TimeDriver()
td.drive(self.system, derive=_dict[self.cls])
dirname = os.path.join(self.system.name,
f'drive-{self.system.drive_number-1}')
ohf_file = max(glob.iglob(os.path.join(dirname, '*.ohf')),
key=os.path.getctime)