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
85 changes: 44 additions & 41 deletions docs/examples/sequential_fit_example.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
from pdfbl.sequential.sequential_cmi_runner import SequentialCMIRunner

sts = SequentialCMIRunner()
sts.load_inputs(
input_data_dir="docs/examples/input_files",
structure_path="docs/examples/Ni.cif",
output_result_dir="docs/examples/results",
filename_order_pattern=r"(\d+)K\.gr",
refinable_variable_names=[
"a_1",
"s0",
"Uiso_0_1",
"delta2_1",
"qdamp",
"qbroad",
],
initial_variable_values={
"s0": 0.4,
"qdamp": 0.04,
"qbroad": 0.02,
"a_1": 3.52,
"Uiso_0_1": 0.005,
"delta2_1": 2,
},
xmin=1.5,
xmax=25.0,
dx=0.01,
qmax=25,
qmin=0.1,
# whether_plot_y=True,
# whether_plot_ycalc=True,
# plot_variable_names=["a_1"],
# plot_result_names=["residual"],
plot_intermediate_result_names=["residual"],
)
# Uncomment when "Ni_PDF_20250922-222655_ca8ae7_14K_result.json" is available
# sts.set_start_input_file(
# "Ni_PDF_20250922-222655_ca8ae7_14K.gr",
# input_filename_to_result_filename=lambda input_filename: input_filename.replace( # noqa E501
# ".gr", "_result.json"
# ),
# )
sts.run(mode="stream")
if __name__ == "__main__":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we normally define a main and then we just run

if __name__ == "__main__":
    main()

This is cleaner than what is done here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is completed via #34

sts = SequentialCMIRunner()
sts.load_inputs(
input_data_dir="docs/examples/input_files",
structure_path="docs/examples/Ni.cif",
output_result_dir="docs/examples/results",
filename_order_pattern=r"(\d+)K\.gr",
refinable_variable_names=[
"a_1",
"s0",
"Uiso_0_1",
"delta2_1",
"qdamp",
"qbroad",
],
initial_variable_values={
"s0": 0.4,
"qdamp": 0.04,
"qbroad": 0.02,
"a_1": 3.52,
"Uiso_0_1": 0.005,
"delta2_1": 2,
},
xmin=1.5,
xmax=25.0,
dx=0.01,
qmax=25,
qmin=0.1,
# whether_plot_y=True,
# whether_plot_ycalc=True,
# plot_variable_names=["a_1"],
# plot_result_names=["residual"],
plot_intermediate_result_names=["residual"],
)

# Uncomment when "Ni_PDF_20250922-222655_ca8ae7_14K_result.json" is
# available
# sts.set_start_input_file(
# "Ni_PDF_20250922-222655_ca8ae7_14K.gr",
# input_filename_to_result_filename=lambda input_filename: input_filename.replace( # noqa E501
# ".gr", "_result.json"
# ),
# )
sts.run(mode="stream")
23 changes: 23 additions & 0 deletions news/windows-compatible.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Fix compatibility issue in windows.

**Security:**

* <news item>
2 changes: 1 addition & 1 deletion requirements/conda.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ numpy
diffpy.cmi
scipy
prompt_toolkit
matplotlib
matplotlib-base
bg-mpl-stylesheets
psutil
Loading