Skip to content

Commit

Permalink
Remove unused code #48
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-austin committed Jun 9, 2023
1 parent 37b5467 commit 8fbbf71
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 330 deletions.
21 changes: 0 additions & 21 deletions pymuonsuite/io/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,6 @@
from soprano.utils import silence_stdio


def write_tensors(tensors, filename, symbols):
"""
Write out a set of 2 dimensional tensors for every atom in a system.
| Args:
| tensors(Numpy float array, shape: (Atoms, :, :): A list of tensors
| for each atom.
| filename(str): Filename for file.
| symbols(str array): List containing chemical symbol of each atom in
| system.
|
| Returns: Nothing
"""
tensfile = open(filename, "w")
for i in range(np.size(tensors, 0)):
tensfile.write("{0} {1}\n".format(symbols[i], i))
tensfile.write(
"\n".join(["\t".join([str(x) for x in ln]) for ln in tensors[i]]) + "\n"
)


def write_cluster_report(args, params, clusters):

if params["clustering_method"] == "hier":
Expand Down
177 changes: 0 additions & 177 deletions pymuonsuite/quantum/vibrational/grid.py

This file was deleted.

90 changes: 0 additions & 90 deletions pymuonsuite/quantum/vibrational/reports.py

This file was deleted.

42 changes: 0 additions & 42 deletions pymuonsuite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,48 +79,6 @@ def make_process_slices(N, M):
return slices


def create_plane_grid(hkl, cell, f0, f1, N=20):

# Create a grid of points along a crystal plane

hkl = np.array(hkl).astype(int)
f0 = np.array(f0)
f1 = np.array(f1)

# First: verify that the given points (given in fractional coordinates)
# DO belong to the same plane
f01 = f1 - f0
if np.isclose(np.linalg.norm(f01), 0):
raise ValueError("Points f0 and f1 are too close")
if not np.isclose(np.dot(hkl, f01), 0):
raise ValueError("Points f0 and f1 do not belong to the same plane")

# Now move to direct space
n = np.dot(hkl, np.linalg.inv(cell))
p0 = np.dot(cell.T, f0)
p1 = np.dot(cell.T, f1)

n /= np.linalg.norm(n)

# Find the scanning directions
p01 = p1 - p0

plx = np.zeros(3)
plx[np.where(p01 != 0)[0][0]] = 1
ply = p01 - np.dot(p01, plx) * plx
ply /= np.linalg.norm(ply)
ply *= np.sign(ply[np.where(ply != 0)[0][0]])

# Now to actually create the scanning grid
plgrid = np.array(np.meshgrid(*[np.linspace(0, 1, N)] * 2, indexing="ij"))

xyzgrid = plgrid[0, None] * plx[:, None, None] * np.dot(p01, plx)
xyzgrid += plgrid[1, None] * ply[:, None, None] * np.dot(p01, ply)
xyzgrid += p0[:, None, None]

return xyzgrid


class BackupFile:
"""Backup a file before performing an operation
Expand Down

0 comments on commit 8fbbf71

Please sign in to comment.