Skip to content

Commit c4b7d9a

Browse files
committed
Rename capgen-ng to capgen
1 parent 19b01c3 commit c4b7d9a

117 files changed

Lines changed: 466 additions & 463 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/end-to-end-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: capgen-ng end-to-end tests
1+
name: capgen end-to-end tests
22

33
on:
44
workflow_dispatch:

.github/workflows/unit-tests.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: capgen-ng unit tests
1+
name: capgen unit tests
22

33
on:
44
workflow_dispatch:
@@ -12,7 +12,7 @@ concurrency:
1212
jobs:
1313

1414
unit-tests:
15-
name: capgen-ng unit tests
15+
name: capgen unit tests
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
@@ -40,9 +40,9 @@ jobs:
4040
which xmllint
4141
xmllint --version
4242
which pytest
43-
- name: Run capgen-ng unit tests
43+
- name: Run capgen unit tests
4444
run: |
4545
pytest -v unit-tests/
46-
- name: Run capgen-ng module doctests
46+
- name: Run capgen module doctests
4747
run: |
48-
PYTHONPATH=capgen-ng pytest --doctest-modules capgen-ng
48+
PYTHONPATH=capgen pytest --doctest-modules capgen

capgen-ng/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

capgen-ng/generator/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

capgen-ng/metadata/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22

3-
"""ccpp_capgen_ng — next-generation CCPP cap code generator.
3+
"""ccpp_capgen — next-generation CCPP cap code generator.
44
55
This script replaces both ``ccpp_prebuild.py`` and ``ccpp_capgen.py`` from the
66
legacy toolchain. It reads host-model metadata files, scheme metadata files,
@@ -20,7 +20,7 @@
2020
-----
2121
::
2222
23-
ccpp_capgen_ng.py \\
23+
ccpp_capgen.py \\
2424
--host-name <name> \\
2525
--host-files <f1.meta,f2.meta,...> \\
2626
--scheme-files <f1.meta,f2.meta,...> \\
@@ -75,7 +75,7 @@
7575
import sys
7676
from typing import Dict, List, Optional, Tuple
7777

78-
# Ensure the capgen-ng package is importable when invoked directly.
78+
# Ensure the capgen package is importable when invoked directly.
7979
_SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
8080
_PACKAGE_DIR = os.path.dirname(_SCRIPT_DIR)
8181
if _PACKAGE_DIR not in sys.path:
@@ -106,7 +106,7 @@
106106
# Logging
107107
########################################################################
108108

109-
_LOGGER = init_log('ccpp_capgen_ng')
109+
_LOGGER = init_log('ccpp_capgen')
110110

111111

112112
########################################################################
@@ -125,8 +125,8 @@
125125
# generated cap modules whenever any suite touches constituent state.
126126
# Listed in datatable.xml's <utilities> so host CMake projects pick them
127127
# up via ccpp_datafile.py --utility-files / --ccpp-files queries. All
128-
# of these live in :data:`_FRAMEWORK_SRC_DIR` (capgen-ng's own ``src/``);
129-
# capgen-ng ships self-contained — no external src/ companion needed.
128+
# of these live in :data:`_FRAMEWORK_SRC_DIR` (capgen's own ``src/``);
129+
# capgen ships self-contained — no external src/ companion needed.
130130
_FRAMEWORK_F90_FILES = [
131131
'ccpp_constituent_prop_mod.F90',
132132
'ccpp_hashable.F90',
@@ -139,8 +139,8 @@ def _resolve_framework_f90_files() -> List[str]:
139139
"""Return absolute paths for the framework F90 files.
140140
141141
Each name in :data:`_FRAMEWORK_F90_FILES` is looked up under
142-
:data:`_FRAMEWORK_SRC_DIR` (``capgen-ng/src/``). A missing file is
143-
a hard error: capgen-ng/src/ is the canonical (and only) location;
142+
:data:`_FRAMEWORK_SRC_DIR` (``capgen/src/``). A missing file is
143+
a hard error: capgen/src/ is the canonical (and only) location;
144144
a missing file means the deployment is incomplete and the host
145145
build would fail later with an opaque "Cannot open module file"
146146
error. Surface it now with a precise message instead.
@@ -155,10 +155,10 @@ def _resolve_framework_f90_files() -> List[str]:
155155
missing.append(p)
156156
if missing:
157157
raise CCPPError(
158-
"capgen-ng deployment is incomplete: required framework "
158+
"capgen deployment is incomplete: required framework "
159159
"Fortran source file(s) not found under {!r}:\n {}\n"
160-
"Vendor the missing file(s) into capgen-ng/src/ (the "
161-
"canonical location for files capgen-ng emits a USE for).".format(
160+
"Vendor the missing file(s) into capgen/src/ (the "
161+
"canonical location for files capgen emits a USE for).".format(
162162
_FRAMEWORK_SRC_DIR, '\n '.join(missing),
163163
)
164164
)
@@ -177,7 +177,7 @@ def _build_arg_parser() -> argparse.ArgumentParser:
177177
argparse.ArgumentParser
178178
"""
179179
parser = argparse.ArgumentParser(
180-
prog='ccpp_capgen_ng.py',
180+
prog='ccpp_capgen.py',
181181
description='CCPP next-generation cap code generator',
182182
formatter_class=argparse.RawDescriptionHelpFormatter,
183183
epilog=__doc__,
@@ -253,7 +253,7 @@ def _build_arg_parser() -> argparse.ArgumentParser:
253253
"TRANSIENT MIGRATION SHIM. Accept legacy CCPP standard "
254254
"names (currently 'horizontal_loop_extent') in scheme "
255255
"metadata and silently rewrite them to their canonical "
256-
"capgen-ng equivalents ('horizontal_dimension'). Emits a "
256+
"capgen equivalents ('horizontal_dimension'). Emits a "
257257
"loud warning at startup. Will be removed."
258258
),
259259
)
@@ -718,7 +718,7 @@ def _load_metadata_files(
718718
# ``number_of_threads`` is carried as a control dummy (the framework owns
719719
# no per-thread state yet, so its value is not consumed — kept for symmetry
720720
# with ``number_of_instances`` and future per-thread sizing).
721-
# (A chunk/block index is intentionally NOT a control pair: capgen-ng's
721+
# (A chunk/block index is intentionally NOT a control pair: capgen's
722722
# slice-based design passes the current chunk as a horizontal range via
723723
# horizontal_loop_begin/end, so no scheme ever indexes by chunk inside a call.)
724724
# Each entry: (index std_name, count std_name, index description, count description).
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22

3-
"""Query CLI for the ``datatable.xml`` produced by ``ccpp_capgen_ng.py``.
3+
"""Query CLI for the ``datatable.xml`` produced by ``ccpp_capgen.py``.
44
55
This is the read-side companion to :mod:`generator.datatable`. The writer
66
half lives in the generator package; this module is a pure-Python,
@@ -24,15 +24,15 @@
2424
2525
Exactly one report action is required per invocation.
2626
27-
Notes specific to capgen-ng
27+
Notes specific to capgen
2828
---------------------------
2929
* ``--host-files`` returns ``<host>_ccpp_cap.F90`` (the per-host static API;
3030
filename and module name derived from ``--host-name`` at generation time).
3131
* ``--capgen-files`` enumerates Fortran sources only. Non-Fortran inspection
3232
artifacts (``ccpp_<suite>.meta``, ``ccpp_<suite>_expanded.xml``) are
3333
reported via ``--inspection-files``.
3434
* ``--process-list`` is supported syntactically but will return an empty
35-
string: capgen-ng does not currently record a ``process`` attribute on
35+
string: capgen does not currently record a ``process`` attribute on
3636
scheme entries.
3737
"""
3838

@@ -167,7 +167,7 @@ def valid_actions(cls):
167167
def _command_line_parser():
168168
"""Create and return an ArgumentParser for parsing the command line."""
169169
description = """
170-
Retrieve information about a ccpp_capgen_ng run.
170+
Retrieve information about a ccpp_capgen run.
171171
The returned information is controlled by selecting an action from
172172
the list of optional arguments below.
173173
Note that exactly one action is required.
@@ -297,7 +297,7 @@ def _retrieve_scheme_files(table):
297297
(or ``.F`` / ``.f90`` / ``.f``) sources for schemes that the loaded
298298
suites actually reference. Build systems use this to compile exactly
299299
the scheme set the suites consume; unreferenced scheme metadata
300-
files passed on the capgen-ng CLI for convenience are filtered out.
300+
files passed on the capgen CLI for convenience are filtered out.
301301
302302
# Test valid scheme files
303303
>>> table = ET.fromstring("<ccpp_datatable version='1.0'><scheme_files>"\
@@ -345,7 +345,7 @@ def _retrieve_scheme_files(table):
345345
def _retrieve_inspection_files(table, file_type=None):
346346
"""Find and retrieve a list of inspection filenames from <table>.
347347
348-
Inspection files are non-Fortran artifacts emitted by capgen-ng for
348+
Inspection files are non-Fortran artifacts emitted by capgen for
349349
debugging and downstream tooling: suite ``.meta`` files and expanded
350350
suite-definition XML. Each kind lives in its own subsection of
351351
``<inspection_files>``.
@@ -390,7 +390,7 @@ def _retrieve_inspection_files(table, file_type=None):
390390
def _retrieve_process_list(table):
391391
"""Find and return a list of all physics scheme processes in <table>.
392392
393-
capgen-ng does not currently record a ``process`` attribute on
393+
capgen does not currently record a ``process`` attribute on
394394
scheme entries, so this returns an empty list when no scheme carries
395395
one. The flag is kept for CLI compatibility.
396396
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
import sys
6060
from typing import Dict, List, NamedTuple, Optional, Set, Tuple
6161

62-
# Ensure the capgen-ng package is importable when invoked directly.
62+
# Ensure the capgen package is importable when invoked directly.
6363
_SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
6464
_PACKAGE_DIR = os.path.dirname(_SCRIPT_DIR)
6565
if _PACKAGE_DIR not in sys.path:
@@ -1750,15 +1750,15 @@ def _build_parser() -> argparse.ArgumentParser:
17501750
"TRANSIENT MIGRATION SHIM. Accept legacy CCPP standard "
17511751
"names (currently 'horizontal_loop_extent') in scheme "
17521752
"metadata and silently rewrite them to their canonical "
1753-
"capgen-ng equivalents ('horizontal_dimension'). Emits a "
1753+
"capgen equivalents ('horizontal_dimension'). Emits a "
17541754
"loud warning at startup. Will be removed."
17551755
),
17561756
)
17571757
# NB: --gfs-dim-aliases is NOT exposed here. That shim only takes
17581758
# effect inside generator.suite_resolver._canonical_dim, which the
17591759
# validator never invokes (the validator compares metadata against
17601760
# Fortran source, not host metadata against scheme metadata), so
1761-
# the flag would be a no-op. See capgen-ng/ccpp_capgen_ng.py.
1761+
# the flag would be a no-op. See capgen/ccpp_capgen.py.
17621762
# auto-clone-constituents: transient legacy shim. This one DOES
17631763
# belong on the validator because the shim extends the parser's
17641764
# ``_KNOWN_ATTRS`` set — without the flag the validator rejects
@@ -1774,7 +1774,7 @@ def _build_parser() -> argparse.ArgumentParser:
17741774
"TRANSIENT LEGACY SHIM. Accept four legacy constituent "
17751775
"attributes (default_value, min_value, water_species, "
17761776
"mixing_ratio_type) on scheme args. Mirrors the same "
1777-
"flag on ccpp_capgen_ng so legacy scheme metadata that "
1777+
"flag on ccpp_capgen so legacy scheme metadata that "
17781778
"needs auto-clone-static-constituent codegen can be "
17791779
"validated against its Fortran source. Emits a loud "
17801780
"warning at startup. Will be removed."

capgen/generator/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Cap code generation for ccpp-capgen."""
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
XML layout
77
----------
88
9-
Two top-level file sections partition capgen-ng's outputs by language:
9+
Two top-level file sections partition capgen's outputs by language:
1010
1111
* ``<capgen_files>`` lists *Fortran sources only* — utilities, the host-facing
1212
API, and per-suite cap modules. All paths here end in ``.F90`` and are
@@ -129,13 +129,13 @@ def _build_capgen_files(
129129
) -> None:
130130
"""Append ``<capgen_files>`` to *root*.
131131
132-
``<capgen_files>`` lists Fortran sources generated by capgen-ng (utilities,
132+
``<capgen_files>`` lists Fortran sources generated by capgen (utilities,
133133
the host-facing API, and per-suite caps). Non-Fortran inspection
134134
artifacts (e.g. ``.meta`` files, expanded SDFs) live in
135135
``<inspection_files>`` and are emitted by :func:`_build_inspection_files`.
136136
137137
``host_file_paths`` lists files generated for the host-facing API. In
138-
capgen-ng this is the static API (``<host>_ccpp_cap.F90``); the section is
138+
capgen this is the static API (``<host>_ccpp_cap.F90``); the section is
139139
emitted unconditionally (possibly empty) to keep the schema stable.
140140
"""
141141
capgen_files = ET.SubElement(root, 'capgen_files')
@@ -164,7 +164,7 @@ def _build_scheme_files(
164164
165165
Lists the Fortran source files of schemes actually referenced by some
166166
loaded suite (group phase calls + suite-level ``<init>`` / ``<final>``).
167-
These files are *not* generated by capgen-ng — they are the
167+
These files are *not* generated by capgen — they are the
168168
user-supplied scheme implementations the build system must compile.
169169
The section is always written (possibly empty) so the schema stays
170170
stable for ``ccpp_datafile.py`` consumers.
@@ -182,7 +182,7 @@ def _build_inspection_files(
182182
) -> None:
183183
"""Append ``<inspection_files>`` to *root*.
184184
185-
Inspection artifacts are non-Fortran outputs that capgen-ng emits for
185+
Inspection artifacts are non-Fortran outputs that capgen emits for
186186
debugging and downstream tooling. They are *not* compiled. Each kind
187187
of artifact lives in its own subsection so consumers can pick a specific
188188
file type or take them all together via ``--inspection-files``.
@@ -400,7 +400,7 @@ def write_datatable(
400400
output_root : str
401401
Output directory.
402402
host_file_paths : list of str, optional
403-
Absolute paths to host-facing API files (capgen-ng emits
403+
Absolute paths to host-facing API files (capgen emits
404404
``<host>_ccpp_cap.F90`` here). The ``<host_files>`` section is
405405
always written (possibly empty).
406406
scheme_file_paths : list of str, optional

0 commit comments

Comments
 (0)