Skip to content

Commit f8d4eee

Browse files
committed
Rebasing
1 parent 0973bb8 commit f8d4eee

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

src/diffpy/morph/morphapp.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def custom_error(self, msg):
403403
return parser
404404

405405

406-
def single_morph(parser, opts, pargs, stdout_flag=True, return_morph=False):
406+
def single_morph(parser, opts, pargs, stdout_flag=True, python_wrap=False):
407407
if len(pargs) < 2:
408408
parser.error("You must supply FILE1 and FILE2.")
409409
elif len(pargs) > 2:
@@ -614,12 +614,14 @@ def single_morph(parser, opts, pargs, stdout_flag=True, return_morph=False):
614614
l_width=l_width,
615615
)
616616

617-
if return_morph:
617+
# Return different things depending on whether it is python interfaced
618+
if python_wrap:
618619
return morph_results, chain.x_morph_out, chain.y_morph_out
619-
return morph_results
620+
else:
621+
return morph_results
620622

621623

622-
def multiple_targets(parser, opts, pargs, stdout_flag=True):
624+
def multiple_targets(parser, opts, pargs, stdout_flag=True, python_wrap=False):
623625
# Custom error messages since usage is distinct when --multiple tag is
624626
# applied
625627
if len(pargs) < 2:
@@ -800,10 +802,14 @@ def multiple_targets(parser, opts, pargs, stdout_flag=True):
800802
"morph and target pair. No plot shown."
801803
)
802804

803-
return morph_results
805+
if python_wrap:
806+
# FIXME: Return dictionary of morphs
807+
return morph_results
808+
else:
809+
return morph_results
804810

805811

806-
def multiple_morphs(parser, opts, pargs, stdout_flag=True):
812+
def multiple_morphs(parser, opts, pargs, stdout_flag=True, python_wrap=False):
807813
# Custom error messages since usage is distinct when --multiple tag is
808814
# applied
809815
if len(pargs) < 2:
@@ -985,7 +991,11 @@ def multiple_morphs(parser, opts, pargs, stdout_flag=True):
985991
"morph and target pair. No plot shown."
986992
)
987993

988-
return morph_results
994+
if python_wrap:
995+
# FIXME: Return dictionary of morphs
996+
return morph_results
997+
else:
998+
return morph_results
989999

9901000

9911001
def getPDFFromFile(fn):

src/diffpy/morph/morphpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def morph(file1, file2, **kwargs):
3232
(opts, pargs) = parser.parse_args(inputs)
3333
pargs = [file1, file2]
3434

35-
return single_morph(parser, opts, pargs)
35+
return single_morph(parser, opts, pargs, stdout_flag=False, python_wrap=True)
3636

3737

3838
def morph_multiple_targets(file, dir, **kwargs):

0 commit comments

Comments
 (0)