pycsamt.jones.config#

Configuration and canonical constants for the A.G. Jones J‑format reader/writer (pycsamt.jones).

This module centralizes tokens, regex patterns, field names, component codes, and small look‑ups that other submodules (utils, property, components, j, etc.) can import.

Notes

The J‑format is defined by A.G. Jones (1994, v2.0). A J file is organized as:

  1. COMMENT BLOCK — lines beginning with # (ignored by parser).

  2. INFORMATION BLOCK — lines beginning with >KEY=VALUE.

  3. One or more DATA BLOCKs per site.

Data blocks start with a station line, a data‑type line, the number of points to follow, then rows whose shape depends on the data type. See FIELDS_R and FIELDS_TF below.

We intentionally keep this module free of I/O logic; only constants and patterns live here to preserve a clean import graph and make unit tests deterministic.

Classes

DTypeSpec(fields, regex[, notes])

Describe a J data‑block layout.

class pycsamt.jones.config.DTypeSpec(fields, regex, notes='')[source]#

Bases: object

Describe a J data‑block layout.

Parameters:
  • fields (sequence of str) – Column names for each row in the block.

  • regex (Pattern[str]) – Compiled regex to parse a single row.

  • notes (str) – Short human‑readable note explaining special rules.

fields: Sequence[str]#
regex: Pattern[str]#
notes: str = ''#