Skip to content

Adding redshift tokenizer#19

Merged
EiffL merged 2 commits intomainfrom
redshift
May 24, 2025
Merged

Adding redshift tokenizer#19
EiffL merged 2 commits intomainfrom
redshift

Conversation

@EiffL
Copy link
Contributor

@EiffL EiffL commented May 24, 2025

This pull request introduces a new GridScalarCodec class and a corresponding Z modality, along with updates to integrate these additions into the existing codebase and tests. The changes include codec registration, modality definition, and updates to unit tests to ensure proper functionality.

Codec-related changes:

  • Added a new GridScalarCodec class in aion/codecs/scalar.py, which uses a ScalarLinearQuantizer for scalar quantization with a fixed range of (0.0, 1.0).
  • Registered GridScalarCodec in the __init__.py file of aion/codecs for import and export. [1] [2]

Modality-related changes:

  • Introduced a new Z modality in aion/modalities.py, representing spectroscopic redshift measurements.
  • Registered the Z modality in the list of scalar modalities in aion/modalities.py.

Testing updates:

  • Added test data files for the Z modality codec, including input, encoded, and decoded batches. [1] [2] [3]
  • Updated tests/tokenizers/test_scalar_tokenizer.py to include tests for GridScalarCodec and the Z modality. [1] [2] [3]

Cleanup:

  • Removed the detailed docstring for the MultiScalarCodec class in aion/codecs/scalar.py to streamline the file.

@EiffL EiffL requested a review from Copilot May 24, 2025 15:58
Copy link

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 pull request adds support for spectroscopic redshift measurements by introducing a new GridScalarCodec along with a corresponding Z modality, and integrates these updates into the codec registration and unit tests.

  • Added a new GridScalarCodec class in aion/codecs/scalar.py that uses a fixed-range ScalarLinearQuantizer.
  • Introduced and registered a new Z modality in aion/modalities.py and updated tests to validate the new implementations.

Reviewed Changes

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

Show a summary per file
File Description
tests/tokenizers/test_scalar_tokenizer.py Updated imports and added tests for GridScalarCodec and Z modality
tests/test_data/Z_codec_*.pt Added test data files for codec input, encoded, and decoded batches
aion/modalities.py Introduced new Z modality for redshift measurements
aion/codecs/scalar.py Added GridScalarCodec class and removed MultiScalarCodec docstring for cleanup
aion/codecs/init.py Updated codec registration to include GridScalarCodec

@EiffL
Copy link
Contributor Author

EiffL commented May 24, 2025

Exellent, good job @EiffL

@EiffL EiffL merged commit 0f0408f into main May 24, 2025
2 checks passed
@EiffL EiffL deleted the redshift branch May 24, 2025 16:03
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.

2 participants