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

test: Improving conftest.py so that local configuration is handled #187

Merged
merged 17 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
1 change: 1 addition & 0 deletions doc/changelog.d/187.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test: Improving `conftest.py` so that local configuration is handled
27 changes: 0 additions & 27 deletions src/ansys/sound/core/examples_helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@

Helper functions for managing the PyAnsys Sound example files.
"""

from ._get_example_files import (
get_absolute_path_for_accel_with_rpm_wav,
get_absolute_path_for_fluctuating_noise_wav,
get_absolute_path_for_fluctuating_tone_wav,
get_absolute_path_for_flute2_wav,
get_absolute_path_for_flute_psd_txt,
get_absolute_path_for_flute_wav,
get_absolute_path_for_rough_noise_wav,
get_absolute_path_for_rough_tone_wav,
get_absolute_path_for_sharp_noise_wav,
get_absolute_path_for_sharper_noise_wav,
get_absolute_path_for_xtract_demo_signal_1_wav,
get_absolute_path_for_xtract_demo_signal_2_wav,
)
from .download import (
download_accel_with_rpm_2_wav,
download_accel_with_rpm_3_wav,
Expand All @@ -51,18 +36,6 @@
)

__all__ = (
"get_absolute_path_for_accel_with_rpm_wav",
"get_absolute_path_for_flute2_wav",
"get_absolute_path_for_flute_wav",
"get_absolute_path_for_sharp_noise_wav",
"get_absolute_path_for_sharper_noise_wav",
"get_absolute_path_for_rough_noise_wav",
"get_absolute_path_for_rough_tone_wav",
"get_absolute_path_for_fluctuating_noise_wav",
"get_absolute_path_for_fluctuating_tone_wav",
"get_absolute_path_for_xtract_demo_signal_1_wav",
"get_absolute_path_for_xtract_demo_signal_2_wav",
"get_absolute_path_for_flute_psd_txt",
"download_flute_psd",
"download_flute_wav",
"download_flute_2_wav",
Expand Down
185 changes: 0 additions & 185 deletions src/ansys/sound/core/examples_helpers/_get_example_files.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@

from ansys.dpf.core import (
LicenseContextManager,
ServerConfig,
connect_to_server,
load_library,
server_factory,
start_local_server,
)

Expand Down Expand Up @@ -86,7 +88,10 @@ def connect_to_or_start_server(
**connect_kwargs,
)
else: # pragma: no cover
server = start_local_server(ansys_path=ansys_path)
grpc_config = ServerConfig(
protocol=server_factory.CommunicationProtocols.gRPC, legacy=False
)
server = start_local_server(config=grpc_config, ansys_path=ansys_path, as_global=True)
full_path_dll = os.path.join(server.ansys_path, "Acoustics\\SAS\\ads\\")

required_version = "8.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def method(self) -> int:
def method(self, method: int):
"""Set the sound generation method."""
if method not in [m.value for m in SpectrumSynthesisMethods]:
available_methods = "\n".join(f"{m.value}: {m.name}" for m in SpectrumSynthesisMethods)
raise PyAnsysSoundException(
"Method must be an integer. Available options are:"
f"{"".join(list(f"\n{m.value}: {m.name}" for m in SpectrumSynthesisMethods))}"
"Method must be an integer. Available options are:\n" + available_methods
)
self.__method = method

Expand Down
Loading
Loading