-
Notifications
You must be signed in to change notification settings - Fork 56
Replace setattr with codegen for better intellisense #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a404ad9
to
fa2b8fd
Compare
doc/source/api/core/solver/tui.rst
Outdated
tui.views | ||
tui.parametric_study | ||
tui.turbo_workflow | ||
tui.main_menu.adjoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little bit confused as to why you would call them main_menu
when the user documentation is referring to them as commands:
Would commands
be better then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm following the terminology in scheme source code. The helpstrings within the source code are also calling file
, define
etc. as menus. These source code helpstrings are exposed in PyFluent. The documentation helpstrings are generated outside of Fluent source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see. My concern then would be that this is not the customer visible terminology. If I click on the link you provided it's an internal Ansys link but the link I shared is the user documentation that all customers can see. I don't mind which direction this goes but both need to be consistent I think.
I understand the help strings come from Fluent currently, I'll pass you the content that Stephen provided. We should look at a way to get this published here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will accommodate the user doc help-content in the current PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the helpstrings from the XML file.
The doc build is currently failing with the following error message:
@smf2001 @dnwillia-work Any idea whether the doc side changes are incompatible with the current python code changes? The tui.py files now contain a top-level class |
TUIGenerator(meshing=True).generate() | ||
TUIGenerator(meshing=False).generate() | ||
LOG.warning( | ||
"XML help is available but not picked for the following %i paths:", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the missing menus here are dynamically generated menus which cannot be captured in static queries during codegen (relevant bug #90).
k = node.find("h3").text | ||
k = k.strip().strip("/") | ||
path = k.split("/") | ||
path = [c.rstrip("?").replace("-", "_") for c in path] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to item 1 of #38, original Fluent TUI paths aren't available across the API. The Fluent strings are converted before sending through the API. The above code will do similar conversion for the XML strings (which are exact Fluent strings), but few cases are missed (e.g. Fluent string 1D_coupling
is converted to one_D_coupling
during the API call, which is not converted in the above code). In a separate PR, I'll enhance the above code to match with the Fluent side conversion logic (we need to bring that logic in client side to fix #38).
In vscode:
Similar auto-completion list also appears in spyder. But it is very slow, I was not able to capture a screenshot.