Skip to content

Commit

Permalink
Improve default mobcal executable selection
Browse files Browse the repository at this point in the history
  • Loading branch information
smcolby committed Aug 9, 2023
1 parent cfb953e commit 77c6341
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion isicle/mobility.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ def calculate_ccs(geom, **kwargs):
return MobcalWrapper().run(geom, **kwargs)


def _mobcal_selector():
for name in ['mobcal_shm', 'mobcal']:
if shutil.which(name) is not None:
return name

raise OSError('mobcal installation not found')


class MobcalWrapper(XYZGeometry, WrapperInterface):

def __init__(self):
Expand Down Expand Up @@ -90,11 +98,14 @@ def _configure_mobcal(self, i2=5013489, buffer_gas='helium',

def configure(self, lennard_jones='default', i2=5013489,
buffer_gas='helium', buffer_gas_mass=4.0026, temp=300,
ipr=1000, itn=10, inp=48, imp=1024, processes=24, command='mobcal'):
ipr=1000, itn=10, inp=48, imp=1024, processes=24, command=None):

# Handle default case
if lennard_jones == 'default':
lennard_jones = None

if command is None:
command = _mobcal_selector()

# Configure Lennard-Jones potentials
self._configure_lennard_jones(lennard_jones)
Expand Down

0 comments on commit 77c6341

Please sign in to comment.