Skip to content

Commit 90407b4

Browse files
committed
Bug fix
1 parent 4b06314 commit 90407b4

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/diffpy/morph/morphapp.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,16 +410,18 @@ def single_morph(parser, opts, pargs, stdout_flag=True, python_wrap=False):
410410
parser.error(
411411
"Too many arguments. Make sure you only supply FILE1 and FILE2."
412412
)
413-
elif (len(pargs) != 2 or len(pargs) != 6) and python_wrap:
414-
parser.error("Python wrapper error.")
413+
elif not (len(pargs) == 2 or len(pargs) == 6) and python_wrap:
414+
parser.error(
415+
"Python wrapper error."
416+
)
415417

416418
# Get the PDFs
417419
# If we get from python, we may wrap, which has input size 4
418420
if len(pargs) == 6 and python_wrap:
419-
x_morph = pargs[1]
420-
y_morph = pargs[2]
421-
x_target = pargs[3]
422-
y_target = pargs[4]
421+
x_morph = pargs[2]
422+
y_morph = pargs[3]
423+
x_target = pargs[4]
424+
y_target = pargs[5]
423425
else:
424426
x_morph, y_morph = getPDFFromFile(pargs[0])
425427
x_target, y_target = getPDFFromFile(pargs[1])

src/diffpy/morph/morphpy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def morph(morph_file, target_file, **kwargs):
4242
)
4343

4444

45-
def morphpy(morph_table, target_table, morph_header, target_header, **kwargs):
45+
def morphpy(morph_table, target_table, morph_header=None, target_header=None, **kwargs):
4646
"""Run diffpy.morph at Python level.
4747
4848
Parameters
@@ -82,6 +82,7 @@ def morphpy(morph_table, target_table, morph_header, target_header, **kwargs):
8282
y_target = target_table[:, 1]
8383

8484
pargs = ["Morph", "Target", x_morph, y_morph, x_target, y_target]
85+
print(pargs)
8586

8687
return single_morph(
8788
parser, opts, pargs, stdout_flag=False, python_wrap=True

0 commit comments

Comments
 (0)