Skip to content

[fix] Fix table dimension-calculating process and tests - #621

Merged
Schiano-NOAA merged 1 commit into
mainfrom
fix-tbl-dims
Nov 16, 2026
Merged

Schiano-NOAA merged 1 commit into
mainfrom
fix-tbl-dims

Conversation

@sbreitbart-NOAA

Copy link
Copy Markdown
Collaborator

What is the feature?

  • Fix table dimension-calculating process and tests

How have you implemented the solution?

  • Correctly calling table dimensions

Does the PR impact any other area of the project, maybe another repo?

  • It fixes issues identified in Day 3 of the workshop re: the landings table

@github-actions

Copy link
Copy Markdown
Contributor

Code Metrics Report

Coverage Code to Test Ratio Test Execution Time
52.7% 1:0.4 31s

Code coverage of files in pull request scope (55.6%, patch 75.0%)

Files Coverage Patch Coverage
R/ID_tbl_length_class.R 93.7% 100.0%
R/ID_tbl_width_class.R 89.4% 100.0%
R/create_tables_doc.R 52.8% 50.0%

Reported by octocov

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The width calculation counts hidden columns, which can misclassify portrait-sized tables as extra-wide and cause unnecessary splitting in the generated document.

1 open issue
What changed in this PR

This PR corrects table dimension calculations in asar’s document-generation workflow, addressing the landings-table issues reported during the workshop.

Changes:

  • Calculate table width and length from the gt object’s underlying data.
  • Use row counts when determining how many table sections to generate.
  • Update dimension-test fixtures to retain complete gt objects.
File Description
tests/​testthat/​test-ID_tbl_width_class.R Use complete gt objects in width-test fixtures.
tests/​testthat/​test-ID_tbl_length_class.R Use complete gt objects in length-test fixtures.
R/​ID_tbl_width_class.R Calculate width from underlying data columns.
R/​ID_tbl_length_class.R Calculate length from underlying data rows.
R/​create_tables_doc.R Use underlying row counts for table splitting.

Review effort: Balanced

Comment thread R/ID_tbl_width_class.R Resolved

@Schiano-NOAA Schiano-NOAA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Schiano-NOAA
Schiano-NOAA merged commit d51f651 into main Nov 16, 2026
10 of 11 checks passed
@Schiano-NOAA
Schiano-NOAA deleted the fix-tbl-dims branch November 16, 2026 22:36
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.

3 participants