Skip to content

Commit

Permalink
Manual formatting (#219)
Browse files Browse the repository at this point in the history
Added # fmt: off/on according to discussion in #210. Also applied black to a couple of the files.
  • Loading branch information
NikoOinonen authored Oct 30, 2023
1 parent 537851d commit a7d4744
Show file tree
Hide file tree
Showing 9 changed files with 503 additions and 432 deletions.
2 changes: 1 addition & 1 deletion ppafm/GUIWidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
from matplotlib.figure import Figure
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtWidgets

from . import io

Expand Down
11 changes: 8 additions & 3 deletions ppafm/cli/gui/ppafm_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

Multipoles = Enum('Multipoles', 's pz dz2')

# fmt: off
Presets = {
'CO (Z8, dz2, Q-0.1, K0.25)': {
'Z': 8,
Expand All @@ -53,6 +54,7 @@
'EqPos': [0.0, 0.0, 3.0]
}
}
# fmt: on

TTips = {
'Preset': 'Preset: Apply a probe parameter preset.',
Expand Down Expand Up @@ -199,10 +201,11 @@ def setScanWindow(self, scan_size, scan_start, step, distance, amplitude):
z = self.xyzs[:, 2].max() + distance
z_min = z - amplitude / 2
z_max = z + amplitude / 2 + z_extra_steps * step[2]
# fmt: off
scan_window = (
(scan_start[0] , scan_start[1] , z_min),
(scan_start[0] + scan_size[0], scan_start[1] + scan_size[1], z_max)
)
) # fmt: on
self.afmulator.kCantilever = self.bxCant_K.value() * 1000
self.afmulator.f0Cantilever = self.bxCant_f0.value() * 1000
if self.verbose > 0: print("setScanWindow", step, scan_size, scan_start, scan_dim, scan_window)
Expand Down Expand Up @@ -259,11 +262,12 @@ def updateScanWindow(self):
def updateRotation(self):
'''Get rotation from input field and update'''
a = self.bxRot.value() / 180 * np.pi
# fmt: off
self.rot = np.array([
[np.cos(a), -np.sin(a), 0],
[np.sin(a), np.cos(a), 0],
[ 0, 0, 1]
])
]) # fmt: on
if self.verbose > 0: print('updateRotation', a, self.rot)
self.update()

Expand Down Expand Up @@ -677,12 +681,13 @@ def saveDataW(self):
sw = self.afmulator.scan_window
size = np.array(sw[1]) - np.array(sw[0])
size[2] -= self.afmulator.amplitude - self.bxStepZ.value()
# fmt: off
lvecScan = np.array([
[sw[0][0], sw[0][1], sw[0][2] - self.bxP0r.value()],
[size[0], 0, 0],
[ 0, size[1], 0],
[ 0, 0, size[2]],
])
]) # fmt: on
if self.sample_lvec is not None:
lvec = np.append([[0, 0, 0]], self.sample_lvec, axis=0)
atomstring = io.primcoords2Xsf(self.Zs, self.xyzs.T, lvec)
Expand Down
Loading

0 comments on commit a7d4744

Please sign in to comment.