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
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WARNING: Do not edit this file manually.
# Any changes will be overwritten by Copier.
_commit: v0.10.1-40-g29e2ccf
_commit: v0.10.1-41-g508666e
_src_path: gh:easyscience/templates
app_docs_url: https://easyscience.github.io/diffraction-app
app_doi: 10.5281/zenodo.18163581
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
run: pixi init easydiffraction

- name: Set the minimum system requirements
working-directory: easydiffraction
run: pixi project system-requirements add macos 14.0

- name: Add Python 3.14 from Conda
Expand Down
38 changes: 36 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,27 @@ jobs:
echo
echo "🔹🔸🔹🔸🔹 Python: $py_ver 🔹🔸🔹🔸🔹"

env="py-$(echo $py_ver | tr -d .)-env" # Converts 3.11 -> py-311-env
env="py-$(echo $py_ver | tr -d .)-env" # Converts 3.XX -> py-3XX-env

echo "Running tests in environment: $env"
pixi run --environment $env unit-tests
done

- name: Run functional tests
shell: bash
run: |
set -euo pipefail

for py_ver in $PY_VERSIONS; do
echo
echo "🔹🔸🔹🔸🔹 Python: $py_ver 🔹🔸🔹🔸🔹"

env="py-$(echo $py_ver | tr -d .)-env" # Converts 3.XX -> py-3XX-env

echo "Running tests in environment: $env"
pixi run --environment $env functional-tests
done

- name: Run integration tests ${{ needs.env-prepare.outputs.pytest-marks }}
shell: bash
run: |
Expand All @@ -114,7 +129,7 @@ jobs:
echo
echo "🔹🔸🔹🔸🔹 Python: $py_ver 🔹🔸🔹🔸🔹"

env="py-$(echo $py_ver | tr -d .)-env" # Converts 3.11 -> py-311-env
env="py-$(echo $py_ver | tr -d .)-env" # Converts 3.XX -> py-3XX-env

echo "Running tests in environment: $env"
pixi run --environment $env integration-tests ${{ needs.env-prepare.outputs.pytest-marks }}
Expand Down Expand Up @@ -263,6 +278,25 @@ jobs:
cd ..
done

- name: Run functional tests
shell: bash
run: |
set -euo pipefail

for py_ver in $PY_VERSIONS; do
echo
echo "🔹🔸🔹🔸🔹 Python: $py_ver 🔹🔸🔹🔸🔹"

echo "Entering pixi project directory easydiffraction_py$py_ver"
cd easydiffraction_py$py_ver

echo "Running tests"
pixi run python -m pytest ../tests/functional/ --color=yes -v

echo "Exiting pixi project directory"
cd ..
done

- name: Run integration tests ${{ needs.env-prepare.outputs.pytest-marks }}
shell: bash
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ CMakeLists.txt.user*
# Used to fetch tutorials data during their runtime. Need to have '/' at
# the beginning to avoid ignoring 'data' module in the src/.
/data/
/tmp/
30 changes: 14 additions & 16 deletions docs/architecture/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ Legend:

### Atomic Displacement Parameters (ADP)

| Feature | LIB | APP |
| ----------------------------------------------- | ----------- | --- |
| Isotropic Biso | ✅ | 🗓 |
| Isotropic Uiso | 🗓 | ✅ |
| Anisotropic Bani _B11, B22, B33, B12, B13, B23_ | 🗓`highest` | 🗓 |
| Anisotropic Uani _U11, U22, U33, U12, U13, U23_ | 🗓 | 🗓 |
| Feature | LIB | APP |
| ----------------------------------------------- | --- | --- |
| Isotropic Biso | ✅ | 🗓 |
| Isotropic Uiso | 🚧 | ✅ |
| Anisotropic Bani _B11, B22, B33, B12, B13, B23_ | 🚧 | 🗓 |
| Anisotropic Uani _U11, U22, U33, U12, U13, U23_ | 🚧 | 🗓 |

---

Expand Down Expand Up @@ -110,9 +110,9 @@ Legend:
| Feature | LIB | APP |
| -------------------------------------------------------- | --- | --- |
| Wavelength | ✅ | ✅ |
| Second wavelength | 🚧 | 🗓 |
| Second wavelength | 🗓 | 🗓 |
| 2θ offset | ✅ | ✅ |
| Sample displacement correction (FullProf _SyCos, SySin_) | 🚧 | 🗓 |
| Sample displacement correction (FullProf _SyCos, SySin_) | 🗓 | 🗓 |

### Instrument — Time-of-Flight

Expand All @@ -123,9 +123,6 @@ Legend:

### Peak Profile — Constant Wavelength

CrysPy: Pseudo-Voigt from FullProf. Empirical asymmetry, 4 params (p1,
p2, p3, p4) from FullProf.

| Feature | LIB | APP |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | --- |
| Pseudo-Voigt + Empirical asymmetry<br>_Gaussian broadening U, V, W. Lorentzian broadening X, Y<br>Empirical asymmetry p1, p2, p3, p4_<br>(CrysPy) | ✅ | ✅ |
Expand All @@ -144,14 +141,16 @@ CrysPy peak_shape options:
| Feature | LIB | APP |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- |
| Jorgensen (back-to-back exponentials ⊗ Gaussian)<br>_Gaussian broadening σ₀, σ₁, σ₂<br>Back-to-back exponential rise α₀, α₁. Back-to-back exponential decay β₀, β₁_<br>(CrysPy) | ✅ | ✅ |
| Jorgensen-Von Dreele (back-to-back exponentials ⊗ pseudo-Voigt)<br>_Gaussian broadening σ₀, σ₁, σ₂. Lorentzian broadening γ₀, γ₁, γ₂<br>Back-to-back exponential rise α₀, α₁. Back-to-back exponential decay β₀, β₁_<br>(CrysPy) | 🗓 | ✅ |
| Double back-to-back exponentials ⊗ pseudo-Voigt [Z-Rietveld type0m]<br>_Gaussian broadening σ₀, σ₁, σ₂. Lorentzian broadening γ₀, γ₁, γ₂<br>Rise α₁, α₂. Fast decay β₀₀, β₀₁. Slow decay β₁₀. Switching r₀₁, r₀₂, r₀₃_<br>(CrysPy) | 🗓 | 🗓 |
| Jorgensen-Von Dreele (back-to-back exponentials ⊗ pseudo-Voigt)<br>_Gaussian broadening σ₀, σ₁, σ₂. Lorentzian broadening γ₀, γ₁, γ₂<br>Back-to-back exponential rise α₀, α₁. Back-to-back exponential decay β₀, β₁_<br>(CrysPy) | ✅ | ✅ |
| Double back-to-back exponentials ⊗ pseudo-Voigt [Z-Rietveld type0m]<br>_Gaussian broadening σ₀, σ₁, σ₂. Lorentzian broadening γ₀, γ₁, γ₂<br>Rise α₁, α₂. Fast decay β₀₀, β₀₁. Slow decay β₁₀. Switching r₀₁, r₀₂, r₀₃_<br>(CrysPy) | ✅ | 🗓 |
| Ikeda-Carpenter ⊗ pseudo-Voigt<br>_Moderator pulse α₀, α₁, β₀, κ<br>Gaussian broadening σ². Lorentzian broadening γ_<br>(CrysFML) | 🗓 | 🗓 |

| TOF profile | TOF source | Performance |
| ------------------------------------------------------------------- | ----------------------------------------------------------------- | ----------- |
| Jorgensen (back-to-back exponentials ⊗ Gaussian) | Simpler TOF profile, including reactor-source TOF implementations | Fast |
| Jorgensen-Von Dreele (back-to-back exponentials ⊗ pseudo-Voigt) | Spallation-source TOF | Slower |
| Double back-to-back exponentials ⊗ pseudo-Voigt (Z-Rietveld type0m) | Spallation-source TOF; more elaborate asymmetric profile | Slowest |
| Ikeda-Carpenter ⊗ pseudo-Voigt | Spallation-source TOF; moderator pulse shape model | Moderate |

---

Expand All @@ -169,9 +168,8 @@ CrysPy peak_shape options:

### Extinction

CrysPy's extinction is NOT Shelx-style. It's an analytical
Becker-Coppens spherical model with Gauss or Lorentz mosaicity
distribution
CrysPy's extinction is an analytical Becker-Coppens spherical model with
Gauss or Lorentz mosaicity distribution

| Feature | LIB | APP |
| ----------------------------------------------------- | --- | --- |
Expand Down
100 changes: 50 additions & 50 deletions docs/architecture/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class PeakFactory(FactoryBase):
frozenset({
('scattering_type', ScatteringTypeEnum.BRAGG),
('beam_mode', BeamModeEnum.TIME_OF_FLIGHT),
}): PeakProfileTypeEnum.PSEUDO_VOIGT_IKEDA_CARPENTER,
}): PeakProfileTypeEnum.JORGENSEN,
frozenset({
('scattering_type', ScatteringTypeEnum.TOTAL),
}): PeakProfileTypeEnum.GAUSSIAN_DAMPED_SINC,
Expand Down Expand Up @@ -389,26 +389,26 @@ from .line_segment import LineSegmentBackground

### 5.5 All Factories

| Factory | Domain | Tags resolve to |
| ---------------------------- | ---------------------- | ----------------------------------------------------------- |
| `BackgroundFactory` | Background categories | `LineSegmentBackground`, `ChebyshevPolynomialBackground` |
| `PeakFactory` | Peak profiles | `CwlPseudoVoigt`, `TofPseudoVoigtIkedaCarpenter`, |
| `InstrumentFactory` | Instruments | `CwlPdInstrument`, `TofPdInstrument`, … |
| `DataFactory` | Data collections | `PdCwlData`, `PdTofData`, `ReflnData`, `TotalData` |
| `ExtinctionFactory` | Extinction models | `BeckerCoppensExtinction` |
| `LinkedCrystalFactory` | Linked-crystal refs | `LinkedCrystal` |
| `ExcludedRegionsFactory` | Excluded regions | `ExcludedRegions` |
| `LinkedPhasesFactory` | Linked phases | `LinkedPhases` |
| `ExperimentTypeFactory` | Experiment descriptors | `ExperimentType` |
| `CellFactory` | Unit cells | `Cell` |
| `SpaceGroupFactory` | Space groups | `SpaceGroup` |
| `AtomSitesFactory` | Atom sites | `AtomSites` |
| `AliasesFactory` | Parameter aliases | `Aliases` |
| `ConstraintsFactory` | Parameter constraints | `Constraints` |
| `FitModeFactory` | Fit-mode category | `FitMode` |
| `JointFitExperimentsFactory` | Joint-fit weights | `JointFitExperiments` |
| `CalculatorFactory` | Calculation engines | `CryspyCalculator`, `CrysfmlCalculator`, `PdffitCalculator` |
| `MinimizerFactory` | Minimisers | `LmfitMinimizer`, `DfolsMinimizer`, … |
| Factory | Domain | Tags resolve to |
| ---------------------------- | ---------------------- | ------------------------------------------------------------ |
| `BackgroundFactory` | Background categories | `LineSegmentBackground`, `ChebyshevPolynomialBackground` |
| `PeakFactory` | Peak profiles | `CwlPseudoVoigt`, `TofJorgensen`, `TofJorgensenVonDreele`, … |
| `InstrumentFactory` | Instruments | `CwlPdInstrument`, `TofPdInstrument`, … |
| `DataFactory` | Data collections | `PdCwlData`, `PdTofData`, `ReflnData`, `TotalData` |
| `ExtinctionFactory` | Extinction models | `BeckerCoppensExtinction` |
| `LinkedCrystalFactory` | Linked-crystal refs | `LinkedCrystal` |
| `ExcludedRegionsFactory` | Excluded regions | `ExcludedRegions` |
| `LinkedPhasesFactory` | Linked phases | `LinkedPhases` |
| `ExperimentTypeFactory` | Experiment descriptors | `ExperimentType` |
| `CellFactory` | Unit cells | `Cell` |
| `SpaceGroupFactory` | Space groups | `SpaceGroup` |
| `AtomSitesFactory` | Atom sites | `AtomSites` |
| `AliasesFactory` | Parameter aliases | `Aliases` |
| `ConstraintsFactory` | Parameter constraints | `Constraints` |
| `FitModeFactory` | Fit-mode category | `FitMode` |
| `JointFitExperimentsFactory` | Joint-fit weights | `JointFitExperiments` |
| `CalculatorFactory` | Calculation engines | `CryspyCalculator`, `CrysfmlCalculator`, `PdffitCalculator` |
| `MinimizerFactory` | Minimisers | `LmfitMinimizer`, `DfolsMinimizer`, … |

> **Note:** `ExperimentFactory` and `StructureFactory` are _builder_
> factories with `from_cif_path`, `from_cif_str`, `from_data_path`, and
Expand Down Expand Up @@ -450,15 +450,15 @@ Tags are the user-facing identifiers for selecting types. They must be:

**Peak tags**

| Tag | Class |
| ---------------------------------- | ------------------------------ |
| `pseudo-voigt` | `CwlPseudoVoigt` |
| `split-pseudo-voigt` | `CwlSplitPseudoVoigt` |
| `thompson-cox-hastings` | `CwlThompsonCoxHastings` |
| `tof-pseudo-voigt` | `TofPseudoVoigt` |
| `tof-pseudo-voigt-ikeda-carpenter` | `TofPseudoVoigtIkedaCarpenter` |
| `tof-pseudo-voigt-back-to-back` | `TofPseudoVoigtBackToBack` |
| `gaussian-damped-sinc` | `TotalGaussianDampedSinc` |
| Tag | Class |
| ------------------------------------ | ---------------------------------- |
| `pseudo-voigt` | `CwlPseudoVoigt` |
| `pseudo-voigt + empirical asymmetry` | `CwlPseudoVoigtEmpiricalAsymmetry` |
| `thompson-cox-hastings` | `CwlThompsonCoxHastings` |
| `jorgensen` | `TofJorgensen` |
| `jorgensen-von-dreele` | `TofJorgensenVonDreele` |
| `double-jorgensen-von-dreele` | `TofDoubleJorgensenVonDreele` |
| `gaussian-damped-sinc` | `TotalGaussianDampedSinc` |

**Instrument tags**

Expand Down Expand Up @@ -542,25 +542,25 @@ line-segment points.

#### Singleton CategoryItems — factory-created (get all three)

| Class | Factory |
| ------------------------------ | ----------------------- |
| `CwlPdInstrument` | `InstrumentFactory` |
| `CwlScInstrument` | `InstrumentFactory` |
| `TofPdInstrument` | `InstrumentFactory` |
| `TofScInstrument` | `InstrumentFactory` |
| `CwlPseudoVoigt` | `PeakFactory` |
| `CwlSplitPseudoVoigt` | `PeakFactory` |
| `CwlThompsonCoxHastings` | `PeakFactory` |
| `TofPseudoVoigt` | `PeakFactory` |
| `TofPseudoVoigtIkedaCarpenter` | `PeakFactory` |
| `TofPseudoVoigtBackToBack` | `PeakFactory` |
| `TotalGaussianDampedSinc` | `PeakFactory` |
| `BeckerCoppensExtinction` | `ExtinctionFactory` |
| `LinkedCrystal` | `LinkedCrystalFactory` |
| `Cell` | `CellFactory` |
| `SpaceGroup` | `SpaceGroupFactory` |
| `ExperimentType` | `ExperimentTypeFactory` |
| `FitMode` | `FitModeFactory` |
| Class | Factory |
| ---------------------------------- | ----------------------- |
| `CwlPdInstrument` | `InstrumentFactory` |
| `CwlScInstrument` | `InstrumentFactory` |
| `TofPdInstrument` | `InstrumentFactory` |
| `TofScInstrument` | `InstrumentFactory` |
| `CwlPseudoVoigt` | `PeakFactory` |
| `CwlPseudoVoigtEmpiricalAsymmetry` | `PeakFactory` |
| `CwlThompsonCoxHastings` | `PeakFactory` |
| `TofJorgensen` | `PeakFactory` |
| `TofJorgensenVonDreele` | `PeakFactory` |
| `TofDoubleJorgensenVonDreele` | `PeakFactory` |
| `TotalGaussianDampedSinc` | `PeakFactory` |
| `BeckerCoppensExtinction` | `ExtinctionFactory` |
| `LinkedCrystal` | `LinkedCrystalFactory` |
| `Cell` | `CellFactory` |
| `SpaceGroup` | `SpaceGroupFactory` |
| `ExperimentType` | `ExperimentTypeFactory` |
| `FitMode` | `FitModeFactory` |

#### CategoryCollections — factory-created (get all three)

Expand Down Expand Up @@ -889,7 +889,7 @@ expt = ExperimentFactory.from_data_path(
)
expt.instrument.calib_d_to_tof_offset = 0.0
expt.instrument.calib_d_to_tof_linear = 7476.91
expt.peak_profile_type = 'pseudo-voigt * ikeda-carpenter'
expt.peak_profile_type = 'jorgensen'
expt.peak.broad_gauss_sigma_0 = 3.0
```

Expand Down
Loading
Loading