Skip to content

Commit

Permalink
fix: correcting expected matrix type and None comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
laserkelvin committed Nov 25, 2024
1 parent 039a84d commit d8e56e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion matsciml/datasets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def make_pymatgen_periodic_structure(
is_frac = True
else:
is_frac = not is_cartesian # TODO this is logically confusing
if not lattice:
if lattice is None:
if lat_angles is None or lat_abc is None:
raise ValueError(
"Unable to construct Lattice object without parameters:"
Expand Down Expand Up @@ -894,6 +894,10 @@ def calculate_ase_periodic_shifts(
frac_coords = torch.from_numpy(atoms.get_scaled_positions()).float()
coords = torch.from_numpy(atoms.positions).float()

# convert numpy cells to torch in advance for einsum
if isinstance(cell, np.ndarray):
cell = torch.from_numpy(cell).float()

return_dict = {
"src_nodes": torch.LongTensor(all_src),
"dst_nodes": torch.LongTensor(all_dst),
Expand Down

0 comments on commit d8e56e7

Please sign in to comment.