Changelog
All notable changes to this project are documented here. Format based on Keep a Changelog, adhering to Semantic Versioning.
[0.7.0] - 2026-03-28
Breaking
calculate_xray_propertiesnow returnsVector{XRayResult}instead ofDict{String, XRayResult}. Use index-based access (results[1]) instead of key-based (results["SiO2"]). This preserves duplicate formulas with different densities.- Batch validation is strict: all formulas are checked upfront and invalid ones are listed in a single
ArgumentErrorbefore any computation begins. calculate_single_material_propertiesnow sorts energies ascending, matching batch API behavior.
Added
- Recursive descent formula parser supporting parenthesized groups:
Ca(OH)2,Ca3(PO4)2,Fe((OH)2)3 - Comprehensive debug logging: 27
@debuglog points across 6 categories (:parser,:cache,:io,:validation,:computation,:batch). Enable withENV["JULIA_DEBUG"] = "XRayLabTool". - ASCII validation in formula parser and element interpolator loader
- Thread-safety test for concurrent cache access
- Negative delta guard:
critical_anglereturns 0.0 instead of throwingDomainErrorwhen delta is negative near absorption edges
Fixed
- Thread-safe cache reads: replaced lock-free
Dict.get()with locked reads (Julia'sDictis not safe for concurrent read + write) - Physical constants updated to CODATA 2018 / 2019 SI exact values (Planck, elementary charge, Avogadro — ~2e-7 relative change)
- Formula parser no longer silently produces wrong results for parenthesized formulas
Changed
- 408 tests (up from 357): formula parsing, batch validation, thread safety, negative delta, logging, performance
Loggingstdlib added to dependencies
[0.6.0] - 2026-03-28
Breaking
- Removed
CSV.jlandDataFrames.jldependencies (replaced with zero-dependency file parsing) - Internal
F1F2_TABLE_CACHEreplaced withINTERPOLATOR_CACHE(caches interpolator pairs directly) - Removed internal functions:
load_scattering_factor_table,pchip_interpolators,create_interpolators
Performance
- 4.5x faster precompilation (62 to 24 transitive packages)
- 3.6x faster single-material calculations (cached interpolators, fused computation loops)
- 4x fewer allocations per call (19 KB vs 80 KB for 191 energy points)
- Lock-free cache reads on warm-cache path (zero allocation on cache hits)
@threads :dynamicscheduling for better load balancing in batch mode- Non-allocating energy range validation
- Type-stable hot loop via concrete
ElementInterpolatorDatatype alias
Fixed
- Data race: element caches now pre-populated before
@threadsloop entry - Fluorine data file (
f.nff) typo: first energy was 129.3 instead of 29.3 - Energy range validation added to single-material path (previously only batch path validated)
- Circular deprecation architecture:
@deprecatemacros replaced with explicitdepwarnwrappers
Added
Base.propertynamesoverride for tab-completion onXRayResult- Documenter.jl documentation site with physics background, API reference, and migration guide
- Consolidated CI pipeline with multi-threaded testing, formatting checks, and documentation deployment
- 357 tests (up from ~80): physical constants, numerical sanity, scaling properties, physics cross-validation, property-based formula parsing, performance regression guards
Changed
Dict-basedgetpropertywith O(1) lookup replaces O(n) if-elseif chain- Narrowed imports:
using Unitful: ustrip,using Base.Threads: @threads - SemVer-compatible compat bounds in Project.toml
- Batch results collected via lock-free
Vectorindexed writes instead ofDict+ReentrantLock
[0.5.0] - 2025-03-28
Added
- New descriptive API:
calculate_xray_propertiesreplacesRefrac(multiple materials)calculate_single_material_propertiesreplacesSubRefrac(single material)
- New snake_case field names on
XRayResult(see table below) - Backward-compatible
getpropertyoverride: old field names still work - Multi-threaded batch processing via
@threads - Comprehensive docstrings on all public and internal functions
Deprecated
Refrac()— usecalculate_xray_properties()insteadSubRefrac()— usecalculate_single_material_properties()instead- Old field names (still accessible, will continue to work):
| Old (deprecated) | New (recommended) |
|---|---|
Formula | formula |
MW | molecular_weight |
Number_Of_Electrons | number_of_electrons |
Density | mass_density |
Electron_Density | electron_density |
Energy | energy |
Wavelength | wavelength |
Dispersion | dispersion |
Absorption | absorption |
Critical_Angle | critical_angle |
Attenuation_Length | attenuation_length |
reSLD | real_sld |
imSLD | imag_sld |
Note: f1 and f2 are unchanged.
[0.4.0]
Added
- Initial public release
- Core X-ray property calculations based on CXRO/Henke tables
- Support for all elements H through U, 30 eV to 30 keV
- Caching system for atomic data and scattering factor tables
Refrac(batch) andSubRefrac(single material) API