Version history

This page shows major changes in recent releases with an emphasis on what the user should be aware of.

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.