Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
eaf0934
Implement the extinction category
AndrewSazonov Jan 28, 2026
dd24606
Implement the linked crystal category
AndrewSazonov Jan 28, 2026
020038d
Add base class for single crystal experiments
AndrewSazonov Jan 29, 2026
72b8627
Clarify sy handling; move background property
AndrewSazonov Jan 29, 2026
8cebe17
Update BraggScExperiment class
AndrewSazonov Jan 29, 2026
2a8075a
Add SC Bragg reflection data and linked crystal
AndrewSazonov Jan 29, 2026
b31ebdb
Add single-crystal Bragg CW data mapping
AndrewSazonov Jan 29, 2026
e22debe
Remove unused linked crystal validator
AndrewSazonov Jan 29, 2026
827293e
Add minimizer flag to calculator API
AndrewSazonov Jan 29, 2026
04e422f
Remove lru_cache; update data index hash
AndrewSazonov Jan 29, 2026
82e50df
Add single-crystal Tb2TiO7 HEiDi tutorial
AndrewSazonov Jan 29, 2026
18c3082
Add TODO about sy handling when loading CIF
AndrewSazonov Jan 30, 2026
f16c612
Add single-crystal support to Cryspy calculator
AndrewSazonov Feb 1, 2026
8cdf74c
Add stol propagation and d-spacing for SC data
AndrewSazonov Feb 1, 2026
bfc93f1
Add d-spacing computation and fix plotting checks
AndrewSazonov Feb 1, 2026
cde45c9
Update SC tutorial
AndrewSazonov Feb 1, 2026
ba85bad
Use Cryspy-calculated intensity output
AndrewSazonov Feb 1, 2026
aac680e
Update SC tutorial
AndrewSazonov Feb 1, 2026
def7bef
Update data index checksum
AndrewSazonov Feb 1, 2026
c104b56
Add new SC-TOF tutorial
AndrewSazonov Feb 2, 2026
36eb62e
Add TOF single-crystal support via Cryspy
AndrewSazonov Feb 2, 2026
edf2870
Apply formatting
AndrewSazonov Feb 2, 2026
678d056
Cache tutorials index; adjust Bragg SC test
AndrewSazonov Feb 2, 2026
db99d08
Add single-crystal F2 meas-vs-calc plot
AndrewSazonov Feb 2, 2026
509822b
Update SG tutorials
AndrewSazonov Feb 2, 2026
481711a
Add Single Crystal Diffraction section to docs
AndrewSazonov Feb 2, 2026
6326c98
Update SC tutorial
AndrewSazonov Feb 3, 2026
fc0c98c
Merge branch 'develop' into 25-implement-single-crystal-diffraction-s…
AndrewSazonov Feb 11, 2026
b678b86
Lower coverage threshold to 60%
AndrewSazonov Feb 11, 2026
b57c707
Clarify Miller index and intensity descriptions
AndrewSazonov Feb 11, 2026
4dcaf8f
Add TODOs and fix docstring
AndrewSazonov Feb 11, 2026
9bb587a
Remove ED tutorial data; tidy pyproject comments
AndrewSazonov Feb 11, 2026
05a399f
Remove kwargs from Refln init; add return type
AndrewSazonov Feb 11, 2026
fe1f206
Add units to extinction parameters
AndrewSazonov Feb 11, 2026
1711137
Add single-crystal neutron fitting tests
AndrewSazonov Feb 11, 2026
61fa60d
Reduce Ruff excludes; lint/format tests
AndrewSazonov Feb 11, 2026
09cb56a
Simplify single-crystal category initializers
AndrewSazonov Feb 11, 2026
62fe41e
Rename refln_id to id per coreCIF
AndrewSazonov Feb 12, 2026
c64f4fa
Add CW/TOF SC ASCII import with wavelength
AndrewSazonov Feb 12, 2026
c7f2b31
Rename plot_sg to plot_sc for single-crystal
AndrewSazonov Feb 14, 2026
498f2d5
Add single-crystal scatter comparison plotting
AndrewSazonov Feb 14, 2026
b651307
Extract scatter trace creation to helper
AndrewSazonov Feb 16, 2026
9c4506e
Rename traces for powder and single-crystal
AndrewSazonov Feb 16, 2026
69fa14d
Use Plotly autorange; drop fixed axis limits
AndrewSazonov Feb 16, 2026
d6390bc
Extract Plotly config to helper
AndrewSazonov Feb 16, 2026
d8ec52c
Centralize Plotly figure display logic
AndrewSazonov Feb 16, 2026
8213e31
Refactor Plotly figure creation and formatting
AndrewSazonov Feb 16, 2026
8eecd64
Draw identity line in paper coordinates
AndrewSazonov Feb 16, 2026
d0a9315
Add reusable Plotly layout helper
AndrewSazonov Feb 16, 2026
7c0b756
Extract diagonal reference line helper
AndrewSazonov Feb 16, 2026
2f23ef6
Rename plot methods for powder/single-crystal
AndrewSazonov Feb 16, 2026
d15f5b5
Reformat Plotly plotter for readability
AndrewSazonov Feb 16, 2026
9a03f11
Clarify diffraction plotter docstrings
AndrewSazonov Feb 16, 2026
ab817a9
Add single-crystal plotting tests
AndrewSazonov Feb 16, 2026
6edca4d
Remove deprecated plot alias; update tests
AndrewSazonov Feb 16, 2026
c04ba10
Add sin(theta)/lambda to d-spacing conversion
AndrewSazonov Mar 9, 2026
6aa90c2
Update SC data API; compute d-spacing via util
AndrewSazonov Mar 9, 2026
cefdd10
Fix reflection index attribute names
AndrewSazonov Mar 9, 2026
43b2ab3
Add single-crystal support to plotter base
AndrewSazonov Mar 9, 2026
c51065a
Unify powder/SC plotting with axis auto-detect
AndrewSazonov Mar 9, 2026
885038b
Unify plotting API; replace d_spacing with x
AndrewSazonov Mar 9, 2026
8ac2be4
Rename all_x to unfiltered_x
AndrewSazonov Mar 9, 2026
cad4ff2
Rename meas/calc to intensity_*; add axis aliases
AndrewSazonov Mar 9, 2026
2ae1b7b
Rename TotalData module to total_pd
AndrewSazonov Mar 9, 2026
507baad
Update tests for sample-form and intensity API
AndrewSazonov Mar 9, 2026
b453cbf
Log read/validation errors; import numpy globally
AndrewSazonov Mar 9, 2026
4f9869b
Move instrument and extinction to SC base
AndrewSazonov Mar 9, 2026
1661bba
Split Bragg SC into CWL/TOF; update factory
AndrewSazonov Mar 9, 2026
60f6487
Refactor single-crystal instrument support
AndrewSazonov Mar 9, 2026
d244bd8
Move instrument init to BraggPdExperiment
AndrewSazonov Mar 9, 2026
d910ab3
Update tests for Pd/Sc instrument classes
AndrewSazonov Mar 9, 2026
778fc5e
Add scattering-type aware x-axis defaults
AndrewSazonov Mar 9, 2026
133d655
Increase CIF float precision to 8 decimals
AndrewSazonov Mar 9, 2026
794d32d
Update pixi lock
AndrewSazonov Mar 9, 2026
14e2966
Update docs code examples for style consistency
AndrewSazonov Mar 9, 2026
0093d37
Pin scipp for ARM macOS; use editable local pkg
AndrewSazonov Mar 9, 2026
901c514
Refactor plotting; unify axis and data prep
AndrewSazonov Mar 10, 2026
452e0b8
Add macOS 14.0 minimum version requirement
AndrewSazonov Mar 13, 2026
3e738b2
Update plot_meas_vs_calc calls to use 'x' parameter for d_spacing
AndrewSazonov Mar 14, 2026
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
5 changes: 4 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,15 @@ nav:
- LBCO quick code: tutorials/ed-2.ipynb
- LBCO basic: tutorials/ed-3.ipynb
- PbSO4 advanced: tutorials/ed-4.ipynb
- Standard Diffraction:
- Powder Diffraction:
- Co2SiO4 pd-neut-cwl: tutorials/ed-5.ipynb
- HS pd-neut-cwl: tutorials/ed-6.ipynb
- Si pd-neut-tof: tutorials/ed-7.ipynb
- NCAF pd-neut-tof: tutorials/ed-8.ipynb
- LBCO+Si McStas: tutorials/ed-9.ipynb
- Single Crystal Diffraction:
- Tb2TiO7 sg-neut-cwl: tutorials/ed-14.ipynb
- Taurine sg-neut-tof: tutorials/ed-15.ipynb
- Pair Distribution Function:
- Ni pd-neut-cwl: tutorials/ed-10.ipynb
- Si pd-neut-tof: tutorials/ed-11.ipynb
Expand Down
11 changes: 10 additions & 1 deletion docs/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The tutorials are organized into the following categories.
refinement of the PbSO4 crystal structure based on the joint fit of both X-ray
and neutron diffraction data.

## Standard Diffraction
## Powder Diffraction

- [Co2SiO4 `pd-neut-cwl`](ed-5.ipynb) – Demonstrates a Rietveld refinement of
the Co2SiO4 crystal structure using constant wavelength neutron powder
Expand All @@ -61,6 +61,15 @@ The tutorials are organized into the following categories.
secondary phase using time-of-flight neutron powder diffraction data simulated
with McStas.

## Single Crystal Diffraction

- [Tb2TiO7 `sg-neut-cwl`](ed-14.ipynb) – Demonstrates structure refinement of
Tb2TiO7 using constant wavelength neutron single crystal diffraction data from
HEiDi at FRM II.
- [Taurine `sg-neut-tof`](ed-15.ipynb) – Demonstrates structure refinement of
Taurine using time-of-flight neutron single crystal diffraction data from
SENJU at J-PARC.

## Pair Distribution Function (PDF)

- [Ni `pd-neut-cwl`](ed-10.ipynb) – Demonstrates a PDF analysis of Ni using data
Expand Down
12 changes: 6 additions & 6 deletions docs/user-guide/analysis-workflow/analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,21 +271,21 @@ An example of setting aliases for parameters in a sample model:
# Set aliases for the atomic displacement parameters
project.analysis.aliases.add(
label='biso_La',
param_uid=project.sample_models['lbco'].atom_sites['La'].b_iso.uid
param_uid=project.sample_models['lbco'].atom_sites['La'].b_iso.uid,
)
project.analysis.aliases.add(
label='biso_Ba',
param_uid=project.sample_models['lbco'].atom_sites['Ba'].b_iso.uid
param_uid=project.sample_models['lbco'].atom_sites['Ba'].b_iso.uid,
)

# Set aliases for the occupancies of the atom sites
project.analysis.aliases.add(
label='occ_La',
param_uid=project.sample_models['lbco'].atom_sites['La'].occupancy.uid
param_uid=project.sample_models['lbco'].atom_sites['La'].occupancy.uid,
)
project.analysis.aliases.add(
label='occ_Ba',
param_uid=project.sample_models['lbco'].atom_sites['Ba'].occupancy.uid
param_uid=project.sample_models['lbco'].atom_sites['Ba'].occupancy.uid,
)
```

Expand All @@ -302,12 +302,12 @@ An example of setting constraints for the aliases defined above:
```python
project.analysis.constraints.add(
lhs_alias='biso_Ba',
rhs_expr='biso_La'
rhs_expr='biso_La',
)

project.analysis.constraints.add(
lhs_alias='occ_Ba',
rhs_expr='1 - occ_La'
rhs_expr='1 - occ_La',
)
```

Expand Down
43 changes: 26 additions & 17 deletions docs/user-guide/analysis-workflow/experiment.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,24 @@ explicitly defined:

```python
# Add an experiment with default parameters, based on the specified type.
project.experiments.add_from_data_path(name='hrpt',
data_path='data/hrpt_lbco.xye',
sample_form='powder',
beam_mode='constant wavelength',
radiation_probe='neutron',
scattering_type='bragg')
project.experiments.add_from_data_path(
name='hrpt',
data_path='data/hrpt_lbco.xye',
sample_form='powder',
beam_mode='constant wavelength',
radiation_probe='neutron',
scattering_type='bragg',
)
```

To add an experiment of default type, you can simply do:

```python
# Add an experiment of default type
project.experiments.add_from_data_path(name='hrpt',
data_path='data/hrpt_lbco.xye')
project.experiments.add_from_data_path(
name='hrpt',
data_path='data/hrpt_lbco.xye',
)
```

If you do not have measured data for fitting and only want to view the simulated
Expand All @@ -127,10 +131,12 @@ pattern, you can define an experiment without measured data using the

```python
# Add an experiment without measured data
project.experiments.add_without_data(name='hrpt',
sample_form='powder',
beam_mode='constant wavelength',
radiation_probe='x-ray')
project.experiments.add_without_data(
name='hrpt',
sample_form='powder',
beam_mode='constant wavelength',
radiation_probe='x-ray',
)
```

Finally, you can also add an experiment by passing the experiment object
Expand All @@ -139,11 +145,14 @@ directly using the `add` method:
```python
# Add an experiment by passing the experiment object directly
from easydiffraction import Experiment
experiment = Experiment(name='hrpt',
sample_form='powder',
beam_mode='constant wavelength',
radiation_probe='neutron',
scattering_type='bragg')

experiment = Experiment(
name='hrpt',
sample_form='powder',
beam_mode='constant wavelength',
radiation_probe='neutron',
scattering_type='bragg',
)
project.experiments.add(experiment)
```

Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/analysis-workflow/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ project.sample_models['nacl'].atom_sites.append(
fract_y=0,
fract_z=0,
occupancy=1,
b_iso_or_equiv=0.5
b_iso_or_equiv=0.5,
)
project.sample_models['nacl'].atom_sites.append(
label='Cl',
Expand All @@ -113,7 +113,7 @@ project.sample_models['nacl'].atom_sites.append(
fract_y=0,
fract_z=0.5,
occupancy=1,
b_iso_or_equiv=0.5
b_iso_or_equiv=0.5,
)
```

Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/analysis-workflow/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ project = ed.Project(name='lbco_hrpt')

# Define project info
project.info.title = 'La0.5Ba0.5CoO3 from neutron diffraction at HRPT@PSI'
project.info.description = '''This project demonstrates a standard refinement
project.info.description = """This project demonstrates a standard refinement
of La0.5Ba0.5CoO3, which crystallizes in a perovskite-type structure, using
neutron powder diffraction data collected in constant wavelength mode at the
HRPT diffractometer (PSI).'''
HRPT diffractometer (PSI)."""
```

## Saving a Project
Expand Down
18 changes: 9 additions & 9 deletions docs/user-guide/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ example, you can import the `Project`, `SampleModel`, `Experiment` classes and
`download_from_repository` method like this:

```python
from easydiffraction import (
Project,
SampleModel,
Experiment,
download_from_repository
)
from easydiffraction import Project
from easydiffraction import SampleModel
from easydiffraction import Experiment
from easydiffraction import download_from_repository
```

This enables you to use these classes and methods directly without the package
Expand All @@ -73,9 +71,11 @@ For example, you can download a sample data file like this:
```python
import easydiffraction as ed

ed.download_from_repository('hrpt_lbco.xye',
branch='docs',
destination='data')
ed.download_from_repository(
'hrpt_lbco.xye',
branch='docs',
destination='data',
)
```

This command will download the `hrpt_lbco.xye` file from the `docs` branch of
Expand Down
Loading
Loading