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

Fixed handling of empty Time Freq Support #996

Merged
merged 13 commits into from
Jul 11, 2023
Merged

Conversation

ansys-akarcher
Copy link
Contributor

@ansys-akarcher ansys-akarcher commented Jun 14, 2023

These changes solve the #967 crash, when using fields_container_factory.over_time_freq_fields_container(...)

Edit: this code is wrong.
we should use a dict when we want a TimeFreqSupport
And min_max_* should not be dependent on TimeFreqSupport

@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Merging #996 (1902de8) into master (13b21d6) will decrease coverage by 1.30%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##           master     #996      +/-   ##
==========================================
- Coverage   88.69%   87.39%   -1.30%     
==========================================
  Files          76       76              
  Lines        8623     8634      +11     
==========================================
- Hits         7648     7546     -102     
- Misses        975     1088     +113     

@ansys-akarcher
Copy link
Contributor Author

I reverted as previously said,

Also the following code was enough to produce a crash:

fields_container = dpf.FieldsContainer()
print(fields_container.time_freq_support)
Traceback (most recent call last):
  File "C:\Users\akarcher\pydpf-core-venv\bug_minmax_overtime\test.py", line 16, in <module>
    print(fields_container.time_freq_support)
  File "C:\Users\akarcher\pydpf-core-venv\pydpf-core\src\ansys\dpf\core\fields_container.py", line 427, in time_freq_support
    return self._get_time_freq_support()
  File "C:\Users\akarcher\pydpf-core-venv\pydpf-core\src\ansys\dpf\core\collection.py", line 397, in _get_time_freq_support
    time_freq = support_api.support_get_as_time_freq_support(support)
  File "d:\ansysdev\ansys-dpf-pygate\ansys-dpf-gate\ansys\dpf\gate\generated\support_capi.py", line 71, in support_get_as_time_freq_support
    raise errors.DPFServerException(sError.value)
ansys.dpf.gate.errors.DPFServerException: Provided shared object is not a FieldSupport !

@ansys-akarcher ansys-akarcher marked this pull request as ready for review June 19, 2023 11:44
@ansys-akarcher ansys-akarcher changed the title Fixed factory regarding time freq support Fixed handling of empty Time Freq Support Jun 19, 2023
@ansys-akarcher
Copy link
Contributor Author

ansys-akarcher commented Jun 20, 2023

@cbellot000 @anslpa The new test "test_fields_container_empty_tf_support()" doesn't work with LegacyGrpcServer, not sure on how to proceed from there, as the grpc interface returns an UNAVAILABLE when retrieving a nullptr (which makes sense)

@ansys-akarcher ansys-akarcher merged commit 460f16a into master Jul 11, 2023
@ansys-akarcher ansys-akarcher deleted the fix/minmax_ent_crash branch July 11, 2023 10:05
@ansys-akarcher
Copy link
Contributor Author

Completes #967

@PProfizi PProfizi added the bug Something isn't working label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants