python bindings for eisgenerator
- C++ 50.1%
- Python 43.3%
- CMake 6.6%
| eisgenerator@e0f3dbb318 | ||
| example | ||
| src | ||
| .gitmodules | ||
| CMakeLists.txt | ||
| noxfile.py | ||
| pyproject.toml | ||
| README.md | ||
| setup.py | ||
eisgeneratorpy
Python3 bindings for eisgenerator
Requirements
- git
- c++11 capable compiler (GCC, CLANG)
- cmake 3.20 or higher
- libeisgenerator from eisgenerator
- pybind11
- pip
Compile/Install Procedure
git clone https://git-ce.rwth-aachen.de/carl_philipp.klemm/eisgeneraorpy.gitcd eisgeneraorpypip install .
Usage
These bindings provide only a subset of the functionality provided by eisgenerator.
The main suported classes are
eisgenerator.Model- corrisponds too eis::Model
- only a subset of members are suported includeing the execute* family and the code generation members
eisgenerator.DataPoint- corrisponds too eis::DataPoint
eisgenerator.Range- corrisponds too eis::Range
eisgenerator.EisSpectra- corrisponds too eis::EisSpectra
eisgenerator.Log- corrisponds too eis::Log
TorchScript exectution is performed differently than on the C++ and two extra functions are provided for this:
eisgenerator.compileModel- compiles the model to a torch object and caches it internally, returns True if this was sucessfull
eisgenerator.getModelFunction- returns the a fuction object to use the model, or None on failure
- the returned function takes two torch.Tensor parameters
- a 1d, (n) sized tensor containing the model parameters
- a 1d, (n) sized tensor with omega values to calculate the impance at
- a 1d complex tensor is returned with the impedance values
eisgenerator.getModelParameters- returns the model paramters at the given index as a torch.Tensor