hats.io.summary_file#
Functions#
|
Write a |
|
Write a |
|
Generate summary content for any HATS catalog or collection. |
|
Write a summary readme file for any HATS catalog or collection. |
Module Contents#
- write_skymap_png(catalog_path: str | pathlib.Path | upath.UPath) None[source]#
Write a
skymap.pngpixel coverage map to the catalog directory.- Parameters:
- catalog_pathstr | Path | UPath
Path to the catalog directory. The PNG will be written alongside the catalog’s other files.
- write_partition_info_png(catalog_path: str | pathlib.Path | upath.UPath) None[source]#
Write a
partition_info.pngangular density map to the catalog directory.- Parameters:
- catalog_pathstr | Path | UPath
Path to the catalog directory. The PNG will be written alongside the catalog’s other files.
- generate_summary(catalog, *, fmt: Literal['markdown', 'html'] | None = None, name: str, description: str, uri: str | None, huggingface_metadata: bool, jinja2_template: str | None = None, extra_template_vars: dict | None = None) str[source]#
Generate summary content for any HATS catalog or collection.
- Parameters:
- catalogCatalog | CatalogCollection
The HATS catalog or collection to summarize.
- fmtLiteral[“markdown”, “html”] | None
Output format. Use
"markdown"or"html"to render the built-in template, orNoneto supply a fully customjinja2_template.- namestr
Human-readable name rendered in the summary.
- descriptionstr
Description rendered in the summary.
- uristr | None
URI of the catalog used for hyperlinks and code-snippet examples. If
None, a placeholder is used.- huggingface_metadatabool
Whether to include Hugging Face YAML frontmatter. Only valid when
fmt="markdown".- jinja2_templatestr | None
Jinja2 template string or path to a
.jinja2file. If a file path is given, the file is read automatically. Overrides the built-in template whenfmtis"markdown"or"html"; required whenfmt=None.- extra_template_varsdict | None
Additional variables passed into
template.render(). Useful for custom templates (e.g. VO registry XML fields) that reference variables HATS does not supply by default.
- Returns:
- str
Rendered summary content.
- write_catalog_summary_file(catalog_path: str | pathlib.Path | upath.UPath, *, fmt: Literal['markdown', 'html'] | None, filename: str | None = None, output_dir: str | pathlib.Path | upath.UPath | None = None, name: str | None = None, description: str | None = None, uri: str | None = None, huggingface_metadata: bool = False, jinja2_template: str | None = None, extra_template_vars: dict | None = None) upath.UPath[source]#
Write a summary readme file for any HATS catalog or collection.
- Parameters:
- catalog_pathstr | Path | UPath
Path to the HATS catalog or collection directory.
- fmtLiteral[“markdown”, “html”] | None
Output format. Use
"markdown"(writesREADME.md) or"html"(writesindex.html), orNoneto supply a fully customjinja2_templateandfilename.- filenamestr | None
Output filename. Defaults to
README.mdfor markdown andindex.htmlfor HTML. Required whenfmt=None.- output_dirstr | Path | UPath | None
Directory to write the file to. Defaults to
catalog_path.- namestr | None
Human-readable name. Inferred from catalog metadata if not provided.
- descriptionstr | None
Description. Inferred from catalog metadata if not provided.
- uristr | None
URI of the catalog used for hyperlinks and code-snippet examples. If
None, a placeholder is used.- huggingface_metadatabool
Whether to include Hugging Face YAML frontmatter. Only valid when
fmt="markdown".- jinja2_templatestr | None
Jinja2 template string or path to a
.jinja2file. If a file path is given, the file is read automatically. Overrides the built-in template whenfmtis"markdown"or"html"; required whenfmt=None.- extra_template_varsdict | None
Additional variables passed into
template.render(). Useful for custom templates (e.g. VO registry XML fields) that reference variables HATS does not supply by default.
- Returns:
- UPath
Path to the written summary file.