This repository is intended to store the python helper scripts for generating the Mantid IDFs. Each instrument is supported in its own python script.
The classes that will help with creating geometry are helper.py, rectangle.py, and sns_column.py. A quick example
from helper import MantidGeom
inst_name = "VISION"
xml_outfile = inst_name+"_Definition.xml"
comment = " Created by G. Fawkes "
valid_from = "2013-11-5 00:00:01"
instr = MantidGeom(inst_name, comment=comment, valid_from=valid_from)
instr.addSnsDefaults(indirect=True)
instr.addComment("SOURCE AND SAMPLE POSITION")
instr.addModerator(-16.0)
instr.addSamplePosition()
instr.writeGeom(xml_outfile)
The test harness is small and will (generically) generate false positives, but you should run it anyway.
- Do your work and commit it locally
git checkout origin/master
or justgit checkout master
if you did your work on a branch./test_unchanged.py --setup
will create all the geometry files before you do your workgit checkout -
to go back to your latest commit/branch./test_unchaged.py
to see what (if anything) has changed
There are also tests for some of the helper classes. This is run automatically by travis-ci
and can be found in the .travis.yml
in the script
section.