Skip to content

Milab 4784 fix deduplication and update#39

Merged
aiturbidemil merged 6 commits intomainfrom
MILAB-4784-fix-deduplication-and-update
Nov 12, 2025
Merged

Milab 4784 fix deduplication and update#39
aiturbidemil merged 6 commits intomainfrom
MILAB-4784-fix-deduplication-and-update

Conversation

@aiturbidemil
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @aiturbidemil, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the dimensionality reduction block by introducing a more structured and maintainable workflow architecture through the adoption of Tengo templates. It expands the block's descriptive documentation to clearly outline its advanced capabilities, including PCA, t-SNE, UMAP, and Harmony batch correction. Additionally, the PR incorporates a broad set of dependency updates to ensure the project uses the latest stable versions of its underlying libraries.

Highlights

  • Workflow Refactoring with Tengo Templates: The core dimensionality reduction and batch correction logic has been refactored into dedicated Tengo workflow templates (batch-correction.tpl.tengo and dim-reduction-calculation.tpl.tengo). The main workflow now utilizes these templates via render.create, significantly improving modularity and maintainability.
  • Enhanced Dimensionality Reduction Capabilities: The dimensionality reduction block's description has been extensively updated to detail its support for Principal Component Analysis (PCA), t-distributed Stochastic Neighbor Embedding (t-SNE), Uniform Manifold Approximation and Projection (UMAP), and optional Harmony batch correction. This provides clearer insight into the block's functionality.
  • Improved Trace Labeling: The trace labels generated by the workflow have been made more informative, now explicitly including 'Dimensionality Reduction' or 'Batch Corrected Dimensionality Reduction' along with the parameters (nPCs, nNeighbors) for better clarity in output visualization.
  • Dependency Updates: Numerous dependencies across @platforma-sdk packages and other third-party libraries (e.g., @milaboratories, @vitest, commander, debug, es-module-lexer, expect-type, fdir, magic-string, picomatch, selfsigned, std-env, tinyglobby, tinyrainbow, tslib) have been updated, as reflected in pnpm-lock.yaml and pnpm-workspace.yaml.
  • Version and Changelog Entry: A new changeset entry (famous-hounds-dress.md) indicates a minor version bump for @platforma-open/milaboratories.dimensionality-reduction.workflow and @platforma-open/milaboratories.dimensionality-reduction, alongside a description of enabling block deduplication and improving the trace label. Note: The block/package.json diff shows a version change from 1.2.16 to 1.2.15, which appears to be a version correction or specific release numbering rather than a direct increment.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several valuable improvements, including a significant refactoring of the workflow logic into modular Tengo templates, which greatly enhances readability and maintainability. The block's documentation and descriptions have also been substantially updated, providing clearer and more comprehensive explanations. However, there is a critical issue in block/package.json where the version number has been incorrectly decremented. Additionally, there are a few opportunities to improve maintainability by replacing hardcoded values for resource allocation and cache durations with named constants or variables.

Choose a reason for hiding this comment

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

critical

The package version has been decremented from 1.2.16 to 1.2.15. Package versions should follow Semantic Versioning and always be incremented for new changes. Please revert this to 1.2.16 and allow the automated release process to handle the version bump based on the changeset file.

Suggested change
"version": "1.2.15",
"version": "1.2.16",

saveFile("umap_dimensions.csv").
saveFile("tsne_dimensions.csv").
saveFile("harmony_results.csv").
cache(24 * 60 * 60 * 1000).

Choose a reason for hiding this comment

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

medium

The cache duration is hardcoded as a magic number. To improve readability and maintainability, it's better to define this value as a named constant at the top of the file.

For example:

cacheDuration := 24 * 60 * 60 * 1000 // 24 hours

Then, you can use this constant here: cache(cacheDuration).

saveFile("umap_results.csv").
saveFile("tsne_results.csv").
saveFile("pca_results.csv").
cache(24 * 60 * 60 * 1000).

Choose a reason for hiding this comment

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

medium

The cache duration is hardcoded as a magic number. To improve readability and maintainability, it's better to define this value as a named constant at the top of the file.

For example:

cacheDuration := 24 * 60 * 60 * 1000 // 24 hours

Then, you can use this constant here: cache(cacheDuration).

Comment on lines +56 to +57
mem: "32GiB",
cpu: 16

Choose a reason for hiding this comment

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

medium

The memory (32GiB) and CPU (16) resources are hardcoded here and also in the batchCorrectionRender block. To improve maintainability and avoid duplication, consider defining these as constants at the top of the file and reusing them in both places.

For example:

// At the top of the file
defaultExecMem := "32GiB"
defaultExecCpu := 16

// ... then use them in the render blocks
mem: defaultExecMem,
cpu: defaultExecCpu

@aiturbidemil aiturbidemil added this pull request to the merge queue Nov 12, 2025
Merged via the queue into main with commit 7858f7f Nov 12, 2025
8 checks passed
@aiturbidemil aiturbidemil deleted the MILAB-4784-fix-deduplication-and-update branch November 12, 2025 12:57
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.

1 participant

Comments