{#-
  Jinja2 Template for a Pandera class-based model
  Details at https://pandera.readthedocs.io/en/stable/dataframe_models.html
-#}
{%- import 'slots.jinja2' as slot_macros -%}

{%- macro render_class(cls) %}
class {{cls.name}}(
        {%- if cls.is_a -%}
            {{ cls.is_a }}
        {%- else -%}
            pla.DataFrameModel, _LinkmlPanderaValidator
        {%- endif -%}
):
    {%- if cls.source_class.description %}
    """
    {{ cls.source_class.description }}
    """
    {% endif -%}
    {%- if (cls.fields | length) == 0 %}
    pass
    {% endif -%}
    {%- for field in cls.fields -%}
        {{ slot_macros.render_slot(field) }}
    {%- endfor -%}
{% endmacro -%}
