Page History
...
Do not call it, it's for pyana internal use.
...
Module _pdsdata
This is a Python extension module which provides Python interface for all pdsdata classes and functions. It is implemented in C++ and exists as a loadable module (library). The Python classes in this module try to mimic the interfaces and behavior of their corresponding C++ classes as closely as possible. In many cases this is trivial to achieve, but there may be few differences which are noted explicitly in every case. One notable difference is C++ enums which define symbolic names for integral constants. Python emulation of enums is complicated for a number of reasons such as absence of true enum type in Python and dynamic nature of language. The implementation of the enums in Python in this case is done through the introduction of special new type with the static members whose names and values correspond to C++ enums. It is better explained with example. Suppose there is a class in C++:
Code Block | ||||
---|---|---|---|---|
| ||||
class DetInfo {
enum Detector{ NoDetector, AmoIms, AmoGasdet, ... };
};
|
Then the corresponding construct in Python can be expressed approximately like this:
Code Block | ||||
---|---|---|---|---|
| ||||
class DetInfo :
class Detector (int):
NoDetector = Detector(0)
AmoIms = Detector(1)
AmoGasdet = Detector(2)
|
The main difference in use is that in C++ to get enum value one needs to write DetInfo.AmoIms
when in Python it needs to be DetInfo.Detector.AmoIms
.
...
Module _pdsdata.xtc
This module contains classes corresponding to those in C++ pdsdata/xtc package.