-
Atkins, Charles Vernon authored
* Add initial python support to CMake build * pybind11 2017-04-07 (1df91d36) Code extracted from: https://github.com/pybind/pybind11.git at commit 1df91d36cfa997c8987889234304ea5e37cc3e68 (v2.1.1). * Build python bindings with cmake * Adjust for adios2py -> adios2 module name
Atkins, Charles Vernon authored* Add initial python support to CMake build * pybind11 2017-04-07 (1df91d36) Code extracted from: https://github.com/pybind/pybind11.git at commit 1df91d36cfa997c8987889234304ea5e37cc3e68 (v2.1.1). * Build python bindings with cmake * Adjust for adios2py -> adios2 module name
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
adiosPyFunctions.cpp 907 B
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* adiosPyFunctions.cpp
*
* Created on: Mar 13, 2017
* Author: William F Godoy godoywf@ornl.gov
*/
#include "adiosPyFunctions.h"
namespace adios
{
Dims PyListToDims(const pyList list) noexcept
{
const unsigned int length = pybind11::len(list);
Dims dimensions;
dimensions.reserve(length);
for (unsigned int i = 0; i < length; ++i)
{
dimensions.push_back(pybind11::cast<size_t>(list[i]));
}
return dimensions;
}
Params KwargsToParams(const pyKwargs &kwargs) noexcept
{
Params parameters;
for (const auto &pair : kwargs)
{
parameters.emplace(pybind11::cast<std::string>(pair.first),
pybind11::cast<std::string>(pair.second));
}
return parameters;
}
} // end namespace adios