-
Notifications
You must be signed in to change notification settings - Fork 25
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
Refactor misc.py #1276
Refactor misc.py #1276
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1276 +/- ##
==========================================
+ Coverage 86.16% 86.37% +0.21%
==========================================
Files 81 81
Lines 9251 9229 -22
==========================================
+ Hits 7971 7972 +1
+ Misses 1280 1257 -23 |
src/ansys/dpf/gate/load_api.py
Outdated
if not os.path.isdir(ansys_path): | ||
continue | ||
# Check that it contains a DPF install | ||
if not os.path.exists(os.path.join(ansys_path, _get_path_in_install())): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_get_path_in_install
should be enriched to also check the existence of the dpf
folder, where the majority of libraries are now placed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafacanton we could, yet checks are usually made in methods which call _get_path_in_install
:
- gate.load_api._get_api_path_from_installer_or_package,
- core.server_types._run_launch_server_process,
- core.server_types._verify_ansys_path_is_valid,
- core.server_types._get_dll_path,
- core.server_factory.ServerFactory.get_server_type_from_config,
That would mean refactoring all of those.
Still I agree that the current checks may not be enough. We should check that a given list of DLLs (TBD) is actually present.
This can be added to the objectives of this issue/PR, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafacanton while implementing a test for dpf/bin/winx64
or dpf/bin/linx64
folder, I realized that we may have an issue in ServerFactory.get_server_type_from_config
which basically enforces use of AWP_ROOT242
when in non-legacy Grpc to define the aisol path to add to PATH... I think this is quite a problem. I also noticed that we still use _find_outdated_ansys_version()
which tests for Ansys versions below 221... I do not think we still need that as it was used to force LegacyGrpc
connections for servers 221 or below while now we could argue that the client itself does not support servers below 222. If we allow this connection to happen, there WILL be failures anyway.
I think there may be a lot of refactoring to do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: adding the test for a dpf folder, yet it appears consistently only starting with 231.
Refactor misc.py/_find_latest_ansys_versions as the same logic is now at the gate level in load_api.py.
Originally showed the required changes on pygate to close #1273