MultiOptPy 1.20.2__py3-none-any.whl → 1.20.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -380,12 +380,25 @@ def setup_calculator(atom_obj, software_type, electric_charge_and_multiplicity,
380
380
  software_path=software_path_dict.get("uma-s-1"),
381
381
  software_type=software_type)
382
382
  return calc_obj
383
+
384
+ if software_type == "uma-s-1p1-cuda":
385
+ calc_obj = ASE_FAIRCHEM(atom_obj=atom_obj,
386
+ electric_charge_and_multiplicity=electric_charge_and_multiplicity,
387
+ software_path=software_path_dict.get("uma-s-1p1"),
388
+ software_type=software_type,
389
+ device_mode="cuda")
390
+ return calc_obj
391
+
383
392
  if software_type == "uma-s-1p1":
384
393
  calc_obj = ASE_FAIRCHEM(atom_obj=atom_obj,
385
394
  electric_charge_and_multiplicity=electric_charge_and_multiplicity,
386
395
  software_path=software_path_dict.get("uma-s-1p1"),
387
396
  software_type=software_type)
388
397
  return calc_obj
398
+
399
+
400
+
401
+
389
402
  if software_type == "uma-m-1p1":
390
403
  calc_obj = ASE_FAIRCHEM(atom_obj=atom_obj,
391
404
  electric_charge_and_multiplicity=electric_charge_and_multiplicity,
@@ -5,22 +5,27 @@ class ASE_FAIRCHEM:
5
5
  self.atom_obj = kwargs.get('atom_obj', None)
6
6
  self.electric_charge_and_multiplicity = kwargs.get('electric_charge_and_multiplicity', None)
7
7
  self.software_path = kwargs.get('software_path', None)
8
- self.task_name = "omol"
8
+ self.task_name = kwargs.get('task_name', "omol")
9
+ self.device_mode = kwargs.get('device_mode', "cpu")
9
10
  self.software_type = kwargs.get('software_type', None)
10
11
  print(f"ASE_FAIRCHEM: software_type = {self.software_type}")
11
-
12
-
13
- def run(self): # fairchem.core: version 2.x.x
14
12
  try:
15
13
  from fairchem.core import FAIRChemCalculator
14
+ self.FAIRChemCalculator = FAIRChemCalculator
16
15
  from fairchem.core.units.mlip_unit import load_predict_unit
16
+ self.load_predict_unit = load_predict_unit
17
17
  except ImportError:
18
18
  raise ImportError("FAIRChem.core modules not found")
19
+
20
+
21
+ def run(self): # fairchem.core: version 2.x.x
22
+
19
23
  # Load the prediction unit
20
- predict_unit = load_predict_unit(path=self.software_path, device="cpu")
21
-
24
+ predict_unit = self.load_predict_unit(path=self.software_path, device=self.device_mode)
25
+ print(f"ASE_FAIRCHEM: device_mode = {self.device_mode}")
26
+ print(f"ASE_FAIRCHEM: task_name = {self.task_name}")
22
27
  # Set up the FAIRChem calculator
23
- fairchem_calc = FAIRChemCalculator(predict_unit=predict_unit, task_name=self.task_name)
28
+ fairchem_calc = self.FAIRChemCalculator(predict_unit=predict_unit, task_name=self.task_name)
24
29
  self.atom_obj.info = {"charge": int(self.electric_charge_and_multiplicity[0]),
25
30
  "spin": int(self.electric_charge_and_multiplicity[1])}
26
31
  self.atom_obj.calc = fairchem_calc