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/dm new api prints #3528

Draft
wants to merge 44 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9094823
enable API upgrades
seanpearsonuk Sep 2, 2024
f35825c
test data model api integration
seanpearsonuk Sep 3, 2024
459747b
test data model api integration
seanpearsonuk Sep 3, 2024
dfd6a64
disabled version of test
seanpearsonuk Sep 4, 2024
3497636
disabled version of test
seanpearsonuk Sep 4, 2024
5ba3d97
on_changed working for enahnced mwf with new service
seanpearsonuk Sep 4, 2024
1a18f3b
new test added
seanpearsonuk Sep 4, 2024
f2cf445
on_changed working for enahnced mwf with new service - tests skipped
seanpearsonuk Sep 4, 2024
2400649
extend test
seanpearsonuk Sep 4, 2024
e223530
fix test
seanpearsonuk Sep 6, 2024
56f477f
testUpdates
seanpearsonuk Sep 11, 2024
cd5f9b8
testskipping
seanpearsonuk Sep 11, 2024
c983180
update test after server-side fix
seanpearsonuk Sep 12, 2024
0359f63
no skip
seanpearsonuk Sep 26, 2024
e067b37
prints
seanpearsonuk Oct 28, 2024
0492f7a
rm unwanted line
seanpearsonuk Nov 27, 2024
9ad6570
build: Bump version v0.28.dev0 (#3518)
prmukherj Nov 27, 2024
f897dc4
ci: Running Fluent tests in parallel (#3524)
mkundu1 Nov 27, 2024
5a1c077
feat: Classes for event info (#3531)
mkundu1 Nov 28, 2024
b556f1e
docs: event streaming callback (#3546)
mkundu1 Dec 3, 2024
89f91ac
fix: missing EOF line on CONTRIBUTORS.md (#3543)
RobPasMue Dec 3, 2024
2e41f58
feat: cleanup old codegen related code (#3545)
mkundu1 Dec 3, 2024
7cdc653
additional env var
seanpearsonuk Dec 10, 2024
737bb65
docs: Update API reference and cheat sheet (#3564)
hpohekar Dec 12, 2024
887210b
test: Add tests for new datamodel API (#3567)
mkundu1 Dec 16, 2024
ba1ff61
feat: Move the direct settings classes under ansys.fluent.core.solver…
mkundu1 Dec 16, 2024
ed2bae8
enable API upgrades
seanpearsonuk Sep 2, 2024
02bf838
test data model api integration
seanpearsonuk Sep 3, 2024
0593167
test data model api integration
seanpearsonuk Sep 3, 2024
09257e3
disabled version of test
seanpearsonuk Sep 4, 2024
73ee400
disabled version of test
seanpearsonuk Sep 4, 2024
b6d00dd
on_changed working for enahnced mwf with new service
seanpearsonuk Sep 4, 2024
ae58bbd
new test added
seanpearsonuk Sep 4, 2024
993c4be
on_changed working for enahnced mwf with new service - tests skipped
seanpearsonuk Sep 4, 2024
67ae20b
extend test
seanpearsonuk Sep 4, 2024
f38275a
fix test
seanpearsonuk Sep 6, 2024
da80e43
testUpdates
seanpearsonuk Sep 11, 2024
ebc06e2
testskipping
seanpearsonuk Sep 11, 2024
91ffb92
update test after server-side fix
seanpearsonuk Sep 12, 2024
b1a6ef5
no skip
seanpearsonuk Sep 26, 2024
b1eda04
prints
seanpearsonuk Oct 28, 2024
b99e8e7
rm unwanted line
seanpearsonuk Nov 27, 2024
8646dde
additional env var
seanpearsonuk Dec 10, 2024
7b33b81
Merge branch 'feat/dm-new-api-prints' of https://github.com/ansys/pyf…
seanpearsonuk Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 41 additions & 18 deletions .ci/fluent_test_runner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Script to run Fluent test in Docker container."""

import argparse
import concurrent.futures
import logging
import os
from pathlib import Path
Expand All @@ -21,10 +22,10 @@ class FluentRuntimeError(RuntimeError):
pass


def run_fluent_test(
src_test_dir: Path, journal_file: Path, launcher_args: str = ""
def _run_single_test(
src_test_dir: Path, journal_file: Path, launcher_args: str
) -> None:
"""Run Fluent test.
"""Run a single Fluent test.

Parameters
----------
Expand Down Expand Up @@ -103,13 +104,29 @@ def run_fluent_test(
sleep(1)
logging.debug(container.logs(stderr=True).decode())
container.remove()
except docker.errors.NotFound:
except docker.errors.DockerException:
pass


MAX_TEST_PATH_LENGTH = 100


def _run_single_test_with_status_print(
src_test_dir: Path, journal_file: Path, launcher_args: str, test_file_relpath: str
) -> bool:
try:
_run_single_test(src_test_dir, journal_file, launcher_args)
print(
f"{test_file_relpath}{(MAX_TEST_PATH_LENGTH + 10 - len(test_file_relpath)) * '·'}PASSED"
)
except FluentRuntimeError as e:
print(
f"{test_file_relpath}{(MAX_TEST_PATH_LENGTH + 10 - len(test_file_relpath)) * '·'}FAILED"
)
print(e)
return True


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Run Fluent test.")
parser.add_argument(
Expand All @@ -120,7 +137,8 @@ def run_fluent_test(
test_dir = Path.cwd() / args.test_dir
with TemporaryDirectory(ignore_cleanup_errors=True) as src_test_dir:
copytree(test_dir, src_test_dir, dirs_exist_ok=True)
exception_occurred = False
statuses = []
arguments = []
src_test_dir = Path(src_test_dir)
for test_file in (src_test_dir / "fluent").rglob("*.py"):
config_file = test_file.with_suffix(".yaml")
Expand All @@ -129,17 +147,22 @@ def run_fluent_test(
configs = yaml.safe_load(config_file.read_text())
launcher_args = configs.get("launcher_args", "")
test_file_relpath = str(test_file.relative_to(src_test_dir))
print(f"Running {test_file_relpath}", end="", flush=True)
try:
run_fluent_test(src_test_dir, test_file, launcher_args)
print(
f"{(MAX_TEST_PATH_LENGTH + 10 - len(test_file_relpath)) * '·'}PASSED"
)
except FluentRuntimeError as e:
print(
f"{(MAX_TEST_PATH_LENGTH + 10 - len(test_file_relpath)) * '·'}FAILED"
)
print(e)
exception_occurred = True
if exception_occurred:
arguments.append(
(src_test_dir, test_file, launcher_args, test_file_relpath)
)
max_workers = int(os.getenv("MAX_WORKERS_FLUENT_TESTS", 4))
if max_workers > 1:
with concurrent.futures.ThreadPoolExecutor(
max_workers=max_workers
) as executor:
futures = [
executor.submit(_run_single_test_with_status_print, *args)
for args in arguments
]
for future in concurrent.futures.as_completed(futures):
statuses.append(future.result())
else:
for args in arguments:
statuses.append(_run_single_test_with_status_print(*args))
if any(statuses):
exit(1)
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,16 @@ jobs:

- name: Install Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
tinytex: true


- name: Check Quarto Version
shell: bash
run: |
quarto --version

- name: Verify tinytex is installed
run: |
quarto install tinytex --no-prompt --update-path

- name: "Install Poppler for PDF to PNG conversion"
shell: bash
run: |
Expand Down Expand Up @@ -197,6 +199,7 @@ jobs:
make build-doc-source
env:
FLUENT_IMAGE_TAG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}
PYFLUENT_DOC_SKIP_CHEATSHEET: 1

- name: Zip HTML Documentation before upload
run: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test-fluent-journals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,9 @@ jobs:
- name: Run Fluent tests
run: |
make write-and-run-fluent-tests
env:
MAX_WORKERS_FLUENT_TESTS: 1

- name: Cleanup previous docker containers
if: always()
run: make cleanup-previous-docker-containers
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
* [Harshal Pohekar](https://github.com/hpohekar)
* [Mainak Kundu](https://github.com/mkundu1)
* [Prithwish Mukherjee](https://github.com/prmukherj)
* [Raphael Luciano](https://github.com/raph-luc)
* [Raphael Luciano](https://github.com/raph-luc)
8 changes: 4 additions & 4 deletions doc/api_rstgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def _generate_api_source_rst_files(folder: str, files: list):
f".. automodule:: ansys.fluent.core.{folder}.{file}\n"
)
else:
rst.write(f"ansys.fluent.core.{file}\n")
rst.write(f'{"="*(len(f"ansys.fluent.core.{file}"))}\n\n')
rst.write(f"{file}\n")
rst.write(f'{"="*(len(f"{file}"))}\n\n')
rst.write(f".. automodule:: ansys.fluent.core.{file}\n")
if "root" not in file:
_write_common_rst_members(rst_file=rst)
Expand All @@ -191,8 +191,8 @@ def _generate_api_index_rst_files():
file = _get_file_path(folder, "index")
with open(file, "w", encoding="utf8") as index:
index.write(f".. _ref_{folder}:\n\n")
index.write(f"ansys.fluent.core.{folder}\n")
index.write(f'{"="*(len(f"ansys.fluent.core.{folder}"))}\n\n')
index.write(f"{folder}\n")
index.write(f'{"="*(len(f"{folder}"))}\n\n')
index.write(f".. automodule:: ansys.fluent.core.{folder}\n")
_write_common_rst_members(rst_file=index)
index.write(".. toctree::\n")
Expand Down
1 change: 1 addition & 0 deletions doc/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ full guidelines on their use.
.. toctree::
:maxdepth: 2
:hidden:
:caption: ansys.fluent.core

filereader/index
launcher/index
Expand Down
Loading
Loading