-
Notifications
You must be signed in to change notification settings - Fork 102
nirfsg: Refactor get_deembedding_sparameters to match the interpreter interfaces #2167
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
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6a11ce3
initial version
rahur-NI 018ac04
Resolving System tests
rahur-NI e4e13c3
Need to update doc changes
rahur-NI d1f7ef1
Updated with private function
rahur-NI 5079c88
Removing the doc template.
rahur-NI 8ed649e
Updated functions.py to remove non mandate changes
rahur-NI 0b80b51
Updating session.py template for get_deembedding_sparameters function
rahur-NI e03f722
Updated test case as needed for gRPC system tests
rahur-NI f643b29
Updated gRPC enum to resolve 'TypeError: 'float' object cannot be int…
rahur-NI f31521c
Removed SetAttributeVi to include in a new PR
rahur-NI 64fd4a3
Matching get_deembedding_sparameters to the gRPCs interpreter
rahur-NI 265b3a1
Updated as the code review comments
rahur-NI f898cc0
Remvoing unwanted files
rahur-NI 1a54268
Updated code review comments
rahur-NI 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
Some comments aren't visible on the classic Files Changed page.
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
27 changes: 27 additions & 0 deletions
27
src/nirfsg/templates/_library_interpreter.py/get_deembedding_sparameter.py.mako
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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <%page args="f, config, method_template"/>\ | ||
| <% | ||
| '''Creates a numpy array based on number of ports queried from driver and passes it to "get_deembedding_sparameters" method.''' | ||
| import build.helper as helper | ||
| %>\ | ||
|
|
||
| def ${f['python_name']}(self): | ||
| import numpy as np | ||
| number_of_ports = self.get_deembedding_table_number_of_ports() | ||
| sparameters_array_size = number_of_ports ** 2 | ||
| sparameters = np.full((number_of_ports, number_of_ports), 0 + 0j, dtype=np.complex128) | ||
| if type(sparameters) is not np.ndarray: | ||
|
rahur-NI marked this conversation as resolved.
Outdated
|
||
| raise TypeError('sparameters must be {0}, is {1}'.format(np.ndarray, type(sparameters))) | ||
| if np.isfortran(sparameters) is True: | ||
| raise TypeError('sparameters must be in C-order') | ||
| if sparameters.dtype is not np.dtype('complex128'): | ||
| raise TypeError('sparameters must be np.ndarray of dtype=complex128, is ' + str(sparameters.dtype)) | ||
| vi_ctype = _visatype.ViSession(self._vi) # case S110 | ||
| sparameters_ctype = _get_ctypes_pointer_for_buffer(value=sparameters, library_type=_complextype.NIComplexNumber) # case B510 | ||
| sparameters_array_size_ctype = _visatype.ViInt32(sparameters_array_size) # case S150 | ||
| number_of_sparameters_ctype = _visatype.ViInt32() # case S220 | ||
| number_of_ports_ctype = _visatype.ViInt32() # case S220 | ||
|
rahur-NI marked this conversation as resolved.
|
||
| error_code = self._library.niRFSG_GetDeembeddingSparameters(vi_ctype, sparameters_ctype, sparameters_array_size_ctype, None if number_of_sparameters_ctype is None else (ctypes.pointer(number_of_sparameters_ctype)), None if number_of_ports_ctype is None else (ctypes.pointer(number_of_ports_ctype))) | ||
| errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) | ||
| number_of_ports = int(number_of_ports_ctype.value) | ||
|
rahur-NI marked this conversation as resolved.
Outdated
|
||
| sparameters = sparameters.reshape((number_of_ports, number_of_ports)) | ||
| return sparameters | ||
|
rahur-NI marked this conversation as resolved.
|
||
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
Oops, something went wrong.
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.