Project
The Project serves as a container for all data and metadata associated with a particular data analysis task. It acts as the top-level entity in EasyDiffraction, ensuring structured organization and easy access to relevant information. Each project can contain multiple experimental datasets, with each dataset containing contribution from multiple structures.
EasyDiffraction allows you to:
- Manually create a new project by specifying its metadata.
- Load an existing saved project from its project directory.
Below are instructions on how to set up a project in EasyDiffraction. It
is assumed that you have already imported the easydiffraction package,
as described in the First Steps section.
Creating a Project Manually
You can manually create a new project and specify its short name, title and description. All these parameters are optional.
# Create a new project
project = edi.Project(name='lbco_hrpt')
# Define project metadata
project.metadata.title = 'La0.5Ba0.5CoO3 from neutron diffraction at HRPT@PSI'
project.metadata.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)."""
Saving a Project
Saving the initial project requires specifying the directory path:
project.save_as(dir_path='lbco_hrpt')
If working in the interactive mode in a Jupyter notebook or similar
environment, you can also save the project after every significant
change. This is useful for keeping track of changes and ensuring that
your work is not lost. If you already saved the project with save_as,
you can just call the save:
project.save()
Loading a Saved Project
If you have an existing saved project, load it from the project
directory created by project.save_as() or project.save(). This is
useful for continuing a previous session or reusing a downloaded saved
project.
project = edi.Project.load('lbco_hrpt')
Project Structure
The example below illustrates a typical project structure for a constant-wavelength powder neutron diffraction experiment:
📁 La0.5Ba0.5CoO3 - project root ├── 📄 project.edi - project configuration ├── 📁 structures - structures │ ├── 📄 lbco.edi - LBCO │ └── ... ├── 📁 experiments - experiments │ ├── 📄 hrpt.edi - HRPT pattern │ └── ... ├── 📁 analysis - analysis │ ├── 📄 analysis.edi - fit state │ └── 📄 mcmc.h5 - Bayesian arrays └── 📁 reports - reports ├── 📄 La0.5Ba0.5CoO3.cif - IUCr └── 📄 La0.5Ba0.5CoO3.html - HTML
Project Files
Below is a representative project example stored in the La0.5Ba0.5CoO3
directory, showing the main files created by a typical workflow.
Important
If you save the project right after creating it, the project directory will
only contain the project.edi file. The other folders and files will be
created as you add structures, experiments, and set up the analysis. The
reports folder is created only when at least one of
project.report.cif, project.report.html, project.report.tex,
or project.report.pdf is set to True before project.save().
1. project.edi
This file stores project-level metadata and display configuration.
_edi.schema_version 1 _metadata.name lbco_hrpt _metadata.title "La0.5Ba0.5CoO3 from neutron diffraction at HRPT@PSI" _metadata.description "neutrons, powder, constant wavelength, HRPT@PSI" _metadata.created "18 May 2026 10:15:00" _metadata.last_modified "18 May 2026 10:20:00" _rendering_plot.type auto _report.cif false _report.html true _report.tex false _report.pdf false _report.html_offline false _rendering_table.type auto _rendering_structure.type auto _structure_view.show_labels false _structure_style.atom_view covalent _structure_style.color_scheme jmol _verbosity.fit full
2. structures / lbco.edi
This file contains crystallographic information associated with the structure model, including space group, unit cell parameters, and atomic positions.
data_lbco _space_group.name_H-M_alt "P m -3 m" _space_group.IT_coordinate_system_code 1 _cell.length_a 3.8909(1) _cell.length_b 3.8909 _cell.length_c 3.8909 _cell.angle_alpha 90 _cell.angle_beta 90 _cell.angle_gamma 90 loop_ _atom_site.id _atom_site.type_symbol _atom_site.fract_x _atom_site.fract_y _atom_site.fract_z _atom_site.Wyckoff_symbol _atom_site.occupancy _atom_site.ADP_type _atom_site.B_iso_or_equiv La La 0 0 0 a 0.5 Biso 0.4958 Ba Ba 0 0 0 a 0.5 Biso 0.4943 Co Co 0.5 0.5 0.5 b 1 Biso 0.2567 O O 0 0.5 0.5 c 1 Biso 1.4041
3. experiments / hrpt.edi
This file contains the experiment type, calculation engine, instrumental parameters, peak parameters, associated phases, background parameters and measured diffraction data.
data_hrpt _experiment_type.beam_mode "constant wavelength" _experiment_type.radiation_probe neutron _experiment_type.sample_form powder _experiment_type.scattering_type bragg _calculator.type cryspy _instrument.setup_wavelength 1.494 _instrument.calib_twotheta_offset 0.6225(4) _peak.broad_gauss_u 0.0834 _peak.broad_gauss_v -0.1168 _peak.broad_gauss_w 0.123 _peak.broad_lorentz_x 0 _peak.broad_lorentz_y 0.0797 loop_ _linked_structure.structure_id _linked_structure.scale lbco 9.0976(3) loop_ _background.id _background.position _background.intensity 1 10 174.3 2 20 159.8 3 30 167.9 4 50 166.1 5 70 172.3 6 90 171.1 loop_ _data.id _data.two_theta _data.intensity_meas _data.intensity_meas_su 1 10.00 167 12.6 2 10.05 157 12.5 3 10.10 187 13.3 4 10.15 197 14.0 5 10.20 164 12.5 6 10.25 171 13.0 ... 164.60 153 20.7 164.65 173 30.1 164.70 187 27.9 164.75 175 38.2 164.80 168 30.9 164.85 109 41.2
4. analysis / analysis.edi
This file contains settings used for data analysis, including the choice of calculation and fitting engines, as well as user defined constraints.
_fitting_mode.type single _minimizer.type lmfit loop_ _alias.id _alias.parameter_unique_name biso_La lbco.atom_site.La.B_iso_or_equiv biso_Ba lbco.atom_site.Ba.B_iso_or_equiv occ_La lbco.atom_site.La.occupancy occ_Ba lbco.atom_site.Ba.occupancy loop_ _constraint.id _constraint.expression biso_Ba "biso_Ba = biso_La" occ_Ba "occ_Ba = 1 - occ_La"
When a Bayesian fit stores persisted posterior or predictive arrays, the
same analysis/ directory also contains mcmc.h5.
Now that the Project has been defined, you can proceed to the next step: Structure.