/* 
* Copyright (C) 2020-2026 MEmilio
*
* Authors: Martin Siggel, Daniel Abele, Martin J. Kuehn, Jan Kleinert
*
* Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

${includes}

namespace py = pybind11;

${pretty_name_function}

${simulation_vector_definition}
PYBIND11_MODULE(_simulation_${python_module_name}, m)
{
    ${population_enums}

    ${parameterset_indexing}
    pymio::bind_ParameterSet<${namespace}${parameterset}<${ScalarType}>, pymio::EnablePickling::Required>(m, "${parameterset}");

    ${parameterset_wrapper}
   
    pymio::bind_Population(m, "Populations", mio::Tag<${namespace}${model_class_name}<${ScalarType}>::${population}>{});
   
    pymio::bind_CompartmentalModel<${model_base_templates}>(m, "${model_class_name}Base");
    py::class_<${namespace}${model_class_name}<${ScalarType}>, pymio::EnablePickling::Required, ${model_base_templates}>(m, "${model_class_name}");
    
    ${model_init}

    ${simulation}
    ${draw_sample}
    m.def("interpolate_simulation_result",
        static_cast<mio::TimeSeries<${ScalarType}> (*)(const mio::TimeSeries<${ScalarType}>&, const ${ScalarType})>(
            &mio::interpolate_simulation_result),
        py::arg("ts"), py::arg("abs_tol") = 1e-14);

    m.def("interpolate_simulation_result",
        static_cast<mio::TimeSeries<${ScalarType}> (*)(const mio::TimeSeries<${ScalarType}>&, const std::vector<${ScalarType}>&)>(
            &mio::interpolate_simulation_result),
        py::arg("ts"), py::arg("interpolation_times"));

    m.def("interpolate_ensemble_results", &mio::interpolate_ensemble_results<mio::TimeSeries<${ScalarType}>>);
    

    m.attr("__version__") = "dev";
}
