Non-zero thickness implementation - #4
Open
michael-petersen wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request extends discmodel.DiscGalaxy to support sampling a finite vertical thickness (Gaussian/isothermal-slab-style), while also improving docstrings and expanding user-facing documentation and tests.
Changes:
- Added vertical thickness sampling via a new
zscaleparameter, including corresponding vertical velocity dispersion sampling. - Expanded/clarified docstrings across key
DiscGalaxymethods. - Added tests and README usage examples covering nonzero and zero-thickness discs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/discmodel/discmodel.py |
Implements vertical thickness sampling (z, w) and adds/updates method docstrings. |
tests/test_discmodel.py |
Adds tests for nonzero zscale sampling and for zscale=0.0 flat-disc behavior. |
README.md |
Improves code fences and adds an example for visualizing generated images plus zscale usage notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request enhances the usability and documentation of the
discmodelpackage, focusing on clearer code, improved docstrings, and better support for modeling disc galaxies with vertical structure. The most significant changes are the addition of isothermal slab thickness support, improved documentation and usage examples, and expanded test coverage.Support for vertical disc thickness:
DiscGalaxyclass now supports an isothermal vertical slab via the newzscaleparameter, allowing users to model discs with finite thickness. By default, a small nonzero thickness is used unlesszscale=0.0for a flat disc. The sampling of positions (z) and velocities (w) now reflects this vertical structure.Improved documentation and code clarity:
DiscGalaxy,make_rotation_matrix,rotate_disc,generate_image,make_expansion,make_particle_expansion,resample_expansion,compute_a1), clarifying input parameters, behavior, and usage.Testing enhancements:
zscale=0.0produces a flat disc as expected.