importing larch functionality
This: use_plugin_path('xafs') from feffdat import feffpath works as expected. It adds the path to larch's xafs plugins into the search path and imports "feffdat" such that it can be used in the namespace of the plugin I am working on. This fails use_plugin_path('wx') from plotter import newplot, plot with this error message: file <stdin>, line 0 ImportError: cannot import name newplot add_plugin('f85ut') What am I not understanding? newplot (and plot) seem to be exported by wx/plotter.py the same way that feffpath is exported by xafs/feffdat.py. B -- Bruce Ravel ------------------------------------ bravel@bnl.gov National Institute of Standards and Technology Synchrotron Science Group at NSLS --- Beamlines U7A, X24A, X23A2 Building 535A Upton NY, 11973 Homepage: http://bruceravel.github.io/home/ Software: https://github.com/bruceravel Demeter: http://bruceravel.github.io/demeter/
On Mon, Aug 18, 2014 at 1:22 PM, Bruce Ravel
This:
use_plugin_path('xafs') from feffdat import feffpath
works as expected. It adds the path to larch's xafs plugins into the search path and imports "feffdat" such that it can be used in the namespace of the plugin I am working on.
This fails
use_plugin_path('wx') from plotter import newplot, plot
That should be, for reasons I can't justify well, be from plotter import _newplot, _plot That is, from python you have to import the python function name (_newplot(), probably unfortunate), whereas the registerLarchPlugin() function remaps Python function names to Larch function names. Sorry for the confusion. Using 'newplot()' would have been better, but it might be best to not change it at this point. --Matt
participants (2)
-
Bruce Ravel
-
Matt Newville