python bindings for eisgenerator
  • C++ 50.1%
  • Python 43.3%
  • CMake 6.6%
Find a file
Carl Philipp Klemm 1a6f704d94 update eisgenerator
2024-07-22 14:06:52 +02:00
eisgenerator@e0f3dbb318 update eisgenerator 2024-07-22 14:06:52 +02:00
example add support for getRecommendedParamIndices 2024-05-06 12:14:35 +02:00
src Add the ability to load an eisspectra from a python string 2024-07-16 16:59:31 +02:00
.gitmodules convert std::filesystem::path to std::string on the c++ side to avoid python based conversion 2024-06-28 16:19:51 +02:00
CMakeLists.txt convert std::filesystem::path to std::string on the c++ side to avoid python based conversion 2024-06-28 16:19:51 +02:00
noxfile.py Inital commit of python bindings 2022-05-04 13:59:51 +02:00
pyproject.toml Inital commit of python bindings for eisgenerator 2022-05-04 14:05:24 +02:00
README.md make using torch execution easier for sweeps by adding a method of easily creating the tensors taken by the torch model function 2024-01-29 10:50:09 +01:00
setup.py Update binidngs for new eisgenerator, add __repr__ methods 2024-01-22 09:56:46 +01:00

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.git
  • cd eisgeneraorpy
  • pip 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
  • eisgenerator.Range
  • eisgenerator.EisSpectra
  • eisgenerator.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
      1. a 1d, (n) sized tensor containing the model parameters
      2. 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