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

[ENH] Standardized query result files #398

Merged
merged 3 commits into from
Dec 13, 2024
Merged

[ENH] Standardized query result files #398

merged 3 commits into from
Dec 13, 2024

Conversation

rmanaem
Copy link
Contributor

@rmanaem rmanaem commented Dec 12, 2024

NOTE: If this pull request is to be released, the release label must be applied once the review process is done to avoid the local and remote from going out of sync as a consequence of the bump version workflow run

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR has a label for the release changelog or skip-release (to be applied by maintainers only)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass
  • If the PR changes the participant-level and/or the dataset-level result file, the query-tool-results files in the neurobagel_examples repo have been regenerated

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

Summary by Sourcery

Standardize the format of query result files to ensure consistency across different datasets and scenarios, and update tests to validate the new format.

Enhancements:

  • Standardize the format of query result files by unifying the headers and data structure for both protected and unprotected records.

Tests:

  • Update tests to reflect the new standardized format of query result files, ensuring correct data mapping and validation.

Copy link

sourcery-ai bot commented Dec 12, 2024

Reviewer's Guide by Sourcery

This PR standardizes the query result files by consolidating the logic for both human-readable and machine-readable formats into a single code path. The changes reorganize the column order in the TSV output and introduce conditional formatting based on the file type.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Unified the TSV generation logic for both human-readable and machine-readable formats
  • Merged duplicate code paths into a single flow using a conditional flag isHumanFile
  • Standardized header columns and their order across both formats
  • Added conditional formatting using convertURIToLabel for human-readable files
  • Preserved raw values for machine-readable files
src/components/ResultContainer.tsx
Updated test cases to reflect new column ordering
  • Adjusted column index assertions to match new column positions
  • Updated expected values for session-related fields
cypress/e2e/ResultsTSV.cy.ts

Assessment against linked issues

Issue Objective Addressed Explanation
#389 Create a file with descriptive labels (human-readable)
#389 Create a file with URIs (machine-optimized)

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@rmanaem rmanaem requested a review from surchs December 12, 2024 16:52
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @rmanaem - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please document the rationale for reordering the columns in the TSV output, as this represents a breaking change that could affect downstream tools.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@rmanaem rmanaem added the pr-patch Incremental feature improvement, will increment patch version when merged (0.0.+1) label Dec 12, 2024
Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for neurobagel-query ready!

Name Link
🔨 Latest commit c6d45fd
🔍 Latest deploy log https://app.netlify.com/sites/neurobagel-query/deploys/675c69c658155b00088f7403
😎 Deploy Preview https://deploy-preview-398--neurobagel-query.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Thanks @rmanaem 🎉 !

Take a look at the space-separated arrays. My memory is that we wanted there to be no spaces (in both the human and machine files) between array elements (e.g. [T1Weighted,FlowWeighted] instead of [T1Weighted, FlowWeighted]

🧑‍🍳

src/components/ResultContainer.tsx Outdated Show resolved Hide resolved
src/components/ResultContainer.tsx Outdated Show resolved Hide resolved
@rmanaem rmanaem merged commit 8277948 into main Dec 13, 2024
9 checks passed
@rmanaem rmanaem deleted the enh-389 branch December 13, 2024 17:16
rmanaem added a commit that referenced this pull request Dec 13, 2024
* Standardized query result files

* Addressed the PR review comments
rmanaem added a commit that referenced this pull request Dec 13, 2024
* Implemented splitbutton for `DownloadResultButton`

* Updated `GetDataDialog` component

* Updated `ResultContainer` component

* Updated `ResultsTSV` e2e test

* Updated docker command

* [ENH] Standardized query result files (#398)

* Standardized query result files

* Addressed the PR review comments

* Addressed PR review comments
Copy link
Contributor

🚀 PR was released in v0.8.0 🚀

@neurobagel-bot neurobagel-bot bot added the released This issue/pull request has been released. label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-patch Incremental feature improvement, will increment patch version when merged (0.0.+1) released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standardize query result files
2 participants