-
Notifications
You must be signed in to change notification settings - Fork 56
BatchOps tests and doc #1488
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
Merged
Merged
BatchOps tests and doc #1488
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1d1417c
Unittests for batch-ops
mkundu1 f9da035
Doc for batch-ops
mkundu1 e1e2d64
Fix a doc formatting in workflow.py
mkundu1 e909b57
PR suggestion
mkundu1 80b3fed
Fix a doc formatting in workflow.py
mkundu1 00d213a
Disable unittests in linux
mkundu1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,44 @@ | ||
| import sys | ||
|
|
||
| import pytest | ||
| from util.solver_workflow import new_solver_session # noqa: F401 | ||
|
|
||
| from ansys.api.fluent.v0 import batch_ops_pb2 | ||
| import ansys.fluent.core as pyfluent | ||
| from ansys.fluent.core import examples | ||
|
|
||
|
|
||
| @pytest.mark.dev | ||
| @pytest.mark.fluent_232 | ||
| @pytest.mark.skip("Failing in github") | ||
| def test_batch_ops(new_solver_session): | ||
| import_filename = examples.download_file( | ||
| @pytest.mark.skipif( | ||
| sys.platform.startswith("linux"), reason="Linux specific issue in server" | ||
mkundu1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
| def test_batch_ops_create_mesh(new_solver_session): | ||
| solver = new_solver_session | ||
| case_filename = examples.download_file( | ||
| "mixing_elbow.cas.h5", "pyfluent/mixing_elbow" | ||
| ) | ||
| with pyfluent.BatchOps(new_solver_session): | ||
| assert len(pyfluent.BatchOps.instance()._ops) == 0 | ||
| new_solver_session.tui.file.read_case(import_filename) | ||
| new_solver_session.setup.models.energy.enabled = False | ||
| assert len(pyfluent.BatchOps.instance()._ops) == 2 | ||
| assert all( | ||
| op._status == batch_ops_pb2.STATUS_SUCCESSFUL | ||
| for op in pyfluent.BatchOps.instance()._ops | ||
| with pyfluent.BatchOps(solver): | ||
| solver.file.read_case(file_name=case_filename) | ||
| solver.results.graphics.mesh["mesh-1"] = {} | ||
| assert not solver.scheme_eval.scheme_eval("(case-valid?)") | ||
| assert "mesh-1" not in solver.results.graphics.mesh.get_object_names() | ||
| assert solver.scheme_eval.scheme_eval("(case-valid?)") | ||
| assert "mesh-1" in solver.results.graphics.mesh.get_object_names() | ||
|
|
||
|
|
||
| @pytest.mark.dev | ||
| @pytest.mark.fluent_232 | ||
| @pytest.mark.skipif( | ||
| sys.platform.startswith("linux"), reason="Linux specific issue in server" | ||
| ) | ||
| def test_batch_ops_create_mesh_and_access_fails(new_solver_session): | ||
| solver = new_solver_session | ||
| case_filename = examples.download_file( | ||
| "mixing_elbow.cas.h5", "pyfluent/mixing_elbow" | ||
| ) | ||
| with pytest.raises(KeyError): | ||
| with pyfluent.BatchOps(solver): | ||
| solver.file.read_case(file_name=case_filename) | ||
| solver.results.graphics.mesh["mesh-1"] = {} | ||
| solver.results.graphics.mesh["mesh-1"].surfaces_list = ["wall-elbow"] | ||
| assert not solver.scheme_eval.scheme_eval("(case-valid?)") | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.