-
Notifications
You must be signed in to change notification settings - Fork 0
Add unit conversion explanation and script #11
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 comprehensive documentation and tooling for unit conversions in systems where the gravitational constant G is set to 1, specifically for the EXP simulation code. The PR includes mathematical derivations, a Python conversion script, example data files, and usage documentation.
Changes:
- LaTeX document with mathematical derivations for unit conversion formulas
- Python script for computing scale factors and converting particle files
- Example Earth-Sun system files demonstrating the conversion process
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| EXP-units/expunits.tex | LaTeX documentation explaining unit conversion mathematics and formulas |
| EXP-units/expunits.py | Python script implementing scale factor calculations and particle file conversion |
| EXP-units/earth_sun_scaled.txt | Example output file showing Earth-Sun system in scaled units |
| EXP-units/earth_sun_cgs.txt | Example input file with Earth-Sun system in CGS units |
| EXP-units/README_expunits.md | Documentation explaining the contents and providing usage examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
EXP-units/expunits.py
Outdated
| if abs((G_check - G_new) / (abs(G_new) if G_new != 0 else 1.0)) > 1e-9: | ||
| raise ValueError(f"Inconsistent scales: G_new requested {G_new} but scales give {G_check}.") |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition "abs((G_check - G_new) / (abs(G_new) if G_new != 0 else 1.0)) > 1e-9" will use the denominator 1.0 when G_new is 0, but G_new=0 is not a physically meaningful value for a gravitational constant. Consider raising a more informative error if G_new is 0 or negative before this check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Add input validation for gravitational constants in compute_scales
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 7 changed files in this pull request and generated 11 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Add Motivation section to EXP-units README
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Added details about phase-space conversion and provided a Python script for unit conversion.
Updated README to reflect focus on EXP unit conversion for G=1 and clarified example context.
Updated example commands and explanations in README.md for clarity.
Updated section headers and clarified output descriptions.
Updated example usage and detailed explanation of flags in README.
Includes
Movitation
The EXP drop in on Jan 21, 2026.
Comments