Skip to content

standalone-tsm-context - get_context_with_sites#167

Merged
devin-roffman-emerson merged 26 commits intoni:mainfrom
prithierajmr:main
Apr 7, 2026
Merged

standalone-tsm-context - get_context_with_sites#167
devin-roffman-emerson merged 26 commits intoni:mainfrom
prithierajmr:main

Conversation

@prithierajmr
Copy link
Copy Markdown
Contributor

@prithierajmr prithierajmr commented Mar 6, 2026

Added get_semiconductor_module_context_with_sites to get context with specific sites. Modified codemoduleapi.py - call to check for context in kwargs as a fallback

TODO: Check the above box with an 'x' indicating you've read and followed CONTRIBUTING.md.

What does this Pull Request accomplish?

  • Created a function to call the get_semiconductor_module_context_with_sites to dynamically filter sites during execution.

Why should this Pull Request be merged?

For utilizing the Standalone Semiconductor Module Context effectively, this function are required

What testing has been done?

Ran the automated tests completely to validate these functions and made sure these functions does not affect any other functionality

  • I have run the automated tests (required if there are code changes)

…ntext in kwargs

Added get_semiconductor_module_context_with_sites to get context with specific sites.
Modified codemoduleapi.py - __call__ to check for context in kwargs as a fallback
@prithierajmr prithierajmr changed the title Added get_semiconductor_module_context_with_sites and scan for tsm_co… standalone-tsm-context - get_context_with_site and check context in kwargs Mar 6, 2026
@ni-erikcrank ni-erikcrank requested a review from Copilot March 6, 2026 16:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds APIs to better support standalone Semiconductor Module context usage by enabling site-filtered contexts and attempting to allow passing the context via keyword arguments to code modules.

Changes:

  • Added SemiconductorModuleContext.get_semiconductor_module_context_with_sites(...) wrapper around the COM API GetSemiconductorModuleContextWithSites.
  • Updated code_module.__call__ to attempt a kwargs-based fallback for locating the TSM context and adjusted the related error message.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
src/nitsm/tsmcontext.py Introduces a new public method to obtain a site-filtered SemiconductorModuleContext.
src/nitsm/codemoduleapi.py Attempts to add kwargs fallback behavior for locating the context when invoking decorated code modules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

prithierajmr and others added 4 commits March 9, 2026 12:13
Changed the type to Sequence of integers for Py <3.7 compatibility

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Remove the print statement added for debugging

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Typo in the returns - actual return TSM Context is for the specified site_numbers

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…sm_context in kwargs

tsmcontext - dumbdispatch for getting context with sites
codemoduleapi - Typo
Added codemoduleapi test for checking tsm_context position
…ecking tsm_context in kwargs"

This reverts commit ffa316a.
Rewriting the changes, since we do not want to use dumbdispatch and remove the changes for code_moduleapi
…hecking tsm_context in kwargs"

This reverts commit 78cc0ce.
…ecking tsm_context in kwargs"

This reverts commit ffa316a.
…h the get-context-with-sites method and added a test under 'test_multi_site.py' file with the corresponding pinmap
…h the get-context-with-sites method and added a test under 'test_multi_site.py' file with the corresponding pinmap
@prithierajmr prithierajmr changed the title standalone-tsm-context - get_context_with_site and check context in kwargs standalone-tsm-context - get_context_with_sites Mar 31, 2026
Copy link
Copy Markdown
Contributor Author

@prithierajmr prithierajmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ktvanzwol @devin-roffman-emerson - I reverted all the previous changes and just added get_semiconductor_module_with_sites method with the corresponding tests. Hope this change should be the right one. Please review and let me know

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devin-roffman-emerson
Copy link
Copy Markdown
Collaborator

Make sure to run the formatter, Black, to format the code in this PR so that it matches the expected TSM format.

prithierajmr and others added 5 commits April 1, 2026 13:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Remove unused imports

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Increase the coverage of tests by calling other methods on the context

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Remove all_sites, since they are not used anyway

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…in test_multi_site.py for validating the functionality
@prithierajmr
Copy link
Copy Markdown
Contributor Author

Closed all the review comments @devin-roffman-emerson , @ktvanzwol

@devin-roffman-emerson
Copy link
Copy Markdown
Collaborator

@prithierajmr The lint step is failing. Please rerun the Black formatter again. I am running the pipeline on our end and if all tests pass, we should be good to merge.

@prithierajmr
Copy link
Copy Markdown
Contributor Author

prithierajmr commented Apr 6, 2026

@devin-roffman-emerson , I have reformatted using Black on src and tests directories. Should be good to go if there are no failures.

@devin-roffman-emerson devin-roffman-emerson merged commit a1b1037 into ni:main Apr 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants