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

fix: pyflakes style #1953

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
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
Prev Previous commit
fix: various rule violations
moe-ad committed Jan 3, 2025
commit 6f89fce4b4bb18b89cdeb839b0a2705c556b5925
2 changes: 0 additions & 2 deletions .ci/code_generation.py
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@

from ansys.dpf import core
from ansys.dpf.core.operators import build
import os
import glob
from pathlib import Path
import shutil

1 change: 0 additions & 1 deletion .ci/run_examples.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import glob
from pathlib import Path
import subprocess
import sys
1 change: 0 additions & 1 deletion .ci/run_non_regression_examples.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import glob
from ansys.dpf import core
import pathlib
import subprocess
1 change: 0 additions & 1 deletion .ci/update_dpf_dependencies.py
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@
"""

import os
import glob
from pathlib import Path
import platform
import shutil
1 change: 0 additions & 1 deletion src/ansys/dpf/core/misc.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@
"""Miscellaneous functions for the DPF module."""

import platform
import glob
import os
import re
from pathlib import Path
2 changes: 0 additions & 2 deletions src/ansys/dpf/core/path_utilities.py
Original file line number Diff line number Diff line change
@@ -27,8 +27,6 @@
server into account to create path.
"""

import os

import ansys.dpf.core.server_types
from ansys.dpf.core import server as server_module
from pathlib import Path
1 change: 0 additions & 1 deletion src/ansys/dpf/core/plotter.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@
from __future__ import annotations

import tempfile
import os
import sys
import numpy as np
import warnings
2 changes: 1 addition & 1 deletion src/ansys/dpf/core/server_types.py
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@
ANSYS_INSTALL = Path(core.misc.get_ansys_path(ansys_path))
api_path = load_api._get_path_in_install()
if api_path is None:
raise ImportError(f"Could not find API path in install.")
raise ImportError("Could not find API path in install.")

Check warning on line 75 in src/ansys/dpf/core/server_types.py

Codecov / codecov/patch

src/ansys/dpf/core/server_types.py#L75

Added line #L75 was not covered by tests
SUB_FOLDERS = ANSYS_INSTALL / api_path
if ISPOSIX:
name = "lib" + name
2 changes: 2 additions & 0 deletions src/ansys/dpf/core/workflow_topology/__init__.py
Original file line number Diff line number Diff line change
@@ -25,3 +25,5 @@
from .operator_connection import OperatorConnection
from .data_connection import DataConnection
from .exposed_pin import ExposedPin

__all__ = [WorkflowTopology, OperatorConnection, DataConnection, ExposedPin]
1 change: 0 additions & 1 deletion tests/test_animation.py
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import os
from pathlib import Path

import pytest
1 change: 0 additions & 1 deletion tests/test_animator.py
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import os
from pathlib import Path

import pytest
1 change: 0 additions & 1 deletion tests/test_codegeneration.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@
# SOFTWARE.

# -*- coding: utf-8 -*-
import os
import copy
import tempfile
from pathlib import Path
1 change: 0 additions & 1 deletion tests/test_data_tree.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@
# SOFTWARE.

from ansys.dpf import core as dpf
import os
import pytest
import conftest
from pathlib import Path
2 changes: 1 addition & 1 deletion tests/test_plugins.py
Original file line number Diff line number Diff line change
@@ -125,7 +125,7 @@ def test_vtk(server_type, tmpdir):
op.inputs.fields1.connect(u)
op.inputs.mesh.connect(model.metadata.mesh_provider)
op.inputs.directory.connect(str(Path(rst_file).parent))
out_path = op.eval()
# out_path = op.eval()
# assert out_path.result_files is not []
# try:
# out_path = dpf.core.download_file(
1 change: 0 additions & 1 deletion tests/test_python_plugins.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@
# SOFTWARE.

import pytest
import os
from pathlib import Path
import platform
import numpy as np
2 changes: 1 addition & 1 deletion tests/test_service.py
Original file line number Diff line number Diff line change
@@ -172,7 +172,7 @@ def test_downloadinfolder_uploadinfolder(multishells, tmpdir, server_type_remote
# download it
new_tmpdir = tmpdir / "my_tmp_dir"
new_tmpdir.mkdir()
out = dpf.core.download_files_in_folder(
_ = dpf.core.download_files_in_folder(
TARGET_PATH, str(new_tmpdir), server=server_type_remote_process
)
# check if the architecture of the download is ok

Unchanged files with check annotations Beta

if isinstance(output_type, types):
try:
return types_enum_to_types()[output_type]
except KeyError:

Check warning on line 1013 in src/ansys/dpf/core/dpf_operator.py

Codecov / codecov/patch

src/ansys/dpf/core/dpf_operator.py#L1013

Added line #L1013 was not covered by tests
raise TypeError(f"{output_type} is not an implemented Operator's output")
return output_type
"""Print Points information."""
txt = "DPF Points object:\n"
txt += f"Number of points: {self.n_points}\n"
txt += "Coordinates:\n"

Check warning on line 95 in src/ansys/dpf/core/geometry.py

Codecov / codecov/patch

src/ansys/dpf/core/geometry.py#L95

Added line #L95 was not covered by tests
for point in self._coordinates.data:
txt += f" {point}\n"
return txt
if oper.physics_name:
field._name = f"Sum of {field.physics_name}"
else:
field._name = "Sum"

Check warning on line 126 in src/ansys/dpf/core/help.py

Codecov / codecov/patch

src/ansys/dpf/core/help.py#L126

Added line #L126 was not covered by tests
field._unit = field._unit
return field
"""
try:
return self.n_results
except Exception:

Check warning on line 602 in src/ansys/dpf/core/result_info.py

Codecov / codecov/patch

src/ansys/dpf/core/result_info.py#L602

Added line #L602 was not covered by tests
return 0
def __iter__(self):
"""
text = f"Server configuration: protocol={self.protocol}"
if self.legacy:
text += " (legacy gRPC)"

Check warning on line 319 in src/ansys/dpf/core/server_factory.py

Codecov / codecov/patch

src/ansys/dpf/core/server_factory.py#L319

Added line #L319 was not covered by tests
return text
def __eq__(self, other: "ServerConfig"):