Skip to content

Conversation

Gobot1234
Copy link
Collaborator

Definitely needs testing cause it was a big find and replace job

Comment on lines 1 to 7
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-visualization",
# "matplotlib",
# ]
# ///
Copy link
Collaborator

Choose a reason for hiding this comment

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

As per the discussion we think that the dependencies are not versioned which is also problematic. I think we should remove this change from all example scripts.

cc: @seanpearsonuk @mkundu1 @prmukherj

Copy link
Collaborator

@seanpearsonuk seanpearsonuk Oct 6, 2025

Choose a reason for hiding this comment

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

@hpohekar It looks like this is fairly common practice. I think that the pyfluent dependency should be given as ansys-fluent-core though.

@Gobot1234

Copy link
Collaborator

Choose a reason for hiding this comment

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

@seanpearsonuk @Gobot1234

We can specify the dependencies required to run all examples in a section of pyproject.toml as follows:

[project.optional-dependencies]
doc = [
...
]
tests = [
...
]
additional = [
...
]
examples = [
...
]

We can install them as follows:

pip install ansys-fluent-core[examples]

This will remove duplicate boilerplate from all example scripts and helpful from the maintenance point of view.

We can add an instruction in docs to execute pip install ansys-fluent-core[examples] before running any example scripts locally.

cc: @mkundu1

Copy link
Collaborator

Choose a reason for hiding this comment

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

@hpohekar

I believe @Gobot1234’s intent is to consider the real-world user experience: someone who already has PyFluent installed, comes across this script in isolation, and simply wants to know what additional packages are required to run it successfully.

If this script were circulating outside the repository, having the dependency list inside the script itself would be helpful and self-explanatory.

The question then is: at what point does it stop being useful to include that information? If we remove it purely because the script is now “in the repo,” we risk making it less accessible when encountered independently.

I’d argue that keeping lightweight dependency metadata in examples is a net positive for usability unless we have a stronger alternative convention.

Copy link
Collaborator

@hpohekar hpohekar Oct 7, 2025

Choose a reason for hiding this comment

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

@seanpearsonuk

Yes, it makes sense, considering the points of circulating script outside the repository and its independent accessibility.

I have also verified that Sphinx recognizes this format and does not render it in the generated examples gallery.

cc: @Gobot1234

Comment on lines 560 to 566
###############################################################################
# Confirm and update boundaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Confirm and update the boundaries.

meshing_session.workflow.TaskObject["Update Boundaries"].Execute()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
###############################################################################
# Confirm and update boundaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Confirm and update the boundaries.
meshing_session.workflow.TaskObject["Update Boundaries"].Execute()

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Confirm and update the boundaries.

meshing_session.workflow.TaskObject["Update Boundaries"].Execute()
Copy link
Collaborator Author

@Gobot1234 Gobot1234 Oct 6, 2025

Choose a reason for hiding this comment

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

This looked sus (moving the code around)

Suggested change
meshing_session.workflow.TaskObject["Update Boundaries"].Execute()
###############################################################################
# Confirm and update boundaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Confirm and update the boundaries.
meshing_session.workflow.TaskObject["Update Boundaries"].Execute()

Comment on lines +637 to +638
<solver_session>.file.ead (Command)
<solver_session>.file.mport_.read (Command)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
<solver_session>.file.ead (Command)
<solver_session>.file.mport_.read (Command)
<solver_session>.file.read (Command)
<solver_session>.file.import_.read (Command)

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍


pyfluent.config.print_search_results = False
results = pyfluent.search("local*", api_path="<solver_session>.setup")
results = pyfluent.search("local*", api_path="<solver_session>.setup.")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
results = pyfluent.search("local*", api_path="<solver_session>.setup.")
results = pyfluent.search("local*", api_path="<solver_session>.setup")

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

# Import the CAD geometry file (``exhaust_system.fmd``) and selectively manage some
# parts.

meshing_session.upload(import_file_name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

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