Skip to content

Commit 5caa18e

Browse files
committed
Add documentation
1 parent 4d6fe0f commit 5caa18e

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

docs/source/morphpy.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Python Morphing Functions
3838

3939
* ``morph_info`` contains all morphs as keys (e.g. ``"scale"``, ``"stretch"``, ``"smear"``) with
4040
the optimized morphing parameters found by ``diffpy.morph`` as values. ``morph_info`` also contains
41-
the Rw and Pearson correlation coefficients found post-morphing. Try printing ``print(morph_info)``
41+
the Rw and Pearson correlation coefficients found post-morphing. Try printing ``print(morph_info)``
4242
and compare the values stored in this dictionary to those given by the CLI output!
4343
* ``morph_table`` is a two-column array of the morphed function interpolated onto the grid of the
4444
target function (e.g. in our example, it returns the contents of `darkSub_rh20_C_01.gr` after
@@ -74,6 +74,10 @@ General Parameters
7474

7575
save: str or path
7676
Save the morphed function to a the file passed to save. Use '-' for stdout.
77+
get_diff: bool
78+
Return the difference function (morphed function minus target function) instead of
79+
the morphed function (default). When save is enabled, the difference function
80+
is saved instead of the morphed function.
7781
verbose: bool
7882
Print additional header details to saved files. These include details about the morph
7983
inputs and outputs.
@@ -240,4 +244,4 @@ As you can see, the fitted scale and offset values match the ones used
240244
to generate the target (scale=20 & offset=0.8). This example shows how
241245
``MorphFuncy`` can be used to fit and apply custom transformations. Now
242246
it's your turn to experiment with other custom functions that may be useful
243-
for analyzing your data.
247+
for analyzing your data.

src/diffpy/morph/morphapp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def custom_error(self, msg):
9393
parser.add_option(
9494
"--diff",
9595
"--get-diff",
96-
dest="diff",
96+
dest="get_diff",
9797
action="store_true",
9898
help=(
9999
"Save the difference curve rather than the manipulated function.\n"
@@ -719,7 +719,7 @@ def single_morph(
719719

720720
# Print summary to terminal and save morph to file if requested
721721
xy_save = [chain.x_morph_out, chain.y_morph_out]
722-
if opts.diff is not None:
722+
if opts.get_diff is not None:
723723
diff_chain = morphs.MorphChain(
724724
{"rmin": None, "rmax": None, "rstep": None}
725725
)

tests/test_morphpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def test_morph_opts(self, setup_morph):
9797
"addpearson": True,
9898
"apply": True,
9999
"reverse": True,
100-
"diff": True,
100+
"get_diff": True,
101101
"multiple_morphs": True,
102102
"multiple_targets": True,
103103
}

0 commit comments

Comments
 (0)