Skip to content

Add JSON response type for AccumulationTable and RecursionTable#1362

Merged
david-yz-liu merged 2 commits into
pyta-uoft:masterfrom
a1-su:tables-json-response
Jul 3, 2026
Merged

Add JSON response type for AccumulationTable and RecursionTable#1362
david-yz-liu merged 2 commits into
pyta-uoft:masterfrom
a1-su:tables-json-response

Conversation

@a1-su

@a1-su a1-su commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

This PR adds the JSON response type format for the AccumulationTable and RecursionTable, which both previously only supported the table format and CSV format.

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality) X
🐛 Bug fix (non-breaking change that fixes an issue)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📚 Documentation update (change that only updates documentation)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • I have updated the project Changelog (this is required for all changes).
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

  • The RecursionTable does not support CSV return formats unlike the AccumulationTable, which I can add as well if needed

@coveralls

coveralls commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28639487168

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 90.931%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4058
Covered Lines: 3690
Line Coverage: 90.93%
Coverage Strength: 17.67 hits per line

💛 - Coveralls

@a1-su a1-su requested a review from david-yz-liu June 30, 2026 16:20

@david-yz-liu david-yz-liu 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.

Nice work @a1-su, I left a few inline comments, and also:

  1. Great point about the csv format for RecursionTable. I'm okay expanding the scope of this PR to also updating RecursionTable to support file output (which you've already done) and supporting the csv format. You can add a separate entry in the Changelog about these changes.
  2. In addition to creating tests for the new functionality, please also update the documentation to reflect the changes.

Comment thread packages/python-ta/CHANGELOG.md Outdated
- Update configuration options to support `.toml` files
- Updated plain text and HTML PyTA reports to not show sections with no errors and only show 'good job' message once when there are no errors in either section.
- Added `snapshots` property to `SnapshotTracer` to make captured snapshot data available through the public API.
- Added `json` response formats to `AccumulationTable` and `RecursionTable`

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.

"formats" -> "format"

Comment thread packages/python-ta/src/python_ta/debug/accumulation_table.py
self.function_name = set(function_name)
self.frames_data = {}
self._trees = {}
self.output_filepath = output

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.

Add documentation and type annotations for these instance attributes

@a1-su a1-su requested a review from david-yz-liu July 3, 2026 05:23

@david-yz-liu david-yz-liu 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.

Nice work, @a1-su!

@david-yz-liu david-yz-liu merged commit 9bddee7 into pyta-uoft:master Jul 3, 2026
30 checks passed
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