Skip to content
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

Feat/gui mode #430

Merged
merged 16 commits into from
May 30, 2022
Merged

Feat/gui mode #430

merged 16 commits into from
May 30, 2022

Conversation

seanpearsonuk
Copy link
Collaborator

@seanpearsonuk seanpearsonuk commented May 24, 2022

Allow Fluent GUI to be shown via show_gui argument to launch_fluent.

Tested interactively with PYFLUENT_SHOW_SERVER_GUI unset and set to 0 and 1:

>>> import ansys.fluent.core as f
>>> s = f.launch_fluent(show_gui=False)
>>>
>>> s = f.launch_fluent()
>>>
>>> s = f.launch_fluent(show_gui=True)
>>>
>>> quit()

@@ -127,6 +127,7 @@ def launch_fluent(
ip: str = None,
port: int = None,
cleanup_on_exit: bool = True,
show_gui: Optional[bool] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this one as Optional, while many other arguments are also optional?
the other arguments have their optional state being the "None" value

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I noticed the same in fact, but this is a quite normal approach. In 3.10, you can write bool | None for Optional[bool].

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suppose Patrick is implying that you could decorate the other ones while you are at it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I suppose Patrick is implying that you could decorate the other ones while you are at it?

Yeah, I know. I considered all that, but where do you stop?

Copy link
Contributor

Choose a reason for hiding this comment

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

its simply that having a single one like this might cause more confusion ( i.e. "the others are not optional?" )
so maybe all or nothing, or put in note of a future task

Copy link
Collaborator

@dnwillia-work dnwillia-work May 24, 2022

Choose a reason for hiding this comment

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

I think in this particular use case you should decorate all of them for the entire function. You are right though, it's hard to decide where to stop. You could not bother adding the decorator at all and come back to it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I've removed it for now. Maybe the code is more obvious as it stands anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

The typing is mainly for IDEs, and so it may be better to have this accurate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The typing is mainly for IDEs, and so it may be better to have this accurate.

In this PR, I've ended up simply aligning with what's there. I think it's good that any changes are as small as possible right now.

@dnwillia-work dnwillia-work linked an issue May 25, 2022 that may be closed by this pull request
@@ -200,7 +210,9 @@ def launch_fluent(
launch_string += f" {additional_arguments}"
launch_string += f' -sifile="{server_info_filepath}"'
launch_string += " -nm"
if not os.getenv("PYFLUENT_SHOW_SERVER_GUI"):
if (show_gui == False) or (
show_gui == None and (os.getenv("PYFLUENT_SHOW_SERVER_GUI") != "1")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
show_gui is None

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, have updated (also for boolean)

seanpearsonuk and others added 3 commits May 25, 2022 08:25
* Adding settings based api example, and other changes

* Titles fix

* Fixing convergance issue. Removing pandas.

* Fixing typo

* Adding exit commands, thubnail image

* Style check fix
@mkundu1 mkundu1 requested review from mkundu1 May 30, 2022 08:52
@seanpearsonuk seanpearsonuk merged commit 7b2cfc7 into main May 30, 2022
@seanpearsonuk seanpearsonuk deleted the feat/gui_mode branch May 30, 2022 09:45
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.

launch_fluent option to launch Fluent in interactive (GUI) mode
7 participants