Skip to content

docs: update usage messages to follow Wolfram Language documentation style - #21

Merged
lwJi merged 1 commit into
mainfrom
docs/update-usage-messages
Jan 6, 2026
Merged

docs: update usage messages to follow Wolfram Language documentation style#21
lwJi merged 1 commit into
mainfrom
docs/update-usage-messages

Conversation

@lwJi

@lwJi lwJi commented Jan 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Update 100+ function usage messages across 8 source files to follow official Wolfram Language documentation conventions
  • Use present tense verbs ("returns", "sets", "enables") throughout
  • Multi-line format for functions with multiple signatures
  • Full descriptions for option symbols explaining their purpose and context
  • Fix incorrect descriptions (e.g., GetPrintHeaderMacro was incorrectly documented as "date" instead of "header guard macros")
  • Add missing usage message for GetUpwindCoefficients in FiniteDifferenceStencils.wl

Test plan

  • All integration tests pass (./test/run_tests.sh)
  • Golden file comparisons pass for all backends

@claude

claude Bot commented Jan 6, 2026

Copy link
Copy Markdown

Code Review: Documentation Improvements

Thank you for this thorough documentation update! This PR significantly improves the quality and consistency of the usage messages across the codebase. Here's my detailed review:

✅ Strengths

1. Excellent Adherence to Wolfram Language Conventions

  • Consistent use of present tense verbs ("returns", "sets", "enables") throughout
  • Multi-line format for functions with multiple signatures (e.g., RHSOf, SetEQN, PrintEquations)
  • Clear distinction between function behavior and option descriptions

2. Significant Quality Improvements

  • Bug Fix: Corrected GetPrintHeaderMacro description from "date" to "header guard macros" (src/Basic.wl:25)
  • Added Missing Documentation: GetUpwindCoefficients now has proper usage message (src/stencils/FiniteDifferenceStencils.wl:69)
  • Enhanced Clarity: Many descriptions now include concrete examples and context (e.g., "e.g., "[ijk]"", "e.g., UpIndexQ, DownIndexQ")

3. Improved Contextual Information

  • Option symbols now explain their purpose and relationship to parent functions
  • Multi-signature functions clearly document each variant's behavior
  • Added helpful guidance (e.g., "Use GetPVerbose[] to query the current state", "Default is "\"")

4. Strong Test Coverage

  • All integration tests passing
  • Golden file comparisons verified
  • No functional changes, purely documentation improvements

📝 Minor Suggestions

1. Consistency in Multi-line Format

Some multi-line usage messages could benefit from slightly more consistent formatting. For example:

SetComponents::usage = "SetComponents[varlist] sets component values for all tensors in varlist using default options.
SetComponents[{opts}, varlist] allows customization via ChartName, IndependentIndexForEachVar, WithoutGridPointIndex, UseTilePointIndex.";

Consider whether the option names should be in a separate line or grouped more readably, though the current format is acceptable and follows Wolfram conventions.

2. Parameter Naming Consistency

In a few places, parameter names in the usage message don't match the actual function signature:

  • SetGridPointIndex::usage uses "suffix" but the old usage message had "girdindex" (typo in original)
  • This is actually an improvement, but verify the actual parameter name in the implementation

3. Typo in Function Name (Pre-existing)

There's a typo in the function name itself: GetUseLetterForTensorComponet should be GetUseLetterForTensorComponent (note "Component" not "Componet"). This is pre-existing and not introduced by this PR, but worth noting for a future fix.

🎯 Code Quality Assessment

  • Code Quality: ⭐⭐⭐⭐⭐ Excellent
  • Best Practices: ⭐⭐⭐⭐⭐ Follows Wolfram Language documentation standards
  • Bug Fixes: ⭐⭐⭐⭐⭐ Corrects incorrect documentation
  • Test Coverage: ⭐⭐⭐⭐⭐ Comprehensive validation
  • Performance: N/A (documentation only)
  • Security: N/A (documentation only)

✅ Recommendation

APPROVE - This is a high-quality documentation improvement that:

  1. Fixes actual bugs in documentation (GetPrintHeaderMacro)
  2. Adds missing documentation (GetUpwindCoefficients)
  3. Significantly improves clarity and usability
  4. Maintains 100% backward compatibility
  5. Passes all tests

The changes make the codebase more maintainable and user-friendly. Great work on maintaining consistency across 100+ usage messages!

📚 Additional Context

The changes align well with the project's architecture as described in CLAUDE.md:

  • Properly documents the ParseMode system (multi-level mode management)
  • Clarifies the distinction between Grid/Tile/Temp tensors
  • Explains the purpose of suffix-related functions
  • Documents the component mapping and symmetry handling features

Thank you for taking the time to improve the documentation quality across the entire codebase!

…style

Update 100+ function usage messages across 8 source files to follow
official Wolfram Language documentation conventions:

- Use present tense verbs ("returns", "sets", "enables")
- Multi-line format for functions with multiple signatures
- Full descriptions for option symbols explaining their purpose
- Fix incorrect descriptions (e.g., GetPrintHeaderMacro was incorrectly
  documented as "date" instead of "header guard macros")
- Add missing usage message for GetUpwindCoefficients
- Rename TensorComponet -> TensorComponent (fix typo)

Files updated:
- src/Basic.wl (27 functions)
- src/Component.wl (15 functions)
- src/Varlist.wl (3 functions)
- src/ParseMode.wl (25 functions)
- src/Interface.wl (22 functions)
- src/Writefile.wl (4 functions)
- src/Derivation.wl (1 function)
- src/stencils/FiniteDifferenceStencils.wl (3 functions)
@lwJi
lwJi force-pushed the docs/update-usage-messages branch from cac4645 to 4f0102b Compare January 6, 2026 05:09
@claude

claude Bot commented Jan 6, 2026

Copy link
Copy Markdown

Code Review for PR #21: Documentation Style Update

This PR makes excellent improvements to documentation quality across the codebase. Here's my detailed review:

✅ Strengths

1. Consistent Documentation Style

  • Successfully standardizes all usage messages to follow Wolfram Language conventions
  • Uses present tense verbs ("returns", "sets", "enables") consistently throughout
  • Multi-line format for functions with multiple signatures is well-implemented
  • Descriptions are clear, concise, and professional

2. Improved Clarity

  • Fixed incorrect description for GetPrintHeaderMacro (was "date", now correctly "header guard macros") - great catch!
  • Added missing usage message for GetUpwindCoefficients in FiniteDifferenceStencils.wl
  • Better explanations of options and their purposes (e.g., CheckRHS, DerivsOrder, mode options)

3. Critical Bug Fix

  • Fixed typo in function name: GetUseLetterForTensorComponetGetUseLetterForTensorComponent (src/Component.wl:25-27, 100-113, 276)
  • Correctly updated internal variable $UseLetterForTensorComponet$UseLetterForTensorComponent
  • Updated all test references in ComponentTests.wl

4. Test Coverage

  • All integration tests pass
  • Golden file comparisons pass for all backends
  • Unit tests updated to reflect renamed functions

📋 Minor Observations

1. Consistency Opportunities
Some descriptions could be even more consistent in format:

  • GetOutputFile says "returns the output file name"
  • GetProject says "returns the project name used in code generation"

Consider making them structurally parallel, e.g., "returns the output file name used in code generation" OR keep them both minimal.

2. Parameter Naming
In some multi-signature usage messages, parameter names could be more descriptive:

  • SetEQN[{CheckRHS->bool, SuffixName->suffix}, var, varrhs] - good
  • SetComponents[{opts}, varlist] - could list the option names explicitly like SetEQN does

However, this is a minor style preference and the current approach is valid.

3. Option Documentation Format
The option descriptions are excellent and follow a clear pattern:

"[OptionName] is a [FunctionName] [OptionType] option that [description]"

This is very professional and matches Wolfram's documentation style.

🔍 Code Quality Assessment

  • No bugs introduced: All changes are documentation-only except for the typo fix
  • No security concerns: Pure documentation updates
  • No performance impact: No functional code changes
  • Excellent test coverage: Both unit and integration tests cover the changes

📊 Impact Analysis

Files changed: 9 files

  • 6 core modules (Basic.wl, Component.wl, Derivation.wl, Interface.wl, ParseMode.wl, Varlist.wl, Writefile.wl)
  • 1 stencil module (FiniteDifferenceStencils.wl)
  • 1 test file (ComponentTests.wl)

Net changes: +122/-120 lines (nearly neutral, just improving existing docs)

✅ Recommendation

APPROVE - This PR significantly improves code documentation quality and fixes an actual bug (typo in function name). The changes are:

  • Well-tested (integration + golden file tests pass)
  • Non-breaking (pure documentation + consistent renaming)
  • High quality (follows Wolfram Language standards)
  • Complete (covers all public API functions)

Great work on this documentation refresh! The codebase will be much more maintainable with these clearer usage messages.

@lwJi
lwJi merged commit ed65a47 into main Jan 6, 2026
2 checks passed
@lwJi
lwJi deleted the docs/update-usage-messages branch January 6, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant