Functions | |
PyObject * | keys (PSEvt::ProxyDictI &proxyDict, PyObject *args) |
Return python list of keys from proxy dictionary. | |
std::vector< pytools::pyshared_ptr > | get_types (PyObject *arg0, const char *method) |
std::pair< Pds::Src, std::string > | arg_get_put (PyObject *args, bool needExact, const PSEvt::AliasMap *amap) |
PyObject * | get (PSEvt::ProxyDictI &proxyDict, PyObject *arg0, const PSEvt::Source &source, const std::string &key) |
PyObject * | get_compat_typeid (PSEvt::ProxyDictI &proxyDict, PyObject *arg0, PyObject *arg1) |
PyObject * | get_compat_string (PSEvt::ProxyDictI &proxyDict, PyObject *arg0) |
PyObject * | put (PSEvt::ProxyDictI &proxyDict, PyObject *arg0, const Pds::Src &source, const std::string &key) |
PyObject * | remove (PSEvt::ProxyDictI &proxyDict, PyObject *arg0, const Pds::Src &source, const std::string &key) |
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
PyObject * psana_python::ProxyDictMethods::keys | ( | PSEvt::ProxyDictI & | proxyDict, | |
PyObject * | args | |||
) |
Return python list of keys from proxy dictionary.
In case of problem set error condition and returnz zero pointer
[in] | proxyDict | Dictionary instance |
[in] | args | Python argument tuple passed to keys() method |
Definition at line 49 of file ProxyDictMethods.cpp.
References plot_analyze::args, pytools::PyDataType< ConcreteType, CppType >::cppObject(), GUIAlignment::ex, ex_all_dets::i, PSEvt::ProxyDictI::keys(), pytools::PyDataType< ConcreteType, CppType >::Object_TypeCheck(), pytools::PyDataType< ConcreteType, CppType >::PyObject_FromCpp(), and ex_all_dets::src.
Referenced by BOOST_AUTO_TEST_CASE(), EnvObjectStore_keys(), Translator::TestModuleReadNDArrayString::event(), Translator::TestModuleNDArrayString::event(), PsanaModuleGetObjects::event(), ImgAlgos::CSPadCommonModeCorrection::event(), cspad_mod::CsPadCalib::event(), Event_keys(), psana_python::moduleFactory(), and TimeTool::Analyze::updateBeamStatusBasedOnIpm().
std::vector< pytools::pyshared_ptr > psana_python::ProxyDictMethods::get_types | ( | PyObject * | arg0, | |
const char * | method | |||
) |
Returns the list types that are passed as a first argument to get() method. Not strictly a ProxyDict method, but shared between different classes which deal with ProxyDict. If argument is not good (not a type or not a list of types) then empty list is returned and Python exception is set.
[in] | arg0 | First argument to get() method |
[out] | method |
Definition at line 88 of file ProxyDictMethods.cpp.
References iter, and pytools::make_pyshared().
std::pair< Pds::Src, std::string > psana_python::ProxyDictMethods::arg_get_put | ( | PyObject * | args, | |
bool | needExact, | |||
const PSEvt::AliasMap * | amap | |||
) |
Returns the Src and Key typically passed in arguments 1 & 2 to the get() or put() method. Not strictly a ProxyDict method, but shared between different classes which deal with ProxyDict. If both arguments are not present, returns NoSource and an empty string. If the first argument is a Pds::Src or PSEvt::Source, turns it into the appropriate Pds::Src - checking for an exact Src match if needExact is true. If the first argument is a string, again NoSource is returned and the key is this string.
[in] | args | arguments to the Python function |
[in] | needExact | an exact Pds::Src is required, throws error if wildcard found in Source |
[in] | amap | AliasMap to determine exact Pds::Src from alias |
Definition at line 124 of file ProxyDictMethods.cpp.
References ex-ipython::amap, plot_analyze::args, pytools::PyDataType< ConcreteType, CppType >::cppObject(), PSEvt::Source::SrcMatch::isExact(), DCRange::key(), PSEvt::EventKey::noSource(), pytools::PyDataType< ConcreteType, CppType >::Object_TypeCheck(), expyda_andor_shape::source, PSEvt::Source::SrcMatch::src(), and ex_all_dets::src.
Referenced by EnvObjectStore_put(), Event_put(), and Event_remove().
PyObject * psana_python::ProxyDictMethods::get | ( | PSEvt::ProxyDictI & | proxyDict, | |
PyObject * | arg0, | |||
const PSEvt::Source & | source, | |||
const std::string & | key | |||
) |
Implementation of the get method.
get(...) is very overloaded method, here is the list of possible argument combinations:
Definition at line 227 of file ProxyDictMethods.cpp.
References PSEvt::ProxyDictI::get(), get_types(), psddl_python::ConverterMap::getToPyConverters(), SegGeometryCspad2x1V1::instance(), and expyda_andor_shape::source.
Referenced by EnvObjectStore_get(), and Event_get().
PyObject * psana_python::ProxyDictMethods::get_compat_typeid | ( | PSEvt::ProxyDictI & | proxyDict, | |
PyObject * | arg0, | |||
PyObject * | arg1 | |||
) |
Implementation of pyana compatibility get() methods (deprecated):
Definition at line 184 of file ProxyDictMethods.cpp.
References pytools::PyDataType< ConcreteType, CppType >::cppObject(), GUIAlignment::ex, psddl_python::ConverterMap::getFromPdsConverters(), SegGeometryCspad2x1V1::instance(), pytools::PyDataType< ConcreteType, CppType >::Object_TypeCheck(), and expyda_andor_shape::source.
Referenced by EnvObjectStore_get(), and Event_get().
PyObject * psana_python::ProxyDictMethods::get_compat_string | ( | PSEvt::ProxyDictI & | proxyDict, | |
PyObject * | arg0 | |||
) |
Implementation of pyana compatibility get() methods (deprecated):
Definition at line 163 of file ProxyDictMethods.cpp.
References PSEvt::ProxyDictI::get(), DCRange::key(), and PSEvt::Source::null.
Referenced by Event_get().
PyObject * psana_python::ProxyDictMethods::put | ( | PSEvt::ProxyDictI & | proxyDict, | |
PyObject * | arg0, | |||
const Pds::Src & | source, | |||
const std::string & | key | |||
) |
Add Python object to event, convert to C++ if possible. If it fails an exception is raised and zero pointer is returned, but may also throw C++ exception.
Definition at line 276 of file ProxyDictMethods.cpp.
References psddl_python::ConverterMap::getFromPyConverters(), SegGeometryCspad2x1V1::instance(), pytools::make_pyshared(), PSEvt::ProxyDictI::put(), and PSEvt::ProxyDictI::remove().
Referenced by EnvObjectStore_put(), and Event_put().
PyObject * psana_python::ProxyDictMethods::remove | ( | PSEvt::ProxyDictI & | proxyDict, | |
PyObject * | arg0, | |||
const Pds::Src & | source, | |||
const std::string & | key | |||
) |
Remove object from event. If it fails an exception is raised and zero pointer is returned, but may also throw C++ exception.
Definition at line 324 of file ProxyDictMethods.cpp.
References get_types(), psddl_python::ConverterMap::getToPyConverters(), SegGeometryCspad2x1V1::instance(), and PSEvt::ProxyDictI::remove().
Referenced by Event_remove(), and TestFile::~TestFile().