{# Shared markup for the NetCDF inventory tables (variables and coordinates): a common header row, a common data row, and the per-row attribute disclosure. Used by _nc_variables.html and _nc_coords.html so both tables stay identical. #} {% macro var_thead() %} VariableTypeUnitsStandard / long nameMin / MaxN (valid)Attributes {% endmacro %} {% macro attr_disclosure(attrs) %} {%- if attrs %}
{{ attrs|length }} attr{{ 's' if attrs|length != 1 else '' }} {% for k, val in attrs.items() %} {% endfor %}
{{ k }}{{ val }}
{% endif -%} {% endmacro %} {% macro var_row(v) %} {{ v.name }}{% if v.has_qc %} (_QC){% endif %} {{ v.dtype }} {{ v.units }} {% if v.standard_name %}{{ v.standard_name }}{% endif %}{% if v.long_name %}{% if v.standard_name %}
{% endif %}{{ v.long_name }}{% endif %} {% if v.v_min is not none %}{{ v.v_min }} / {{ v.v_max }}{% else %}—{% endif %} {{ "{:,}".format(v.n) }}{% if v.n_valid is defined and v.n_valid < v.n %} ({{ "{:,}".format(v.n_valid) }}){% endif %} {{ attr_disclosure(v.attrs) }} {% endmacro %}