[DOC]: DOE_ML: Update the keras model definition to match the supported API

Open Beginner friendly
#5,464 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #5466 by @vaidii2008 — closed without merging
  • #5612 by @pyansys-ci-bot — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python, tensorflow

Research direction

The failing line is in the DOE_ML example script, DOE_ML_Mixing_Elbow.py, which the docs page DOE_ML renders; the traceback places ModelType: TypeAlias = keras.models.Model[...] near line 377. Replace the subscripted alias with keras.Model and change keras.models.Sequential( to keras.Sequential(, then run the example against TensorFlow 2.21 to confirm it no longer raises TypeError. Done means the example runs without that error and the docs page still builds.

Written by the indexing model from the issue text.

Description

documentation
🔗 Affected page or URL

https://fluent.docs.pyansys.com/version/stable/examples/00-fluent/DOE_ML.html

⚠️ What is wrong or missing?

APIS for keras are outdated

TensorFlow version is: 2.21.0
Traceback (most recent call last):
  File "C:\Users\jdovalro\AppData\Local\Temp\flute_jdovalro\261009173539_SNPS-9pEDENLtzs\pyfluent\examples\DOE_ML_Mixing_Elbow.XoXISg\DOE_ML_Mixing_Elbow.py", line 377, in <module>
    ModelType: TypeAlias = keras.models.Model[
                           ~~~~~~~~~~~~~~~~~~^
        npt.NDArray[np.float64], npt.NDArray[np.float64]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ]
    ^
TypeError: type 'Model' is not subscriptable
✏️ Suggested improvement

Chenge this:

ModelType: TypeAlias = keras.models.Model[
    npt.NDArray[np.float64], npt.NDArray[np.float64]
]

to:
ModelType: TypeAlias = keras.Model

and:
keras.models.Sequential(

to:
keras.Sequential(

📌 Additional context

No response

Dominant language
Python
Stars
550
Forks
86
Avg merge
2d 1h
Merged PRs (30d)
58

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ansys/pyfluent

All issues in ansys/pyfluent

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.