Package: genx3
This package contains GenX 3.6 a program to refine x-ray and neutron reflectivity as well as surface x-ray diffraction using differential evolution. It can also serve as a general fitting program.SupportTutorials can be found at:http://genx.sourceforge.net/doc/Examples can be found in the Menu Help->Examples.
If you need more support send an e-mail toartur.glavic@psi.ch.ReferencesIf you use the program please give reference to the following publication:
A. Glavic and M. Björck J. Appl. Cryst. 55, 1063-1071 (2022).Changes 3.6.22Fix a bug with the update code for newer urllib3 versions (see PR #5, thanks to azelcer)Upgrade windows build to python 3.11 an recent libraries.Changes 3.6.21Add data loader for nja XRR file format.Add pint and latest orsopy to binary distributions to allow for better parsing of .ort metadata.Fix the Bumps error dialog filling the wrong error ranges into the parameter grid.Fix a multiprocessing logger related bug that crashes the program under certain circumstances.Changes 3.6.20Fix Rigaku data loader to include attenuation factors.Changes 3.6.19Introduce crop_sigma sample option to spec_adaptive model that allows to limit the
influence of the interface transition function within the adjacent layers.
Thanks to Rico Ehrler for the suggestion.Changes 3.6.18Update gsecars_ctr data loader to detect additional columns by first header lineSome minor fixes for wxPython 4.2.0 and newer numbaChanges 3.6.17Use single numba cache directory for any GenX executable, speeding up program startFix multiprocessing fit stuck in Windows binaryBetter logging and error reporting in multiprocessing fitChanges 3.6.16Improve error handling and allow forcefull termination of multiprocessing fitsAdd full logging support when running fit with multiprocessingAdd caching of GPU kernels for newver versions of numbaCorrectly count the number of functions to be compiled with numbaFix error when trying to use multiprocessing fit without numba installedChanges 3.6.15Add new LayerGraphics plugin that creates a simple sketch drawing for reflectometry models
to use in presentations etc.Update the Mac build system to Mac OS 12 and system python 3.10 using new wxPython 4.2 PyPI packageChanges 3.6.14Fix re-compilation of numba code when opening project filed directly on WindowsAdd some NeXus file attributes to the .hgx file format to allow plotting of the data e.g. with nexpySmall change to the MacOS configuration that should support file type filtering in open dialogChanges 3.6.13Fix a bug where exporting the script with special characters raised an error under windows (ticket #197)Fix some bugs in export and parsing of .ort filesSome refactoringChanges 3.6.12Fix a bug where fitting from console with autosave and –error options stopped the fit after first autosaveImprove the meta data editing capabilityChanges 3.6.11Update the ORSO file definition to version 1.0.0 released recentlyModify the metadata dialog to allow adding and editing valuesAdd a new data loader for the Rigaku .ras formatFix default and resolution loader to ignore non utf-8 encoded valuesChanges 3.6.10Implement a tech-preview using alternative plotting backend with improved performance
(selected in Settings -> Startup Profile… menu.)Automatically restart the window when switching from legacy to widescreen layout.Changes 3.6.9First version of MacOS binary distributionAdd new script “genx_mac” to PyPI package to start with framework build (pythonw)Allow file names with upper case endings (.GX/.HGX)Try to fix some plot drawing issues on some Linux systems with Wayland backend.Open GenX model files on drag&drop to the window (if not above data list)Fix GUI not remembering a model is unchanged after loading from a fileFix bug where the parametr grid could be wrong after loading a model while value editor was activeChanges 3.6.8Fix a bug where values for the instrument parameters where parsed by int type if the script used integer valuesFix a compatibility issue with older wxPython/wxWidgets that would prevent genx from starting on fedora 35Fix issues when running numba together with multiprocessing on UNIX bases systems due to fork methodChanges 3.6.7Fix compatibility with python 3.6-3.7Changes 3.6.6Fix wx dialog issue where instrument editor in advanced reflectivity would not work (thanks to Leon Lohse)Changes 3.6.5Fix parameter grid value cell out of bounds coloring lost after loading a new modelChanges 3.6.4Add simple syntax completion, object help and undo/redo to script editor. To use
try ctrl+enter, shift+ctrl+enter, ctrl+alt+Z or shift+ctrl+alt+Z.Do not raise an error when starting a fit with parameters outside of min/max boundaries
if the optimizer does not use them. (ticket #175)Fix compatibility issue with python 3.10, tested with wxPython 3.1.1 and 3.1.2aChanges 3.6.3Fix a bug that could lead to a strange error messages when editing items in the Simulations tab.Fix a crash on Linux when running the bumps dialog depending on wx versionFix an issue where genx would not start on macOS environments with python >=3.9 and anacondaChanges 3.6.2Add finite polarization effects for neutron reflectivity to spec_nx, spec_adaptive and spec_inhom models.
To use you have to select instrument probe as “neutron pol spin-flip” and change the simulation function
from “Specular” to “PolSpecular”. This function has 4 additional parameters; p1, p2, F1, F2 for
polarizer, analyzer and filpper efficiencies. For definition seehttps://doi.org/10.1063/1.1150060Update UserFuncs pluging to work with type-annotated functions to generate user dialogs automatically.
The SXRD.hgx example shows a usage for storing XYZ files.Add entry to theHelpmenu to open example files, directly jumping to the right directory.
About dialog now shows the path where configuration files are stored.Fix a bug where editing the script in some circumstances would loose lines.Changes 3.6.1Add a batch processing interface to the GUI. This can be accessed through the File dialog. See
newBatch Fittingsection of the documentation.Add generic definition for plot x- and y-labels. Build-in models define the values depending on last simulated
scans and user can always overwrite in script with__xlabel__and__ylabel__special variables.Add detailed documentation about SLD plot configuration and batch processingAdd more unit tests for models and loading/savingFix remote fit crashing server when ending normally instead of being stopped by the userChanges 3.6.0Add new genx_server (python -m genx.server) script that allows to run a remote service
on a cluster that can be used to fit from a GUI on a different machine.
See:https://aglavic.github.io/genx/doc/tutorials/mpi.htmlfor more information.Implement asymmetric errors from bumps statistics, fix some bugs and add option to normalize parameter
uncertainties by sqrt(chi2) to eliminate scaling factors on error bars. (see ticket #190)New command line parameters for better control of refinement and performanceImprove console and logging output on MPI runs, q+<enter> can now stop a fit started with MPIFix some command line optionsAllow changing of plot scales with mouse scroll wheel and ctrl-/alt-/shift-modifier,
always reset zoom with middle mouse buttonImprove SLD plot context menu, allowing to show only first dataset,
external legend or coloring associated with datasetsOption to generate a SLD uncertainty graph based on a user-defined reference interfaceDo not show separate mag_x SLD for neutron magnetic reflectivity, if there is no mag_y componentSlight improvement or SXRD model performanceAdd a genx3server PyPI package without GUI package requirementsUpdates on documentation concerning use from command lineStartup script to automatically select pythonw when run on Mac OS (untested)Fix some more minor bugsChanges 3.5.11Fix export of TableFix bumps statistics setting the error column of the parameter tableAdd documentation for Norm FOMChanges 3.5.10Add command line option to set the relative parameter variation beak conditionFix an error that can happen when a numpy floating point error is raised in the windows versionFix parameter addition in python API moduleChanges 3.5.9Update sns_mr data loader to changes in reduced data format.Changes 3.5.8Fix crash on Linux systems when automatically simulating, bug #189Fix some with the snap that prevented loading SXRD plugin with 3D viewSnap now stable enough to use, but does not support multiprocessing due to access issues with confinementChanges 3.5.7Online check for new GenX versions and option to download new setup file/in-place pip updateFirst version of snap binary distribution for Linux systems other than Ubuntu 18.04/20.04Better copy to clipboard of selected parameters in error statistics dialogChanges 3.5.6Add option to edit the script in an external editorFix issue of GenX crashing if incompatible locals are specified in system configuration #187Fix bug that caused script editing issues on some platforms #188Changes 3.5.5Fix an issue with Reflectivity plugin instrument dialog causing
silent fails to update an read values from after running Sim function.Changes 3.5.4Add data loader for SINQ six text file formatChanges 3.5.3Fix bugs in handling of insertion/deletion of parametersFix bug in printing of plots and tableFix query of ORSO database in SimpleReflectivity in some circumstancesChanges 3.5.2Add a new modeling option to spec_inhom model that allows automatic generation
of neutron super-mirror structures from user defined Stack parameters.Captuer model errors during fit that did not occure on first evaluation.Changes 3.5.1Fix some issues with deleting and moving parameters in the grid that
were caused by changes for undo/redo functionality.Add (beta) support for ORSO SLD database for SimpleLayer and SimpleReflectivitySome fixes in SimpleLayer pluginChanges 3.5.0Add undo/redo functionality for most user actions as for changing the script or parameter valuesHistory dialog that shows the undo actions and allows removal of previous steps while keeping later onesReorganize menus to make it more accessibleImproved sorting of parameters by object or parameter with groupingStart logfile from GUI and show dialog with logged messages (Help menu)Load multiple datasets from suitable data loaders (orso+xrdml)Configure new reflectivity model from metadata read from .ort files (radiation, resolution etc.)New option to automatically stop a fit when relative parameter spreads a reduced below a threashold value.
Setting the parameter to e.g. 1% will stop once the parameter that varies the largest fraction of its fit
range has a spread of less than 1% within the population. Seems very stable and is helpful for long-running
fits with MPI that can’t be stopped manually, well. (Thanks to Larry Anovitz for the idea.)Major updates to the main tutorails in the documentationUpdate orso .ort file format to use the new orsopy package with the updated specificationFix update of Pars plot during fit when SimpleReflectivity plugin is loadedFix bumps fitting functionality and add update of Pars plot for this solverFix bug where fitting with multiprocessing without numba would failFix in plotting of error bars to be below simulationFix incompatibility with matplotlib >=3.5.0General refactoring for the GUI code to allow undo/redo functionality. May have introduced new bugs. As always
All feedback is welcome.Changes 3.4.12Limit matplotlib version for PyPI to <3.5.0 as this breaks some code within GenXChanges 3.4.11Fix missing library in windows distributionFix xrdml loader for newer version where tag has changedAdd xrdml file format to auto data loaderChanges 3.4.10Fix bug with missing os import in genx/data.py to allow exportChanges 3.4.9Add –dpi-scale option to overwrite the automatic detection.
Use –dpi-scale 1.0 on OS X if you encounter large icons overrunning the toolbar.Changes 3.4.8Fitting from command line on unix systems now displays the parameter values and spread on the consoleChanges 3.4.7Add export as XYZ file option to sxrd/sxrd2 models ( sample.export_xyz / domain.export_xyz )SXRD plugin option to hide bulk and display arrows for the dx,dy,dz movement of atomsChanges 3.4.6Some fixes to the sxrd2 modelFix backwards compatibility issues with wx and python 3.6. (The latter needs to “pip install dataclasses”.)Changes 3.4.5Fix sls_sxrd plugin to work with additional LB/dL columns as explained in the documentation exampleChanges 3.4.4Fix fitting using MPI (command line on cluster)Fix stopping a command line fit with multiprocessing using ctrl+cImprovements to the publication graph dialogSome small bug fixes for fitting from command lineChanges 3.4.3Fix backward compatibility issue with older numpy and numba librariesChanges 3.4.2Fix bug #185 of broken import settings dialog in windows .exeAdd config file option “gui/solver update time” that can be used on slower computers
to reduce GUI load during fittingChanges 3.4.1First preview of a publication graph dialog that allows precise definition of plot attributes through
small script. A user defined graph size can be chosen and the plot exported to an image file.Fix bugs #183 and  #184 causing crashes on new installs due to configuration default and path issues.Fix bug in parameter scan using wrong configuration option (#182) and project fom with non-DE fits.Changes 3.4.0Add additional optimizers to be used for refinement (fast Levenberg-Marquardt or Bumps library)Improved simulation performance for simple models and better stability of GUI for fast updates.
If CUDA calculation and parallel is selected, one process will run on GPU and the rest on CPU.Add option to automatically color datasets according to pre-defined cycle (2, 4 states or rainbow)Allow drag&drop of data files onto GenX data tableShow a startup splash screen to give user feedback, especially when delayed by JIT compilation during first runMajor refactoring of core code and configuration system for better maintenance and expandibility
(Be aware that this may lead to new Bugs compred to 3.3.x versions. Please submit bug-reports
if you find any!)Reduce number of threads used by numba when running in multiprocessing mode, large increase in performance.Some minor bug fixesChanges 3.3.6Fix bug in hgx save/load models with non-ascii charactersChanges 3.3.5Fix bug in file export that could lead to missing lines at the end of the file due to cachingExpand unit testing and remove unused code to support maintenanceChanges 3.3.4Allow neutron matrix calculations with non-zero ambient layer SLDFix but in fast neutron matrix calculation where roughnesses were used from wrong layer indexUpdating of bumps statistical analysis example notebookFix residual High DPI issue in SimpleReflectivity wizardFix a bug when loading datasets lost options e.g. for plottingAdded link to new video tutorial do documentation.Replace some physical constants by more precise valuesChanges 3.3.3Fix issues with SimpleReflectivity Wizard in High DPI environmentsFix dataset options being lost when loading new dataPrevent closing error statistics dialog if thread still runs in backgroundChanges 3.3.2Reintroduce wait time per iteration as the GUI can crash without it. Now it can be changed from the optimizer dialog.Changes 3.3.1Fix column type in ORSO reader to be ndarray and not derived classChanges 3.3.0Updated the documentation website to include the SimpleReflectivity interfaceReimplementation of the off-specular and x-ray surface diffraction models (sxrd, sxrd2, interdiff)In Reflectometry plugin, automatically update the GUI when the script is changed manuallyAdd an alpha version of ORSO text format data readerMake auto data loader the default, this includes the following loaders:
(default, resolution, sns_mr, amor, d17_cosmos, orso)
Please send me your instrument data files as examples if you want your own data loader that can include meta data, too.Fix crashes in Linux systems when changing parameters in the grid (especially when automatic update is active)Fix incompatibility with h5py version 3 when loading modelsFix the d17_cosmos data loader and add d17_legacy for old style filesFix issues in windows binary that prohibited opening of Help dialogsNew type os user parameter intended for systematic errors that influence all datapoints. It has
a sigma parameter and biases the FOM with (x0-x)²/sigma² to take the systematic error uncertainty
into account.The column calculation now supports a rms(sigma1, sigma2, …) function to combine different error contributionsExample columns showing how to include systematic errors from motor position and/or beam distribution uncertaintyRemove unnecessary sleep per iteration when fitting in single thread mode. Please report if you notice issues like
crashesSome additional improvements for simulation performanceChanges 3.2.3Fix a bug in footprint correction introduced in 3.2.0Improve parameter grid interface with parameter relative value indicator and slider controlsAllow copy & paste in parameter gridCan now use space to start edit on selected parameter and to accept parameter changesFix a DPI display bug for toolbar icons aside gridCan not toggle negative value with “-” at any edit location in the value editorDon’t automatically open context menu on single click of first column, allows to select and edit manually easierChanges 3.2.2Update windows build to python 3.9 and wxPython 4.1.1 to better support High DPI displaysImprove value entry in parameter grid (ENTER/TAB key, mouse scrolling)Prevent parameter grid entry resizing to prevent non-intentional layout issuesAutomatize PyPI releasesChanges 3.2.1Fix error in new Numba functions that calculate the resolution vector (ORSO validation failed)Changes 3.2.0Add simple API for use in python scripts and Jupyter notebooks. Can read, write, modify and fit modelsAdd some examples of Jupyter notebooks to show usage of APIIntegration of GenX models into bumps library (seehttps://bumps.readthedocs.io/en/latest/index.html)Dialog for statistical error analysis with bumps MCMC to evaluate cross-correlations of parametersNew export function (alpha) for ORSO text format with detailed header containing analysis informationImprovements to script editor behavior concerning indentationReflectivity plugin now re-analyses a manually changed script after it has been run onceSimpleReflectivity now shows an error summary dialog when errorbars are calculatedNew ‘auto’ data loader that chooses the method by file type, supports AMOR, SNS MR, default and resolution loadersImprovements in reflectivity model performance, possibility to use CUDA with multiprocessingImprovements in plot performance for data and SLD graphsSome refactoring of code startedFix SimpleLayer plugin to allow multiple materials with same chemical formulaFix some bugs where plot updates could crash the GUI or freeze the SLD graphChanges 3.1.4Fix bug in mag_ref (issue #178)Update GenX documentation websiteChanges 3.1.3Fix some GUI crashes on wxPython >=4.1Fix GUI issue/crash when auto update SLD is active (issue #177)Fix about dialogUse new DPI scaling function for better cross-platfrom high DPI handling, if available (wxPython >=4.1)Changes 3.1.2Small fix of build system and contact email.Changes 3.1.1Update build system to be compatible with PyPI, thanks to Leon LohseInclude vtk module in windows distribution for SXRD pluginChanges 3.1.0Implement numba JIT compiler for significant x-ray and neutron reflectivity calculation performance gainImplement GPU accelerated version with CUDA (NVidia graphics cards, menu option to activate)SpinAsymmetry plugin to plot the SA for data and modelExporter plugin for reflectivity models, up to now supports BornAgain python scriptsSeveral bug fixes in various modulesChanges 3.0.8Fix some issues with newer wxPython versions (4.1.1)Fix an error in the unit for neutron SLD display (10^-6 AA^-1)Automatic build process on githubChanges 3.0.7Fix bug in spec_nx when trying to use spin-flip modelFix bug #160 in spin-flip that would not recognize a changed model correctlyAdd button to SimpleReflectivity for switching to Reflecivity plugin for more complex modelsChanges 3.0.6Fix GUI bugs reported in tickets #172 and #173Changes 3.0.5Fix some handling of fomulas and material in SimpleLayer and SimpleReflectivity pluginChanges 3.0.4Fix bugs #171 and #169Changes 3.0.3Fix bug in spin-flip model that failed simulation with an errorTry to make SXRD work againChanges 3.0.2Fix plotting error when loading new dataset with different shapeFix sample parameter dialog not evaluating input type correctly in spec_adaptive model (#167)Changes 3.0.1Fix issue with model table when creating new model in SimpleReflectivityFix unicode error in sns_mr data loaderHandle footpring and tth offset parameter correctly when ToF neutron is selectedUpdate windows installer to run with user privilegesFix evaluation of extra data columns like “res”Changes 3.0.0Convert to python 3Convert to wxPython 4 (Phoenix)Add new SimpleReflectivity plugin for simple structures and beginner usersUpdated icons with dpi awarenessNew optional wide screen optimized GUI that allows to see Data and SLD side-by-sideImproved SimpleLayer materials database with query to Materials Project and Open Crystallography databasesFix windows binary to work with Windows 10 without compatibility modeImproved plot layout that uses full space, provides correct axes labes and can be copied with white backgroundChanges 2.4.9Fixed bug in SimpleLayer plugin - could not load cif files under OSX.Changes 2.4.8Fixed bug that delete and backspace did not work in the parameter grid under Windows.Fixed so that data can be loaded with the resolution data loader.Fixed bug in the SimpleLayer plugin.Small bug fixes in parameter and data model classesChanges 2.4.7Fixed bug, parallel fitting with mag_refl stopped in “going into optimisation”.Fixed bug with adding data sets into a new reflectivity plugin model.Fixed wrong spin state calculations in soft_nxChanges 2.4.6Fixed bug that the SLD for neutrons were scaled with wl**2/2/pi.Changes in 2.4.5Fixed bug that the SLD for neutrons were scaled with wl**2/2/pi.Problem with the precision in some neutron calculations solved.Numbers in the grid can be given in scientific/exponential notation, for example 1e5.Problems with fractional numbers using “.” on systems with defualt deciaml seprator as “,” solved.Scan FOM not always functioning with blank rows in the grid solved.Changes in 2.4.2Minor bug fixes in the guiFixed that the models ignored negative b’s (spec_nx and mag_refl)Changes 2.4.0Added sliders and spin controls to change the parameter values, updated dynamically.A new reflectivity aimed to soft matter called soft_nx.Added the possibility to have a logarithmic x scale.Data points causing nan and inf in the FOM can be ignored (see the Options dialog).A resolution type for constant dq/q have been added to spec_nx and soft_nx.Simulation data sets can be created through a wizard.Added data loader for SNS BL4A (programmer: Artur Glavic)Added plugin to more easily define layers (programmer: Artur Glavic)Various bug fixes.Changes 2.3.6Fixed bug regarding the definition of instruments (not working) in the Reflectivity plugin.Fixed bug that caused an error when trying to fit the number of repetitions.Fixed bug regardgin q=0 simualtions - the models now throws an error for q = 0.Fixed bug in the buffering of spin flip calculations (caused an error when trying to simulate data sets with differing number of x-values).Fixed not working choice boxes in the Calculation dialog.Added an data loader for four column data which also includes the resolution.Included so that ‘du’ works in spec_nx for calculating spin flip and the same thing in mag_refl.Changes 2.3.5Fixed bug that GenX does not start after installation on Windows machine.Fixed bug so that command line execution works better on frozen versions.Fixed bugs regarding the c extensions in the frozen version.Changes 2.3.0Changed the x-ray scattering length data tables to use the ffast nist, which
is more accurate at low energies, database:http://www.nist.gov/pml/data/ffast/index.cfmRefurbished the table of fitting parameters with new functionality and a new toolbar.The reflectivity plugin has been improved:
- Which parameter to fit can be set in the sample definition dialogs.
- The Sample tab shows the current value of the fitted parameters and also indicates which are fitted.Command line fitting has been added. Possible to run fit without the GUI.A new file format based on hdf5 has been implemented (more platform independent).MPI support has been added, thanks to Canrong Qiu (University of Alaska).The model mag_refl can now:
- Simulate energy scans.
- Simulate “normal” x-ray reflectivity.
- Simulate scans with polarisation analysis.
- Use negative values of mag.spec_nx and mag_refl can now simulate the asymmetry signal in neutron reflectivity.Refactoring of the Reflectivity base models.Numerous reported bugs fixed. (Seehttp://sourceforge.net/p/genx/code/commit_browserfor detailed changes).