Skip to content

Conversation

@AndrewSazonov
Copy link
Member

No description provided.

elindgren and others added 30 commits April 2, 2025 16:19
…ation in CrysPy (#1)

* Temporary workaround for fitting parameters of iterable components

* Updates CI to run functional tests only

* Removes unused `__init__` and `__setattr__` methods

* Adds space group setting

* Adds time-of-flight support using Cryspy calculator

* Adds functional tests for single fits

* Enables parallel test execution

* Adds one more neutron TOF single fit test

* First attempt to speed up cryspy calculations

* Updates Cryspy calculator for TOF experiments

* First attempt to apply symmetry constrains

* First implementation of symmetry constraints

* Renamed data files for clarity and consistency

* Adds sympy dependency

* Adds fitting test with symmetry constraints

* Clean up

* Clean up [ci skip]
)

* Replaces "refinement" with "fitting"

* Refactors core components and fixes output

* Cleans up and refactors cryspy calculator

* Updates examples to use positional arguments

* Unify IterableComponent and Collection

* Refactors core object structure

Moves core classes into a single `objects.py` file.

* Renames `StandardComponent` class to `Component` class

* Refactors imports for consistency

* Refactors component identification and category keys

* Renames cif parameter identifiers for clarity

* Adds names to Descriptor and Parameter objects

* Refactors example scripts for clarity

* Adds temporary file saving option

* Adds parameter access code snippets to output

* Renames "show_ids" to "show_names"

* Updates instructions for pycrysfml installation

* Refactors joint fit examples and improves API usage

* Renames example scripts for clarity

* Refactors component directories for clarity

* Implements user-defined constraints

* Refactors code for enhanced readability and consistency.

* Adds fit with constraints test case

* Refactors constraints and uid map handling to singletons

* Moves JointFitExperiments to collections

* Refactors constraints handling for improved flexibility

* Adds joint fit test with split neutron data

* Removes joint refinement examples (keep in tests)

* Refines output and experiment saving

* Refactors constraint handling for clarity

* Cleans up

* Adds single fit example for EasyDiffraction API

* Moves the application of symmetry constraints to the calculator base

* Updates unit cell length for lbco

* Updates constraints to accept lhs alias and rhs expr
…metry-constraints-via-lookup-table

generate lookup table for space groups
* calculators and minimizers unit tests

* enable unit tests on push

* initial implementation of type hints for methods

* correct the order of arguments

* run unit tests first

* moved Any to proper type

* fix return type

* use correct type hint and avoid circular dependencies

* a few more Any's disappeared
* Refactors alias and constraint handling

* Refactors object model for improved parameter handling

* Refactors unique ID generation for parameters, etc.

* Refactors and fixes various issues.

* Refactors SampleModel and SampleModels

* Adds CIF output for aliases and constraints

* Refactors base classes for components

* Allows parameters to be used without a datablock id.

* Enforces type annotations for setter methods

* Removes constraint IDs

* Updates mock imports in sample model tests

* Removes unused Ikeda-Carpenter peak profile

* Fixes unit tests according to the modified API

* Refactors constraint application to remove parameter passing

* Fixes some unit tests

* Refactors singleton unit tests
* pdf calculator + experiment + instr parameters

* added test and files

* fix variable name

* added bokeh to enable PDF charts
fixed path to example gr file

* add diffpy deps

* renamed the example file
added a way to set additional attributes on a Component.
Modified the PDF instrument param class accordingly

* pdffit2 is now available in binary distros on pypi!
re-enable fitting in the pdf example

* Moves plotting functionality into a dedicated module

* Adds checks for the existence of attributes in summary before printing

* Sets default uncertainty to 0.05 for PDF data

* Refactors the pdffit calculator to improve code clarity

* Adds NaCl example for single PDF fit

* Adds SrFe2As2 example for single PDF fit (Fitting is not working)

* Renames diffraction_type to scattering_type, as more commonly used

* np.Inf -> np.inf in numpy2

* Ensures peak broadening parameters are only printed if they exist

* Moves PDF-related parameters from Instrument to Peak

* Fixes all examples to follow new API. Adds PDF functional test

* Refactors the PDF fitting example and calculator. Adds qmax

* Fixes another PDF example

* Removes old ADPs setting logic as ADPs are taken from CIF

* Reduces default error value for PDF experiments

* Updates NaCl example and test

* Removes `add_attribute` method as it is no longer needed

* Adds TODO for CIF conversion module

* Fixes unit tests

* added two (nonworking) neutron examples - Al2O3 and Ni.

* Added conda installation for libcblas on windows (#55)

* attempt to install cblas on the windows runner

* use s-weigand action

* install requirements into the conda virtenv

* added note in README.md

* Updates PDF fitting example for Nickel and adds to tests

* Adds another PDF example from NOMAD

* Modifies Ni example

* Cleans up PDFFit calculator

* Removes PDF from the instrument.py as not needed

* Refactors experiment to be adapted for Bragg and Total scattering

* Checks that experiment object has instrument attribute

* Temporary remove type hint due to circular dependency

* Update functional tests

* Updates the single fit example

* Updates the PDF single fit example

* Checks if experiment object has instrument attribute

* Refactors to support beam_mode='time-of-flight' for PDF

* Removed the Al2O3 example for now

Removed the Al2O3 example for now, as it requires additional work to achieve a proper fit.

* Minor fixes

* Implements experiment specific axes labels

* Adds default_sy variable

---------

Co-authored-by: Andrew Sazonov <andrew.sazonov@icloud.com>
AndrewSazonov and others added 12 commits June 26, 2025 11:50
* Refactors alias and constraint handling

* Refactors object model for improved parameter handling

* Refactors unique ID generation for parameters, etc.

* Refactors and fixes various issues.

* Refactors SampleModel and SampleModels

* Adds CIF output for aliases and constraints

* pdf calculator + experiment + instr parameters

* added test and files

* fix variable name

* Refactors base classes for components

* Allows parameters to be used without a datablock id.

* added bokeh to enable PDF charts
fixed path to example gr file

* add diffpy deps

* Adds CI workflow for testing Colab notebooks (try without local runner)

* Temporarily disables CI colab workflow until local runner is registered

* renamed the example file
added a way to set additional attributes on a Component.
Modified the PDF instrument param class accordingly

* pdffit2 is now available in binary distros on pypi!
re-enable fitting in the pdf example

* Moves plotting functionality into a dedicated module

* Adds checks for the existence of attributes in summary before printing

* Sets default uncertainty to 0.05 for PDF data

* Refactors the pdffit calculator to improve code clarity

* Adds NaCl example for single PDF fit

* Adds SrFe2As2 example for single PDF fit (Fitting is not working)

* Renames diffraction_type to scattering_type, as more commonly used

* np.Inf -> np.inf in numpy2

* Ensures peak broadening parameters are only printed if they exist

* Moves PDF-related parameters from Instrument to Peak

* Fixes all examples to follow new API. Adds PDF functional test

* Refactors the PDF fitting example and calculator. Adds qmax

* Fixes another PDF example

* Removes old ADPs setting logic as ADPs are taken from CIF

* Reduces default error value for PDF experiments

* Updates NaCl example and test

* Removes `add_attribute` method as it is no longer needed

* Adds TODO for CIF conversion module

* Fixes unit tests

* added two (nonworking) neutron examples - Al2O3 and Ni.

* Added conda installation for libcblas on windows (#55)

* attempt to install cblas on the windows runner

* use s-weigand action

* install requirements into the conda virtenv

* added note in README.md

* Adds documentation build scripts

* Adds API documentation pages

* Updates documentation configuration

* Adds type hints to utility functions

* Refactors experiment class initialization

* Removes tutorial data files

* Simplifies tutorials section title

* Updates getting started section

* Adds missing init files

* Adds single fit tutorial as py script

* Adds build docs action

* Uses requirements.txt

* Ensures correct PYTHONPATH for documentation build

* Updates documentation build process

* Updates PDF fitting example for Nickel and adds to tests

* Adds another PDF example from NOMAD

* Modifies Ni example

* Cleans up PDFFit calculator

* Removes PDF from the instrument.py as not needed

* Refactors experiment to be adapted for Bragg and Total scattering

* Checks that experiment object has instrument attribute

* Temporary remove type hint due to circular dependency

* Update functional tests

* Updates the single fit example

* Updates the PDF single fit example

* Checks if experiment object has instrument attribute

* Refactors to support beam_mode='time-of-flight' for PDF

* Removed the Al2O3 example for now

Removed the Al2O3 example for now, as it requires additional work to achieve a proper fit.

* Minor fixes

* Implements experiment specific axes labels

* Adds default_sy variable

* Moves show tables into a separate file and refactor code accordingly

* Update single fit tutorial

* Adds more data files

* Updates tutorial structure

* Adds advanced joint fit tutorial for PbSO4 analysis

* Implements repository file download utility

* Updates legend formatting in ASCII plotter output

* Removes unnecessary data copying in documentation preparation

* Improves table rendering by handling None/NaN values

* Updates parameter alignment in FitResults class

* Updates parameter alignment for analysis configurations

* Removes free parameters display before and after constraints

* Adds data for PDF calculations

* Adds data for standard TOF analysis

* Enhances tutorials with new examples

* Removes example scripts (those moved to tutorials)

* Rename tutorial files

* Switches to Plotly as the plotting engine in pd-neut-tof tutorial

* Updates fitting step descriptions for clarity

* Adds one more single-fit tutorial for pd-neut-cwl analysis

* Add new data file wish_ncaf.xye

* Adds diffraction analysis for Na2Ca3Al2F14 sample

* Updates coordinate system code to string format in model setup

* Adds datasets for PbSO4 tutorial

* Reorganizes functional tests for clarity

* Adds nbmake to requirements

* Refactors CI workflows for tutorial testing

* Renames workflows for clarity

* Updates workflow to improve test execution and scheduling

* Reorders setup steps for Windows compatibility

* Removes unused examples (as moved to tutorials/)

* Comments out some unit tests related to displaying parameters

* Removes parallel execution from unit tests

* Refines tutorial comments for clarity and consistency

* Renames jobs and set up conda after python

* Improves clarity in tutorials

* Improves tracking display format in fitting progress

* Fixes unit test after API changes

* Updates tutorials

* Refines documentation and updates tutorial references

* Adds more data for the NCAF tutorial

* Updates NCAF tutorial

* Adds one more data set

* Updates NCAF example

* Comments out dark mode activation step (temporarily)

* Improves tutorials section and adds quick-start tutorial

* Simplifies the quick start tutorial

* Adds another dataset

* Adds Co2SiO4 structure refinement tutorial

* Adds one more dataset

* Multiple changes

* Temporarily disable running most of the tutorials

* Restricts plotly version to < 6.1.0 to display images

mkdocs-jupyter 0.25.1. fails with Plotly 6.1.0-6.1.2

Warning:
.venv/share/jupyter/nbconvert/templates/base/display_priority.j2:32: UserWarning: Your element with mimetype(s) dict_keys(['application/vnd.plotly.v1+json']) is not able to be represented.
  {%- elif type == 'text/vnd.mermaid' -%}

* Removes unused assets and scripts from docs

* Removes specific notebook ignore patterns

* Renames 'usage' directory to 'user-guide'

* Renames and reorganizes documentation structure

* Moves images to a dedicated assets directory

* Comments out notebook execution plugin

* Renames tutorial section header

* Enhances documentation navigation and links

Introduces descriptive names for social links and adds a new
link to the EasyDiffraction Application Documentation.
Improves API reference navigation with clearer menu items.
Updates image paths for consistency in user guide content.

* Adds a draft of the tutorial for DREAM

* Adds project and summary modules to API reference

---------

Co-authored-by: Piotr Rozyczko <piotr.rozyczko@gmail.com>
* Fixes multiphase fit and adds test

* Adds LBCO+Si McStas tutorial to MkDocs TOC
* Very quick and dirty implementation of excluded regions

* Adds parent handling and item addition callback to Collection

* Refactors excluded points handling in diffraction minimization

Moves the logic for updating excluded points from minimization to ExcludedRegions, ensuring better modularity.

* Extends unit test with excluded regions

* Refactors excluded region logic in experiments

Optimizes the process of updating the pattern's excluded points
by avoiding unnecessary resets with each new excluded region.

Initializes pattern's excluded points with default values on data load.

* Excludes specified points from calculations for improve accuracy

* Refines excluded region handling in experiments

* Refines data plotting and analysis settings

* Formats function signatures for readability

* Removes unused assignment in test_fit_with_params

* Adds 'excluded' flag to experiment mock data

* Improves handling of excluded data points during minimization

* Enhances exclusion handling in Plotter class

* Fixes empty background and excluded regions check

* Adds CIF display for experiment data

* Updates the multiphase tutorial

* Simplifies exclusion handling in data processing

* Renames tutorial files and updates documentation

* Updates tutorials and adds display for excluded regions

* Refines tutorial markdown headers for consistency

* Adjusts data preprocessing for stability in analysis

Rounds x-values to 4 decimal places to align data size
Replaces small uncertainty values with 1.0 to prevent
failures in minimization algorithms
Corrects typo in tutorial file path to ensure proper navigation.

Enhances README with user installation instructions, clarifying differences
between user and developer installation processes, improving onboarding.
…nd Consistency (#59)

* Adds d-spacing parameter to project.py

* Adds d parameter to plotting.py

* Enhances notebook conversion with Jupytext

* Adds 2025 DMSC workshop tutorial to documentation

* Adds quick and dirty d-spacing plotting functionality

* Adds 1st draft of the dmsc summer school 2025 tutorial

* Updates Summer School tutorial

* Includes d-spacing branch in documentation build

* Relocates easydiffraction installation cell

* Refines powder diffraction tutorial

* Enhances Plotly figure display in Jupyter

Improves the display of Plotly figures in Jupyter notebooks by checking for IPython availability. Converts figures to HTML for better compatibility, avoiding warnings related to unknown MIME types.

* Suppresses Cryspy warnings by redirecting stderr

Wraps Cryspy calculation in stderr redirection to prevent
warning messages from cluttering the output. This is a
temporary measure until Cryspy handles warnings more
efficiently.

* Adjusts default quadratic calibration parameter

* Adds function to extract value from XYE file header

* Updates the summer school tutorial

* Configures Plotly to hide certain mode bar buttons

* Refactors CIF display functionality

* Enhances progress tracking with notebook support

* Improves phase handling in experiments

* Removes CIF display call

* Converts error logging to printed messages

* Adds d-spacing conversion for constant wavelength

* Adjusts default plotting engine based on environment

* Simplifies LBCO quick tutorial

* Standardizes variable naming for 2-theta calculations

* Add units to b_iso parameter in AtomSite class

* Formats fitter method arguments for readability

* Enhances fitting progress tracker with updated display

* Refactors header defaults for table rendering

* Update category key naming for consistency

* Corrects category key in atom site test

* Updates tracker start message in the unit test

* Expands parameter table with more details following discussion #24

* Switches data download to 'd-spacing' branch in tests

* Enhances Descriptor and Parameter string representation

* Improves user notifications for calculator engine imports

* Refactors calculator methods for improved readability

* Refactors report generation to improve table rendering

* Enhances table margins for improved layout

* Enhances TOF to d-spacing conversion

* Use env variable for default branch data download
* Removes branch selection when downloading data

* Generates the notebooks from scripts

* Auto-rename all cell ids using nbstripout

* Update project version to 0.6.0 and adjust dependencies

* Renames GitHub workflows for clarity

* Adds workflow to delete old GitHub Actions runs

* Add GitHub actions for automated release drafting

* Add workflow to perform security scanning

* Add workflow to enforce PR label verification

* Add GitHub Actions workflow for PyPI publishing

* Enhances project configuration in pyproject.toml

* Applies ruff linting

* Apply ruff linting with --unsafe-fixes

* Fixes dependency installation

* Fixes install command spacing in workflows

* Adds YAPF for code formatting and updates Ruff config

* Applies ruff formatting

* Apply more ruff formatting

* Apply prettier formatting

* Enhances CI/CD with testing workflow and notebook conversion

* Refines workflow scripts for improved readability

* Refactors notebook handling in CI workflow

* Adds Jupytext to documentation dependencies

* Updates workflows to enhance package testing

* Standardizes workflow job names and increases timeout

* Refines tutorial parameters for performance

* Refines Jupyter notebook conversion in workflow

* Refines CI workflow naming and formatting

* Updates workflow job names and adds shell specifications

* Reformats YAML for improved readability

* Reorganizes Python setup in GitHub workflow

* Adds Windows-specific conda setup to CI workflow

* Try fixing Unicode issues on Windows

* Enhances CI workflows and separates tutorial testing

* Refines workflows and dependencies handling

* Adds file overwrite option to download utility

* Updates tutorials

* Restricts security scan trigger and updates Python matrix

* Adds SPDX headers to all source files

* Updates copyright information

* Add contributing and development guidelines

* Corrects GitHub URL in SPDX headers

* Update tools/update_spdx-headers.py [ci skip]

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AndrewSazonov AndrewSazonov merged commit d51f565 into master Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants