Skip to content

Conversation

@sunt05
Copy link

@sunt05 sunt05 commented Aug 6, 2025

Summary

This PR builds upon PR #581 (which fixes issue #566) and additionally simplifies the suews-convert command interface while resolving all remaining issues preventing YAML conversion from working properly.

Relationship to PR #581

Changes (beyond PR #581)

1. Simplified Command Interface

  • Removed redundant yaml option since 2025+ only supports YAML format
  • Automatically determine conversion type based on target version:
    • Pre-2025 (e.g., 2024a): Table-to-table conversion
    • 2025+ (e.g., 2025a): Convert to YAML format
  • No subcommands needed - single unified interface

2. Fixed Additional YAML Conversion Issues

  • Fixed empty DataFrame handling when STEBBS is disabled (prevented column name mismatch)
  • Added graceful handling of missing columns in legacy format conversion (lambda_c, etc.)
  • Fixed water surface soilstore validation - water surfaces can now have soilstore=0 (physically correct)
  • Provided default values for missing config/description columns in legacy conversion

3. Updated Documentation

  • Updated existing documentation to reflect the simplified interface
  • Consolidated converter documentation in input_converter.rst (removed duplicate)
  • Updated transition_guide.rst with new command syntax
  • Removed references to supy-to-yaml and subcommands
  • Added clear examples for both conversion types

4. Updated Tests

  • Modified test suite to work with new unified interface
  • Added tests for both table and YAML conversion
  • Moved legacy format files to test fixtures

Usage Examples

# Table-to-table conversion (pre-2025)
suews-convert -f 2020a -t 2024a -i input_dir -o output_dir

# Table-to-YAML conversion (2025+)
suews-convert -f 2024a -t 2025a -i input_dir -o config.yml

Testing

  • All conversion logic has been tested with legacy format fixtures
  • Tests pass for both table-to-table and table-to-YAML conversions
  • Documentation has been reviewed for consistency and duplicates removed

Builds on #581, fixes #566

- Remove redundant 'yaml' option since 2025+ only supports YAML
- Automatically determine conversion type based on target version:
  - Pre-2025: table-to-table conversion
  - 2025+: convert to YAML format
- Fix all conversion issues preventing supy-to-yaml from working:
  - Handle empty DataFrame when STEBBS disabled
  - Add graceful handling of missing columns in legacy format
  - Fix water surface soilstore validation (allow 0 for water)
  - Provide defaults for missing config/description columns
- Update all documentation to reflect simplified interface
- Update tests to match new command structure

Fixes #581
@github-actions
Copy link

github-actions bot commented Aug 6, 2025

🤖 I've automatically formatted the code in this PR using:

  • Python: ruff v0.8.6
  • Fortran: fprettify v0.3.7

Please pull the latest changes before making further edits.

github-actions bot and others added 2 commits August 6, 2025 11:42
Co-authored-by: sunt05 <1802656+sunt05@users.noreply.github.com>
- Remove duplicate suews_convert_guide.rst
- Update existing input_converter.rst with YAML conversion info
- Consolidate all converter documentation in one place
@sunt05 sunt05 changed the base branch from master to fix/566-to-yaml-module August 6, 2025 11:49
@sunt05 sunt05 changed the title Fix #581: Simplify suews-convert interface and fix YAML conversion Simplify suews-convert interface and fix remaining YAML conversion issues (builds on #581) Aug 6, 2025
sunt05 and others added 3 commits August 6, 2025 13:48
- Replace deprecated delim_whitespace=True with sep=r'\s+'
- Replace invalid quotechar=' ' with quoting=3 (QUOTE_NONE)
- Fixes CI failures on Python 3.13 Linux builds
Co-authored-by: sunt05 <1802656+sunt05@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Aug 6, 2025

🤖 I've automatically formatted the code in this PR using:

  • Python: ruff v0.8.6
  • Fortran: fprettify v0.3.7

Please pull the latest changes before making further edits.

@sunt05 sunt05 merged commit 35a7e66 into fix/566-to-yaml-module Aug 6, 2025
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