Dear Matt,
I’ve been working to implement Larch functions as a Python library. During the implementation I found a number of things I needed to do including:
1. Identifiying a functions’ python callable name, i.e. _group as a python callable function instead of group as the larch function.
2. The need to pass '_larch = mylarch’ in the said function or I get the 'AttributeError: 'NoneType' object has no attribute ‘symtable’ ‘
3. The need to run the script through the Python console as oppose to running as a script.
You can see my sample script with data attached. Keep in mind I am a Python novice. So for point 3 in particular I don’t understand the difference between running some selected code in the Python console and running the whole script in the shell (I am using PyCharm CE). I checked my Python interpreter with sys.executable (path) and sys.version_info (version) which are the same between the console and interpreter which were initial issues I found online. Is the interpreter somehow not seeing the xraylarch library?
Finally: 1. Is there an easier way to use the larch functions as a python library?
2. Is a larch group basically a python dictionary? If so, this could be made clearer in the documentation. I am interested to contribute to the documentation if that’s of interest/help.
I am running MacOS Sierra 10.12.1 on a mid-2015 15" MacBook Pro with Python 2.7.
Ron and Alpha: Maybe you have some ideas to the above points?
Thanks everyone for any help.