Version history#
This page shows major changes in recent releases with an emphasis on what the user should be aware of.
0.0.86 - 24th of July 2026#
Reworked geometry visualization, now includes more backends
The default for
show_instrumentis stillwebgl-classic, but abackendkeyword argument was introducedbackend=pythreejshas several new features, but pythreejs is not considered a dependency; install it manuallyWith the pythreejs backend several widget options are included: jump to components, click on them to see code, and change how they are colored
Coloring can distinguish components by component index or received intensity
A
matplotlibbackend was added as well. It is best for 2D plots and can be called withbackend=matplotlib_2dandprojection=zy(zx / xy are also available)
0.0.85 - 9th of July 2026#
Added tests for instrument_diagnostics module
Fixed deprecated fontweight specifier
0.0.83 - 18th of June 2026#
Component reader now correctly reads all components in recent McStas versions
Diagrams and diagnostics more resilient to different input types
mpi='auto'now supported, allows mcrun to use maximum parallelisation allowed by the OSshow_settingsand widget now work correctly withmpi='auto'New help system for
set_parameterson component and instrument objects in jupyter notebooks (autocompletes parameter names)set_parametersno longer modifies input dictionariesmcrun return code is now handled, providing feedback on simulation success/failure
Hotfix of event_plotter and dataformat
0.0.80 - 23rd of April 2026#
MCPL output now found correctly when the variable input is a parameter or char array (not just literal strings)
Diagnostics instruments select
restore_neutronorrestore_xrayas appropriatecopyfollows typical McStas logic and does not carry keywordsFixed issue where instrument names containing “Param” caused a read failure
Fixed diagram failure when no intensity was reported
Fixed plotting of 0D monitors after metadata field name changes
Fixed issue #60: MCPL keys no longer overwrite
_Nkey
0.0.78 - 20th of February 2026#
Plotting functions now accept
return_fig_ax=Truekeyword to return figure and axis objects for further customizationFixed exponential notation formatting on plots
McStas/McXtrace resource directory can now be auto-detected via
mcrun --showcfg=resourcedirwhen$MCSTASenvironment variable is not setGenerated instrument header improved, including parameter descriptions compatible with mcdoc, thanks Peter Willendrup
0.0.75 - 19th of August 2025#
Default instrument visualization changed to
webgl-classic, works from notebooks with McStas 3.5.35+Improved NeXus data reading
Added handling for damaged UTF-8 strings in instrument files
SEARCH statements now support the
EQoperator
0.0.73 - 8th of November 2024#
Fixed bug where DEPENDENCY lines were read as additional parameters in components
SEARCH statement now written before the first component instead of near DEFINE, improving compatibility
Fixed escape character handling in instrument files
0.0.71 - 11th of September 2024#
All final values given to components (parameters, AT, ROTATED) can now be written to file
SEARCH statements updated to load components from the appropriate folder
0.0.68 - 25th of July 2024#
New
instrument_checkertool for validating instruments, useful for checking contents of created instrument objectsAuto-detection of McStas/McXtrace installation parameters when running from within a related environment
McXtrace sessions can now visualize using
mxdisplay(-webgl/-pyqtgraph)Improved reliability of reading NeXus data
Fixed mcdisplay path resolution when MCSTAS not in environment
0.0.64 - 1st of December 2023#
NeXus (.nxs) files can now be read with
load_dataandload_all_datafunctionsh5pyadded to requirements for NeXus supportEvent data no longer plotted directly (results not meaningful and often crashed the plotter)
Fixed widget plot placement on newer ipywidget versions
Tight layout applied to all figures
mcdisplaysearched in both executable path and package path
0.0.60 - 4th of August 2023#
Fixed diagnostic output failure when instrument used
target_indexlogicComponent reader improvements: handles comments in parameter regions, better C variable name validation
0.0.58 - 25th of April 2023#
Support for new McStas features
DEPENDENCY: instrument.set_dependency info here
SEARCH: instrument.add_search / component.add_search instrument info here component info here
NeXus: settings(NeXus=True), still can’t read data so backengine will fail after writing data
openacc: settings(openacc=True), for compiling to GPU
Infers parameter, variable and component names
Each time anything is added to an instrument, one gives it a name and python variable name, now the McStas name can be inferred from the python name so the following statements are equivalent:
wavelength = instrument.add_parameter(“wavelength”, value=5.0)
wavelength = instrument.add_parameter(value=5.0)
And likewise
my_arm = instrument.add_component(“my_arm”, “Arm”)
my_arm = instrument.add_component(“Arm)
Examples are being updated to run McStas 3.X, not all documentation updated yet
Fixed issue where astrox components where loaded in McXtrace
0.0.52 - 17th of November 2022#
New features for diagnostics of instruments, tutorial here
Diagrams can now plot intensity and ncount along instrument
Diagrams can now plot any variable along the instrument
Diagnostics object can show beam at a specified number of points in the instrument
McStasEventData can now generate binned data, described in data
All datasets now have attributes total I / E / N in metadata, shown in data
McStasScript can now read 0D monitors
Improvements to reader, better handling of using COPY for component names
Instrument objects now have a mccode_version attribute that keeps major version as integer
0.0.51 - 17th of October 2022#
New feature for segmenting the instrument using MCPL input/output tutorial here
Printed components now conform to McStas syntax (contribution from Peter Willendrup and Erik Knudsen)
0.0.50 - 20th of June 2022#
Support for McStas 3.X
USERVARS can now be used with add_user_var parameters_and_variables
instrument_reader can read McStas 3.X files with simple USERVARS
Improvements to instrument diagrams
Introduced checks for using same name for parameters, declare variables and user variables
Now possible to easily show instrument file for debugging with show_instrument_file
0.0.48 - 10th of June 2022#
Improvements to instrument diagram
Colors component depending on category
EXTEND and WHEN shown with decorating component box
Hovering mouse over left side of box shows component info
All Union connections included
Improved line arrows to turn in a few segments, greatly clarifying reading busy diagrams
Included in all documentation
Bug fix in simulator widget that avoids a crash when value in text field could not be converted to float
Included documentation on widgets in widget_user_guide
Now allows for spaces in McStas path, working on how this could work for data path
0.0.47 - 31th of May 2022#
Introducing instrument diagrams, they are really useful for getting a quick overview of an instrument
Instrument diagrams now available, use the instrument method show_diagram
Instrument output_path now reports to libpyvinyl calculator path system (Thanks Shervin)
Update of the documentation to include show_diagram in instrument user guide, JUMP tutorial
0.0.44 - 16th of May 2022#
This version is a cleanup of the syntax and streamlining of the package. It improves the consistency of the language use, removes unused methods and is better at recognizing when wrong input is made.
Renaming of methods to make the “show” verb in method names more consistent.
show_components did show all available McStas components, now shows components in current instrument
print_components still shows all components in current instrument, but also a warning pointing to show_instrument as best practice
available_components now shows all available McStas components for help purposes
Moved away from allowing arbitrary keyword arguments in some places, so it is now an error to misspell keyword arguments.
Instrument initialization
Instrument.settings method
Instrument.show_components (and print_components) methods
Component initialization
Removed instrument methods for manipulating components like set_component_AT() as they provided an additional way of doing the same thing, but more error prone than working with the component objects directly.
Moved widgets out of base import of package to speed up import
Widgets for Jupyter notebooks now loaded with:
import mcstasscript.jb_interface as ms_widget
ms_widget.show(instrument) / ms_widget.show(data) shows widget interface for instrument / data
ms_widget.SimInterface(instrument) needed if one wants to retrieve data made in an interface
Added instrument methods for moving and removing components (both explained in instrument object page)
instrument.move_component
instrument.remove_comopnent
Introduced error checking before writing / running McStas file, can be disabled with settings(checks=False)
Checks all Component AT / ROTATED RELATIVE statements have valid targets
Checks that variables used as component parameters have been declared
When using show_instrument in a notebook, a new tab was opened and it was shown in the notebook, changed it so no new tab is made when running in a notebook. If a new tab is desired use the keyword argument new_tab and set it to True.