pycsamt.jones.components#
Classes
Lightweight facade to manage Jones (J-format) components on a host object. |
- class pycsamt.jones.components.JComponentMixin[source]#
Bases:
objectLightweight facade to manage Jones (J-format) components on a host object. The host is expected to expose a mapping-like container (
self.sectionsorself.components). Keys are normalized to lowercase for stable lookups.The mixin centralizes small CRUD helpers (
cget/cset/chas/ cdrop/snapshot) and offers typed accessors for frequent J parts such asbanner,info,head,heads,blocks, and derived data objects (z,tip,res).It also provides
compose_headerswhich serializes the header portion of a J file by callingwrite()on available components. If a combinedheadscomponent is present, it takes precedence over separatebanner/head/infoparts to avoid duplication.- compose_headers(*, prefer_heads=True, join=False)[source]#
Serialize header lines by querying available components. If
prefer_headsis True and aheadscomponent is present, it is used exclusively. Otherwise the mixin attemptsbanner+head+infoin that order.When
joinis True, returns a single string joined with newlines. Otherwise returns a list of lines.