Skip to content

Deprecation warnings for all variables since v.1.0 - #1299

Draft
xjjiang wants to merge 6 commits into
OpenMDAO:mainfrom
xjjiang:Variable_deprecation
Draft

xjjiang wants to merge 6 commits into
OpenMDAO:mainfrom
xjjiang:Variable_deprecation

Conversation

@xjjiang

@xjjiang xjjiang commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR targeted Issue #1289. I am sure this is not the final version but maybe a good point to start.

Related Issues

Backwards incompatibilities

None

AI Usage

None

@jkirk5

jkirk5 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

I had some ideas on how to use the check on the original issue (#1289) - it is kind of similar to your idea but a little different

deprecated_vars = []
renamed_vars = []
deprecated_variables_file = get_path('utils/deprecated_variables.csv')
with open(deprecated_variables_file, newline='') as f:

@Kenneth-T-Moore Kenneth-T-Moore Sep 15, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am glad that you did this!

Might be easier if you just stored the deprecated var information in a dictionary keyed by the strings in the first column (old varnames).

{ "aircraft:design:thrust_takeoff_per_eng" : (removed, '#1142','1.0.0'), ...

Then you don't have to read a file, and the logic for checking it becomes

if var_name in deprecated_vars:
    raise error and give new name and info
else:
    raise warning that the name wasn't found.

@Kenneth-T-Moore

Copy link
Copy Markdown
Member

Here is a little migration guide I made that might help catch some more variables. I closed my PR since it is stale, and your solution is a better approach.

#1125

This branch has not been deployed

No deployments
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.

Add deprecation warnings for all variable hierarchy name changes since 1.0.

3 participants