NRLMMD-GEOIPS / NRLMMD-GEOIPS/pluginify

Give YAML plugin objects a useful `__str__`

Open
#33 0 comments 0 reactions 1 assignee View on GitHub

@coleman-m is already working on this.

Since Sep 18, 2026.

  • #34 by @coleman-m — open
Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Requested Update

Description
  • Printing a YAML plugin doesn't tell you much at a glance, since it falls back to the full __repr__ dump of the plugin's contents. Add a __str__ to BaseYamlPlugin that gives a short readable summary for the cases where you just want to know which plugin you're looking at.
Background and Motivation
  • This is the pluginify side of NRLMMD-GEOIPS/geoips#424, which covers the class-based plugins whose base class lives over in geoips. Both sides are using the same wording so the two kinds of plugin read the same way.
  • __repr__ stays exactly as it is. The full dump is useful when you actually want to see everything in a plugin, and this is only about having a shorter option alongside it.
  • Leaving family out of the output on purpose, since it's on its way to being deprecated.
Alternative Solutions
  • Only fixing the class-based side in geoips and leaving this one alone. Workable, but then
    the two kinds of plugin behave differently for no good reason.
Environment
Code to demonstrate issue

What you get now:

>>> print(products.get_plugin(("abi", "Infrared")))
ProductsPlugin({'interface': 'products', 'name': 'Infrared', 'spec': {...}, ...})

What we want, with repr still available for the full picture:

>>> print(products.get_plugin(("abi", "Infrared")))
Infrared (products plugin from geoips)
Checklist for Completion
  • Add __str__ to BaseYamlPlugin
  • Leave __repr__ alone
  • Make sure it degrades gracefully when a plugin is missing attributes, so it never
    blows up on a half-built plugin in a debugger
  • Keep the wording matching what geoips#424 produces
  • Add tests
  • Add a release note

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.