Skip to content

Non-zero thickness implementation - #4

Open
michael-petersen wants to merge 1 commit into
ObservationalExpansions:mainfrom
michael-petersen:main
Open

Non-zero thickness implementation#4
michael-petersen wants to merge 1 commit into
ObservationalExpansions:mainfrom
michael-petersen:main

Conversation

@michael-petersen

Copy link
Copy Markdown
Collaborator

This pull request enhances the usability and documentation of the discmodel package, 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:

  • The DiscGalaxy class now supports an isothermal vertical slab via the new zscale parameter, allowing users to model discs with finite thickness. By default, a small nonzero thickness is used unless zscale=0.0 for a flat disc. The sampling of positions (z) and velocities (w) now reflects this vertical structure.

Improved documentation and code clarity:

  • Comprehensive docstrings were added to the main class and methods (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:

  • New tests were added to verify that the isothermal slab thickness is correctly sampled and that setting zscale=0.0 produces a flat disc as expected.

Copilot AI review requested due to automatic review settings July 3, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 zscale parameter, including corresponding vertical velocity dispersion sampling.
  • Expanded/clarified docstrings across key DiscGalaxy methods.
  • 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.

Comment thread src/discmodel/discmodel.py
Comment thread tests/test_discmodel.py
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