PaNOSC-ViNYL / McStasScript

McStas API for creating and running McStas instruments from python scripting
BSD 3-Clause "New" or "Revised" License
9 stars 11 forks source link

A few notebook edits for compatibility with McStas 3.x #62

Closed willend closed 1 year ago

willend commented 1 year ago

By no means complete, but means that some of the example notebooks will more likely run with a McStas 3.x.

During my work with the current McStasScript and McStas 3.3 in jupyterlab I further ran into an issue with notebooks containing %matplotlib widget syntax. A solution seemed to be to

pip3 install --upgrade jupyterlab ipympl

Should we consider adding these as dependencies?

mads-bertelsen commented 1 year ago

Having a full jupyterlab might be a large dependency, but lets add ipympl, I actually thought it was already there!

The documentation and examples have been McStas 2.7 for too long, thanks for help with going to 3.X syntax.

For the website (located in docs) I will try to make it compatible with both McStas 2 and 3 by statements such as this:

if instrument.mccode_version == 3:
   init = instrument.add_component("init", "Union_init")
mads-bertelsen commented 1 year ago

ipympl was added to requirements on master.