Add Astropy units support - #50
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive support for Astropy units to the pyunitwizard library, extending the existing multi-library unit handling system to include astropy.units alongside pint, openmm.unit, and unyt.
- Implements complete API layer for astropy.units with conversion, dimensionality, and parser support
- Registers astropy.units across all configuration, parsing, and translation systems
- Adds comprehensive test coverage for astropy.units functionality
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyunitwizard/forms/api_astropy_unit.py | New complete API implementation for astropy.units with all required functionality |
| pyunitwizard/configure/configure.py | Adds astropy.units to supported libraries and module mapping |
| pyunitwizard/forms/init.py | Registers astropy.units in the forms API modules dictionary |
| pyunitwizard/init.py | Auto-loads astropy.units library when available |
| pyunitwizard/parse.py | Adds astropy.units parser support and fixes exception naming |
| pyunitwizard/main.py | Updates docstrings to include astropy.units in supported parsers/forms |
| pyunitwizard/_private/parsers.py | Adds astropy.units to parsers list |
| pyunitwizard/_private/forms.py | Adds astropy.units to forms list |
| pyunitwizard/forms/api_pint.py | Adds conversion functions from pint to astropy.units |
| pyunitwizard/forms/api_openmm_unit.py | Adds conversion functions from openmm.unit to astropy.units |
| pyunitwizard/forms/api_unyt.py | Adds conversion functions from unyt to astropy.units |
| pyunitwizard/forms/api_string.py | Adds string parsing to astropy.units |
| tests/astropy_units/test_astropy_units.py | Comprehensive test suite for astropy.units functionality |
| tests/test_configure.py | Updates configuration tests to handle astropy.units |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
dprada
deleted the
codex/add-astropy-module-support-with-tests-pakbvk
branch
September 26, 2025 00:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
astropy.unitsform implementation with conversions, dimensionality, and parser supportTesting
https://chatgpt.com/codex/tasks/task_e_68d5c8acfc4c8326b42a74f902bee1d0