Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ repos:
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pycqa/isort
rev: 7.0.0
rev: 8.0.1
hooks:
- id: isort
args: [--profile, black, --filter-files]
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
rev: v2.3.3
hooks:
- id: autoflake
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
rev: 26.3.1
hooks:
- id: black
language_version: python3
Expand Down
2 changes: 1 addition & 1 deletion ppafm/cli/fitting/fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def comp_msd(x=[]):
parser.add_option( "--nobounds", action="store_true", help="Skipf the first optimization step with bounds", default=False)
# fmt: on

(options, args) = parser.parse_args()
options, args = parser.parse_args()
opt_dict = vars(options)
parameters.apply_options(opt_dict) # setting up all the options according to their
x_new, bounds = set_fit_dict(opt=opt_dict)
Expand Down
2 changes: 1 addition & 1 deletion ppafm/cli/fitting/plotLine.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def selectLine(BIGarray, MIN, MAX, startingPoint, endPoint, nsteps):
parser.add_option( "--nodisp", action="store_true", default=False, help="Do NOT show the " "plots on the screen", )
# fmt: on

(options, args) = parser.parse_args()
options, args = parser.parse_args()
opt_dict = vars(options)
if options.points == []:
sys.exit("Error!! The '-p' or '--points' argument is required\npython plotLine.py -p XMINxYMINxZMIN XMAXxYMAXxZMAX")
Expand Down
10 changes: 3 additions & 7 deletions ppafm/cli/fitting/plotZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ def find_minimum(array, precision=0.0001):
i += 1


HELP_MSG = (
"""Use this program in the following way:
"""
+ os.path.basename(main.__file__)
+ """ -p "X1xY1" [-p "X2xY2" ...] """
)
HELP_MSG = """Use this program in the following way:
""" + os.path.basename(main.__file__) + """ -p "X1xY1" [-p "X2xY2" ...] """

# fmt: off
parser = OptionParser()
Expand All @@ -42,7 +38,7 @@ def find_minimum(array, precision=0.0001):
# parser.add_option( "--yrange", action="store", type="float", help="y positions of the tip range (min,max,n) [A]", nargs=3)
# fmt: on

(options, args) = parser.parse_args()
options, args = parser.parse_args()
opt_dict = vars(options)
print(options)
if options.npy:
Expand Down
4 changes: 2 additions & 2 deletions ppafm/cli/plot_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def main(argv=None):
os.makedirs(dir_name_amplitude)

if parameters.tiltedScan:
(f_out, lvec, _, atomic_info_or_head) = io.load_vec_field(dirname + "/OutF", data_format=args.output_format)
f_out, lvec, _, atomic_info_or_head = io.load_vec_field(dirname + "/OutF", data_format=args.output_format)
dfs = common.Fz2df_tilt(
f_out,
parameters.scanTilt,
Expand All @@ -292,7 +292,7 @@ def main(argv=None):
lvec_df[0] = lvec_df[0] + lvec_df[3] / lvec_3_norm * amplitude / 2
lvec_df[3] = lvec_df[3] / lvec_3_norm * (lvec_3_norm - amplitude)
else:
(fzs, lvec, _, atomic_info_or_head) = io.load_scal_field(dirname + "/OutFz", data_format=args.output_format)
fzs, lvec, _, atomic_info_or_head = io.load_scal_field(dirname + "/OutFz", data_format=args.output_format)
if applied_bias:
r_tip = parameters.Rtip
for iz, z in enumerate(tip_positions_z):
Expand Down
2 changes: 1 addition & 1 deletion ppafm/cli/utilities/cube2xsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
parser.add_option( "-i", "--input", action="store", type="string", help="input file")
parser.add_option( "-o", "--output", action="store", type="string", help="output file")
# fmt: on
(options, args) = parser.parse_args()
options, args = parser.parse_args()
if options.input == None:
sys.exit("ERROR!!! Please, specify the input file with the '-i' option \n\n" + HELP_MSG)

Expand Down
2 changes: 1 addition & 1 deletion ppafm/cli/utilities/extract_densities.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
parser.add_option( "--dz", action="store", type="float", help="use dz with step", default=-0.1 )
parser.add_option( "--plot", action="store_false" , help="plot extracted ?", default=True )
# fmt: on
(options, args) = parser.parse_args()
options, args = parser.parse_args()

fname, fext = os.path.splitext(options.i)
fext = fext[1:]
Expand Down
2 changes: 1 addition & 1 deletion ppafm/cli/utilities/fitPauli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
parser.add_option( "--not_plot", action="store_false" , help="do not-plot the lines above atoms", default= True )
parser.add_option( "--debug", action="store_true" , help="plot and pr. all lines and data from fit",default= False )
# fmt: on
(options, args) = parser.parse_args()
options, args = parser.parse_args()

# ====== functions

Expand Down
2 changes: 1 addition & 1 deletion ppafm/cli/utilities/plotQuad.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
parser.add_option( "-i", action="store", type="string", help="input file", default='OutFz' )
parser.add_option("-f","--data_format" , action="store", type="string", help="Specify the output format of the vector and scalar field. Supported formats are: xsf,npy", default="xsf")
# fmt: on
(options, args) = parser.parse_args()
options, args = parser.parse_args()

try:
points = np.genfromtxt(options.p)
Expand Down
2 changes: 1 addition & 1 deletion ppafm/cli/utilities/plotZcurves.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
parser.add_option( "--iz", action="store", type="int", help="z-slice index to plot legend", default=15 )
parser.add_option("-f","--data_format" , action="store", type="string", help="Specify the output format of the vector and scalar field. Supported formats are: xsf,npy", default="xsf")
# fmt: on
(options, args) = parser.parse_args()
options, args = parser.parse_args()

try:
points = np.genfromtxt(options.p)
Expand Down
2 changes: 1 addition & 1 deletion ppafm/cli/utilities/xsf2png.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
parser.add_option( "--atoms", action="store", type="string", default='input_plot.xyz', help="xyz geometry file", )
parser.add_option( "--bonds", action="store_true", default=False, help="plot bonds to images" )
# fmt: on
(options, args) = parser.parse_args()
options, args = parser.parse_args()


atoms = None
Expand Down
2 changes: 1 addition & 1 deletion ppafm/fieldFFT.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def getSize(inp_axis, dims, sampleSize):

def getMGrid(dims, dd):
"returns coordinate arrays X, Y, Z"
(dx, dy, dz) = dd
dx, dy, dz = dd
XYZ = np.mgrid[0 : dims[0], 0 : dims[1], 0 : dims[2]].astype(float)
# fmt: off
xshift = dims[0]//2; xshift_ = xshift;
Expand Down
11 changes: 3 additions & 8 deletions ppafm/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,7 @@ def _orthoLvec(sh, dd):
return [[0, 0, 0], [sh[2] * dd[0], 0, 0], [0, sh[1] * dd[1], 0], [0, 0, sh[0] * dd[2]]]


XSF_HEAD_DEFAULT = (
headScan
) = """
XSF_HEAD_DEFAULT = headScan = """
ATOMS
1 0.0 0.0 0.0

Expand Down Expand Up @@ -934,8 +932,7 @@ def load_scal_field(fname, data_format="xsf"):
#end
"""

DEFAULT_POV_HEAD = (
"""
DEFAULT_POV_HEAD = """
// ***********************************************
// Camera & other global settings
// ***********************************************
Expand All @@ -950,9 +947,7 @@ def load_scal_field(fname, data_format="xsf"):
up < 0, Zoom, 0 >
look_at < .0.0, 0.0, 0.0 >
}
"""
+ DEFAULT_POV_HEAD_NO_CAM
)
""" + DEFAULT_POV_HEAD_NO_CAM


def makePovCam(pos, up=[0.0, 1.0, 0.0], rg=[-1.0, 0.0, 0.0], fw=[0.0, 0.0, 100.0], lpos=[0.0, 0.0, -100.0], W=10.0, H=10.0):
Expand Down
3 changes: 1 addition & 2 deletions ppafm/ml/CorrectionLoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

"""


import numpy as np

from .. import common as PPU
Expand Down Expand Up @@ -475,7 +474,7 @@ def Job_CorrectionLoop(simulator, atoms, bonds, geom_fname="input.xyz", nstep=10

parser = OptionParser()
parser.add_option("-j", "--job", action="store", type="string", help="[train/loop]")
(options, args) = parser.parse_args()
options, args = parser.parse_args()

logger.info(" UNIT_TEST START : CorrectionLoop ... ")

Expand Down
Loading