Skip to content

[SYNPY-1577] Submission View #1192

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 43 commits into from
Apr 22, 2025
Merged

[SYNPY-1577] Submission View #1192

merged 43 commits into from
Apr 22, 2025

Conversation

BryanFauble
Copy link
Member

Problem:

  • The Synapse Python Client lacked the ability to programmatically work with Submission Views using an object-orientated approach

Solution:

  • Added a new SubmissionView model class that represents Synapse Submission Views.
  • Added both synchronous and asynchronous implementations to maintain consistency with the rest of the client.
  • Key features implemented include:
    • Creating new submission views
    • Adding/removing evaluation queues from the view scope
    • Querying submissions across multiple evaluation queues
    • Creating snapshots to capture submission states at a point in time
    • Reordering columns for better data presentation
  • Added comprehensive documentation including:
    • New API reference documentation for both sync and async implementations
    • A detailed tutorial with step-by-step examples
    • Example code demonstrating complete workflows

Testing:

  • Created a tutorial script that serves as both documentation and a functional test of the implementation.
  • The tutorial demonstrates the full workflow including:
    • Creating evaluation queues
    • Submitting files to the queues
    • Creating a submission view based on these queues
    • Querying the submission view
    • Modifying the view scope
    • Creating a snapshot of the view
  • Added automated tests in both synchronous and asynchronous testing suites:
    • tests/integration/test_submissionview.py
    • tests/integration/async/test_submissionview_async.py
  • Documentation was tested through ReadTheDocs build to ensure proper rendering and inclusion in the navigation structure.
  • Manual testing was performed to verify functionality matches the Synapse web interface capabilities.

@BryanFauble BryanFauble requested a review from Copilot April 17, 2025 21:52
Copy link

@Copilot 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

This PR adds comprehensive support for a new SubmissionView model to the Synapse Python Client. Key changes include:

  • Introducing the SubmissionView model and integrating it in model imports, constants, and factory mappings.
  • Updating the client submission logic to support both dataclass and dictionary representations.
  • Adding a complete tutorial script and updated documentation for both synchronous and asynchronous interfaces.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
synapseclient/models/services/storable_entity_components.py Added SubmissionView to type unions and updated activity change logic.
synapseclient/models/mixins/table_components.py Included SubmissionView in the list of classes that contain row etags.
synapseclient/models/init.py Exported SubmissionView accordingly.
synapseclient/core/constants/concrete_types.py Added SUBMISSION_VIEW constant to the concrete types.
synapseclient/client.py Updated submit handling for dataclass-based entities with SubmissionView.
synapseclient/api/entity_factory.py Mapped the concrete type SUBMISSION_VIEW to the SubmissionView model.
mkdocs.yml Updated navigation to include SubmissionView documentation.
docs/tutorials/python/tutorial_scripts/submissionview.py Added a comprehensive tutorial script for SubmissionView usage.
docs/tutorials/python/submissionview.md Created tutorial documentation for SubmissionView.
docs/reference/experimental/sync/submissionview.md Added new API reference documentation for SubmissionView (sync).
docs/reference/experimental/async/submissionview.md Added new API reference documentation for SubmissionView (async).
.readthedocs.yaml Modified reference ranking settings for improved documentation ordering.


# Step 3: Create and submit a file to the evaluation queue
with tempfile.NamedTemporaryFile(
mode="w", suffix=".txt", delete=True, delete_on_close=False
Copy link
Preview

Copilot AI Apr 17, 2025

Choose a reason for hiding this comment

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

The use of both 'delete' and 'delete_on_close' parameters in NamedTemporaryFile is non-standard and may lead to unexpected behavior; consider using only one appropriate parameter based on your intended file deletion behavior.

Suggested change
mode="w", suffix=".txt", delete=True, delete_on_close=False
mode="w", suffix=".txt", delete=True

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Bad suggestion. Using both means the file is deleted when leaving the content managed "with" statement, but not deleted the moment we stop writing to the file through I/O

@BryanFauble BryanFauble marked this pull request as ready for review April 17, 2025 21:55
@BryanFauble BryanFauble requested a review from a team as a code owner April 17, 2025 21:55
Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

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

🔥 LGTM! Took a peak at the tests and also tutorial. Thanks for that! Will defer to the team for the final review. It does seem like tests are taking awhile to run now due to all these calls. 😅

I think we could have others do the conversion of the challenge services into OOP when we get there.

@BryanFauble BryanFauble requested review from a team and vpchung April 18, 2025 19:45
@BWMac BWMac self-requested a review April 21, 2025 17:03
…tiple entities and move to ColumnMixin. Making SubmissionView access controllable
@BryanFauble BryanFauble requested a review from BWMac April 21, 2025 19:54
Copy link
Contributor

@BWMac BWMac left a comment

Choose a reason for hiding this comment

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

🔥

@BryanFauble BryanFauble merged commit 5b36421 into develop Apr 22, 2025
28 checks passed
@BryanFauble BryanFauble deleted the synpy-1577-submission-view branch April 22, 2025 18:14
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.

3 participants