|
7 | 7 | dvue ui --plugin schismviz.readers /path/to/study/param.nml |
8 | 8 | dvue ui --plugin schismviz.readers /path/to/schism_studies.yaml |
9 | 9 |
|
10 | | -The registration call at the bottom of this module fires at import time, |
11 | | -so all three entry points work: |
| 10 | +The :func:`register_readers` function is used by setuptools entry points |
| 11 | +(``dvue.plugins`` group). For backward compatibility, registration also |
| 12 | +fires at import time, so all three entry points work: |
12 | 13 |
|
13 | 14 | 1. ``dvue ui --plugin schismviz.readers`` (generic dvue combine UI) |
14 | 15 | 2. ``schismviz combine`` (SCHISM-specific combine UI via this package's CLI) |
@@ -534,21 +535,33 @@ def is_irregular(self, r) -> bool: |
534 | 535 |
|
535 | 536 |
|
536 | 537 | # --------------------------------------------------------------------------- |
537 | | -# Registration — runs at import time |
| 538 | +# Registration |
538 | 539 | # --------------------------------------------------------------------------- |
539 | 540 |
|
540 | | -# Compound NML extensions (.nml.clinic, .nml.barotropic, .nml.tropic) are |
541 | | -# identified by their *last* suffix via os.path.splitext in the registry; |
542 | | -# scan() inspects the full suffix chain to confirm the .nml prefix. |
543 | | -ReaderRegistry.register( |
544 | | - "schism_output", |
545 | | - SchismOutputReader, |
546 | | - extensions=[ |
547 | | - ".nml", |
548 | | - ".clinic", |
549 | | - ".barotropic", |
550 | | - ".tropic", |
551 | | - ".yaml", |
552 | | - ".yml", |
553 | | - ], |
554 | | -) |
| 541 | + |
| 542 | +def register_readers() -> None: |
| 543 | + """Register SCHISM readers with dvue's :class:`ReaderRegistry`. |
| 544 | +
|
| 545 | + This is the callable referenced by the ``dvue.plugins`` entry point: |
| 546 | +
|
| 547 | + ``schismviz = \"schismviz.readers:register_readers\"``. |
| 548 | + """ |
| 549 | + |
| 550 | + # Compound NML extensions (.nml.clinic, .nml.barotropic, .nml.tropic) are |
| 551 | + # identified by their *last* suffix via os.path.splitext in the registry; |
| 552 | + # scan() inspects the full suffix chain to confirm the .nml prefix. |
| 553 | + ReaderRegistry.register( |
| 554 | + "schism_output", |
| 555 | + SchismOutputReader, |
| 556 | + extensions=[ |
| 557 | + ".nml", |
| 558 | + ".clinic", |
| 559 | + ".barotropic", |
| 560 | + ".tropic", |
| 561 | + ".yaml", |
| 562 | + ".yml", |
| 563 | + ], |
| 564 | + ) |
| 565 | + |
| 566 | +# Backward compatibility: preserve import-time registration behavior. |
| 567 | +register_readers() |
0 commit comments