Skip to content

PR for #155 Improve Python Autofill#169

Merged
zhizhongpu merged 13 commits into
mainfrom
155-improve-python-autofill
Jun 26, 2026
Merged

PR for #155 Improve Python Autofill#169
zhizhongpu merged 13 commits into
mainfrom
155-improve-python-autofill

Conversation

@zhizhongpu

@zhizhongpu zhizhongpu commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

@zhizhongpu zhizhongpu requested a review from jmshapir June 11, 2026 17:04
@zhizhongpu zhizhongpu linked an issue Jun 11, 2026 that may be closed by this pull request
@zhizhongpu zhizhongpu requested a review from liaochris June 11, 2026 17:04

@jmshapir jmshapir 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.

In addition to minor housekeeping points, noting that I think (?) another change here is that autofill_formats used to to allow a list but now using a list of formats requires iterative calls. (That seems cleaner anyway but just flagging as a note.)

Comment thread source/lib/JMSLab/tests/test_autofill.py
Comment thread source/lib/JMSLab/autofill.py Outdated
typechecker fails without it
inspect.currentframe() is typed as returning FrameType | None — it can theoretically return None in implementations that don't support stack frames (e.g., some embedded Python runtimes). So ty complains that you're calling .f_back on something that could be None.

In practice, CPython always returns a frame, so this will never actually be None in normal usage.

This is just a quick suppress.
@zhizhongpu zhizhongpu self-assigned this Jun 12, 2026
@zhizhongpu

zhizhongpu commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

thanks @jmshapir. I just noticed the below

noting that I think (?) another change here is that autofill_formats used to to allow a list but now using a list of formats requires iterative calls.

which is a good point. In d862d55 I have additionally allowed specifying a list of formats when autofilling multiple macros in one go.

@jmshapir

Copy link
Copy Markdown
Contributor

@zhizhongpu thanks. That sounds reasonable. I also think it could be reasonable to ask the user to iterate over autofill calls (rather than to have autofill do the iteration internally), so defer to whichever architecture you prefer.

Comment thread source/lib/JMSLab/autofill.py Outdated
Comment thread source/lib/JMSLab/autofill.py Outdated
Comment thread source/lib/JMSLab/autofill.py Outdated
Comment thread source/analysis/top_gdp/topgdp_value.py
Comment thread source/lib/JMSLab/autofill.py
Comment thread source/lib/JMSLab/tests/test_autofill.py Outdated
Comment thread source/lib/JMSLab/tests/test_autofill.py Outdated
Comment thread source/lib/JMSLab/tests/test_autofill.py Outdated
Comment thread source/lib/JMSLab/tests/test_autofill.py
@zhizhongpu

Copy link
Copy Markdown
Collaborator Author

@liaochris I completely rewrote the tests and it's ready for your review.

@zhizhongpu

Copy link
Copy Markdown
Collaborator Author

/run-actions-all --post

@github-actions

Copy link
Copy Markdown

Triggered by @zhizhongpu on this comment

Check Results (run details)

Check Result Time
SCons DAG 0.037s
Newlines 0.043s
EPS data 0.026s
Log failures 0.030s

@zhizhongpu zhizhongpu merged commit 0227630 into main Jun 26, 2026
18 checks passed
@zhizhongpu zhizhongpu deleted the 155-improve-python-autofill branch June 26, 2026 20:46
@github-actions

Copy link
Copy Markdown

@zhizhongpu Issue summary

Thanks for closing this pull.

Before leaving the pull, please be sure you have completed all the required steps in the workflow.

This includes filling in the issue summary linked at the top of this comment.

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.

Improve Python Autofill

3 participants