Skip to content

Conversation

@Mr-Imperium
Copy link

Implemented transform_labels method to handle coordinate transformations.

  • Base Transform: Identity (returns labels unchanged).
  • SimplexTransform: Drops the last label.
  • SumTo1: Drops the last label.
  • ZeroSumTransform: Implemented logic to drop labels corresponding to zerosum_axes.

Verified via existing test suite and manual verification script.

Description

This PR addresses Issue #7907 by adding a transform_labels method to the base Transform class and overriding it in specific subclasses. This ensures that when transformations (like Simplex) reduce the dimensionality of the data, the associated coordinates/labels are adjusted accordingly.

Changes implemented:

  • Base Transform: Added transform_labels which returns labels unchanged (identity).
  • SimplexTransform: Overridden to return labels[:-1] (dropping the last label).
  • SumTo1: Overridden to return labels[:-1].
  • ZeroSumTransform: Overridden to handle zerosum_axes, ensuring the last label is dropped for the specific axes being transformed.

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

Mr-Imperium and others added 2 commits November 25, 2025 21:57
…devs#7907

Implemented transform_labels method to handle coordinate transformations.
- Base Transform: Identity (returns labels unchanged).
- SimplexTransform: Drops the last label.
- SumTo1: Drops the last label.
- ZeroSumTransform: Implemented logic to drop labels corresponding to zerosum_axes.

Verified via existing test suite and manual verification script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add transform_coords method to Transform method to automatically label unconstrained draws

1 participant