Conversation
| source model | ||
| │ | ||
| ▼ | ||
| parser package ──> r2x_core.System ──> R2X translation plugin | ||
| │ | ||
| ▼ | ||
| target r2x_core.System | ||
| │ | ||
| ▼ | ||
| exporter package | ||
| ``` |
There was a problem hiding this comment.
This should be a mermaid diagram instead.
There was a problem hiding this comment.
Addressed in 27f55cd: replaced the text diagram with a Mermaid flowchart.
There was a problem hiding this comment.
🟡 Changes recommended
Several documentation inaccuracies currently mislead users or provide failing commands and imports.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Refreshes R2X documentation with improved navigation, onboarding, architecture, development, workflow, and translation guidance.
Changes:
- Adds getting-started and API guidance.
- Documents architecture and contributor workflows.
- Updates documentation navigation and maintenance instructions.
File summaries
| File | Summary | Review notes |
|---|---|---|
docs/source/index.md |
Adds documentation index and navigation. | — |
docs/source/getting_started.md |
Adds installation and workflow guidance. | Moderate: fix CLI installation, package README API examples, and docs build setup. |
docs/source/development.md |
Adds contributor, translation, and build guidance. | Moderate: use the current Sphinx workflow; nit: correct package-specific getter utility naming. |
docs/source/dev_workflow.md |
Updates translation workflow documentation. | Nit: distinguish low-level contributor workflows from public API examples. |
docs/source/architecture.md |
Documents package boundaries and structure. | Nit: describe getter utility modules as package-specific. |
docs/README.md |
Adds documentation landing-page navigation. | — |
Review details
Suppressed comments (2)
docs/source/getting_started.md:76
- This says the documentation build is separate from the Python environment, but the current CI build uses Sphinx from uv's
docsdependency group (sync-args: "--group docs"). The new getting-started path therefore points users away from the actual build setup; describe the uv docs group and Sphinx command instead.
The documentation build is maintained separately from the Python environment.
See [development](development.md) for the documentation commands and the
translation-package maintenance workflow.
docs/source/getting_started.md:11
- The getting-started path presents
r2x installas the first executable command but never tells readers how to installr2x-cli; the root README has a dedicated CLI-install step atREADME.md:47-50. A user following this page's prerequisites still has nor2xcommand, so link to the CLI installation instructions before the plugin commands.
Use Python 3.11, 3.12, or 3.13. For a managed environment, install
[uv](https://docs.astral.sh/uv/). The command-line workflow also requires the
[r2x-cli](https://github.com/NatlabRockies/r2x-cli).
- Files reviewed: 6/6 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| The Astro site is in `docs/` and uses npm with the committed lockfile. From | ||
| that directory: | ||
|
|
||
| ```bash | ||
| npm ci | ||
| npm run build |
There was a problem hiding this comment.
Addressed in 27f55cd: restored the current Sphinx and uv docs-group commands used by this PR's CI. The Astro/npm instructions remain scoped to the dependent migration PR.
| See the package [README files](https://github.com/NatlabRockies/R2X/tree/main/packages) | ||
| for package-specific entry points and examples. |
There was a problem hiding this comment.
Addressed in 27f55cd: the getting-started page now points readers to the workflow guides rather than the stale package README examples.
| - `translation.py` exposes the public translation function. | ||
| - `plugin_config.py` defines the typed configuration accepted by that function. | ||
| - `config/rules.json` contains declarative source-to-target mappings. | ||
| - `getters.py` and `getters_utils.py` contain derived-field and post-processing logic. |
There was a problem hiding this comment.
Addressed in 27f55cd: the architecture page now describes getter and post-processing modules as package-specific and lists the observed naming variants.
| Each workflow below shows how to install the upstream parser and exporter as | ||
| editable packages and provides a complete Python API example. Use the guide | ||
| that matches your source and target formats. |
There was a problem hiding this comment.
Addressed in 27f55cd: the workflow page now labels these as contributor-oriented integration examples and directs readers seeking the smaller public API surface to Getting started.
| 4. Update `getters.py` or `getters_utils.py` only when the value needs | ||
| computation, context, unit conversion, membership resolution, or | ||
| post-processing. |
There was a problem hiding this comment.
Addressed in 27f55cd: the contributor guidance now refers to package-specific getter and post-processing modules instead of assuming a shared filename.
|
Addressed the review feedback in commit |
| ## Package boundaries | ||
|
|
||
| | Layer | Responsibility | Examples | | ||
| | --- | --- | --- | | ||
| | CLI | Discovers plugins, manages the Python environment, and runs pipelines. | `r2x-cli` | | ||
| | Parser | Reads a source format into an `r2x_core.System`. | `r2x-reeds`, `r2x-plexos`, `r2x-sienna` | | ||
| | Core | Provides the shared `System`, `PluginContext`, `Rule`, and rule-engine APIs. | `r2x-core` | | ||
| | Translation | Maps source components and fields to target components and attaches derived data. | This repository | | ||
| | Exporter | Writes a target system to its native format. | `r2x-plexos`, `r2x-sienna` | |
There was a problem hiding this comment.
Add hyperlink to the repos.
There was a problem hiding this comment.
Addressed in 2ae8dcf: the package-boundary table now links to the r2x-cli, parser, r2x-core, and exporter repositories.
| - `translation.py` exposes the public translation function. | ||
| - `plugin_config.py` defines the typed configuration accepted by that function. | ||
| - `config/rules.json` contains declarative source-to-target mappings. | ||
| - `getters.py` and `getters_utils.py` contain derived-field and post-processing logic. | ||
| - `tests/` exercises translation behavior and important edge cases. |
There was a problem hiding this comment.
This is missing important artifacts under config. See r2x-core for the latests.
There was a problem hiding this comment.
Addressed in 2ae8dcf: the architecture page now documents the package-specific config/ artifacts, including defaults.json, rules.json, and configuration helpers.
| ## Rules and getters | ||
|
|
||
| Rules handle direct field mappings, defaults, source and target component types, | ||
| and filters. Getter functions handle values that require computation or context, | ||
| such as unit conversion, commitment status, outage rates, memberships, and | ||
| name resolution. Keep these responsibilities separate: put a stable mapping in | ||
| `rules.json`, and put computation that needs code or context in a getter. | ||
|
|
||
| When a mapping changes, update the rule and the behavior-focused tests together. | ||
| When a getter changes, test both its returned value and the resulting target | ||
| component or time series where feasible. |
There was a problem hiding this comment.
Hyperlink to r2x-core
There was a problem hiding this comment.
Addressed in 2ae8dcf: the page now links to the r2x-core plugin-system and rules-system documentation.
| 1. Copy the current English page into the language-specific documentation | ||
| location defined by the site configuration. | ||
| 2. Preserve the page's frontmatter, headings, code fences, links, tables, and | ||
| command or API names. Translate prose, navigation labels, and accessible | ||
| text, but do not translate package names, Python identifiers, CLI commands, | ||
| file paths, or configuration keys. | ||
| 3. Add the translated page to the same sidebar position as the English page and | ||
| add the language to the site language selector when the site supports one. | ||
| 4. Record the English source page and its source revision in the translated | ||
| page's frontmatter or maintenance metadata. This makes stale translations | ||
| discoverable after an English update. | ||
| 5. Have a reviewer who understands the target language and the R2X workflow | ||
| verify technical meaning, commands, links, and terminology. | ||
| 6. Build the documentation and inspect the rendered translated page before | ||
| merging. |
There was a problem hiding this comment.
Addressed in 2ae8dcf: removed the out-of-scope documentation-localization section and reduced the development page to repository checks and interoperability-package contribution guidance.
|
Addressed the additional review comments in commit |
|
Addressed the latest review feedback in commit |
|
Addressed the |
Summary
Refresh the R2X documentation structure following the documentation enhancement approach used by r2x-cli PR #185.
Testing Strategy
git diff --checkStacked PR
This is the first PR in a stack. The Astro migration follows in PR #326.