Skip to content
Open
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
2 changes: 1 addition & 1 deletion CODE-OF-CONDUCT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
sb2896@columbia.edu. All complaints will be reviewed and investigated promptly and fairly.
sbillinge@ucsb.edu. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Before contributing, please read our `Code of Conduct <https://github.com/diffpy
Contact
-------

For more information on diffpy.cmi please visit the project `web-page <https://diffpy.github.io/>`_ or email Simon Billinge at sb2896@columbia.edu.
For more information on diffpy.cmi please visit the project `web-page <https://diffpy.github.io/>`_ or email Simon Billinge at sbillinge@ucsb.edu.

Acknowledgements
----------------
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/core/debye-waller/debyemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def main():
res = FitResults(recipe)

# Print the results
res.print_results()
res.print_results_table()

# Plot the results
recipe.plot_recipe(
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/core/debye-waller/debyemodelII.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def main():
res = FitResults(recipe)

# Print the results
res.print_results()
res.print_results_table()

# Plot the results
plot_results(recipe)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/core/gaussianfit/gaussianrecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def main():
res = FitResults(recipe)

# Print the results.
res.print_results()
res.print_results_table()

# Plot the results.
recipe.plot_recipe()
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/core/gaussianfit/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def main():

res = FitResults(r)
# Print the results.
res.print_results()
res.print_results_table()
# Plot the results.
r.plot_recipe(xlabel="x", ylabel="y")

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/core/gaussianfit/simplerecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def main():
leastsq(recipe.residual, recipe.values)

# Print the results
recipe.print_results()
recipe.results.print_results_table(update=True)

return

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/core/gaussianfit/threedoublepeaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@ def steer_fit(recipe):
recipe = make_recipe()
steer_fit(recipe)
res = FitResults(recipe)
res.print_results()
res.print_results_table()
recipe.plot_recipe()
2 changes: 1 addition & 1 deletion docs/examples/core/intensityfit/npintensity.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def main():
rescount = recipe.fithooks[0].count
calcount = recipe.bucky.I.count
footer = "iofq called %i%% of the time" % int(100.0 * calcount / rescount)
res.print_results(footer=footer)
res.print_results_table(footer=footer)

# Plot!
plot_results(recipe)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/core/intensityfit/npintensityII.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def main():

# Generate and print the FitResults
res = FitResults(recipe)
res.print_results()
res.print_results_table()

# Plot!
plot_results(recipe)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,10 @@
" profile.savetxt(fitdir / f\"{basename}.fit\")\n",
"\n",
" # 26: We use the 'FitResults' method to parse out the results from\n",
" # the optimized Fit Recipe, and 'print_results' to print them\n",
" # the optimized Fit Recipe, and 'print_results_table' to print them\n",
" # to the terminal.\n",
" res = FitResults(recipe)\n",
" res.print_results()\n",
" res.print_results_table()\n",
"\n",
" # 27: We use the 'save_results' method of 'FitResults' to write a text file\n",
" # containing the fitted parameters and fit quality indices to disk.\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
"\n",
" # 27 Print the fit results to the terminal.\n",
" res = FitResults(recipe)\n",
" res.print_results()\n",
" res.print_results_table()\n",
"\n",
" # 28 Write the fit results to a file.\n",
" header = \"crystal_HF.\\n\"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ def main():
profile.savetxt(fitdir / f"{basename}.fit")

# 26: We use the 'FitResults' method to parse out the results from
# the optimized Fit Recipe, and 'printResults' to print them
# the optimized Fit Recipe, and 'print_results_table' to print them
# to the terminal.
res = FitResults(recipe)
res.print_results()
res.print_results_table()

# 27: We use the 'saveResults' method of 'FitResults' to write a text file
# containing the fitted parameters and fit quality indices to disk.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def main():

# 27 Print the fit results to the terminal.
res = FitResults(recipe)
res.print_results()
res.print_results_table()

# 28 Write the fit results to a file.
header = "crystal_HF.\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def main():

# 24 Print the fit results to the terminal.
res = FitResults(recipe)
res.print_results()
res.print_results_table()

# 25 Write the fit results to a file.
header = "crystal_HF.\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def main():

# 29: Print the fit results to the terminal.
res = FitResults(recipe)
res.print_results()
res.print_results_table()

# 30: Write the fit results to a file.
header = "crystal_HF.\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def main():

# 34: Print the fit results to the terminal.
res = FitResults(recipe)
res.print_results()
res.print_results_table()

# 35: Write the fit results to a file.
header = "crystal_HF.\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def main():

# 58: Print the fit results to the terminal.
res = FitResults(recipe)
res.print_results()
res.print_results_table()

# 59: Write the fit results to a file.
header = "crystal_HF.\n"
Expand Down Expand Up @@ -571,7 +571,7 @@ def main():

# 68: Print the fit results to the terminal.
res = FitResults(recipe)
res.print_results()
res.print_results_table()

# 69: Write the fit results to a file.
header = "crystal_HF.\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def main():

# Print the fit results to the terminal.
res = FitResults(recipe)
res.print_results()
res.print_results_table()

# Write the fit results to a file.
header = "crystal_HF.\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/pdf/nanoparticle-fit/coreshellnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def main():

# Generate and print the FitResults
res = FitResults(recipe)
res.print_results()
res.print_results_table()

# Plot!
recipe.plot_recipe(xlabel=r"$r (\AA)$", ylabel=r"$G (\AA^{-2})$")
Expand Down
24 changes: 24 additions & 0 deletions news/print-results-table.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Added:**

* <news item>

**Changed:**

* Simon Billinge's contact email to sbillinge@ucsb.edu.
* The examples print their fit results with ``FitResults.print_results_table``, which shows them as tables with the variables grouped by tag.

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* ``diffpy`` is a pkgutil-style namespace package, so ``diffpy.cmi`` can be imported alongside other ``diffpy`` packages.

**Security:**

* <news item>
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ build-backend = "setuptools.build_meta"
name = "diffpy.cmi"
dynamic=['version', 'dependencies']
authors = [
{ name="Simon Billinge", email="sb2896@columbia.edu" },
{ name="Simon Billinge", email="sbillinge@ucsb.edu" },
]
maintainers = [
{ name="Simon Billinge", email="sb2896@columbia.edu" },
{ name="Simon Billinge", email="sbillinge@ucsb.edu" },
]
description = "Complex modeling infrastructure: a modular framework for multi-modal modeling of scientific data."
keywords = ['modelling', 'regression', 'diffraction', 'PDF', 'complex-modeling']
Expand Down
4 changes: 4 additions & 0 deletions src/diffpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
# See LICENSE.rst for license information.
#
##############################################################################

from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)
2 changes: 2 additions & 0 deletions validators/validate_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import shutil
from pathlib import Path

import matplotlib.pyplot as plt
import pytest

PROJECT_ROOT = Path(__file__).resolve().parents[1]
Expand Down Expand Up @@ -30,3 +31,4 @@ def test_all_examples(tmp_examples):
script_relative_path = script.relative_to(tmp_examples)
print(f"Testing {script_relative_path}")
runpy.run_path(str(script), run_name="__main__")
plt.close("all")
Loading