Skip to content
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

add comments to source files, class and functions #35

Merged
merged 3 commits into from
Mar 19, 2025
Merged

add comments to source files, class and functions #35

merged 3 commits into from
Mar 19, 2025

Conversation

kunyuan
Copy link
Member

@kunyuan kunyuan commented Mar 19, 2025

MCintegration Package Source Files
I've added comprehensive comments to all the main source files in the MCintegration package. Here's a summary of what each file contains:

MCintegration/init.py
Added package overview explaining the purpose of the Monte Carlo integration package
Listed key components: base distributions, transformation maps, integration algorithms, utilities, and multi-GPU support

MCintegration/base.py
Added file header describing its purpose for base distribution classes
Documented BaseDistribution abstract class for sampling distributions
Commented on Uniform distribution implementation
Added detailed documentation for LinearMap transformation

MCintegration/integrators.py
Added file header explaining the integration methods
Documented utility functions for distributed computing (get_ip, get_open_port, setup, cleanup)
Added detailed comments for Integrator base class
Documented MonteCarlo and MarkovChainMonteCarlo classes with their sampling methods
Added comments for different proposal distributions (random_walk, uniform, gaussian)

MCintegration/maps.py
Added file header explaining the transformation maps for importance sampling
Documented Configuration class for storing samples and results
Commented on Map abstract class for transformations
Added detailed documentation for CompositeMap and Vegas classes

MCintegration/utils.py
Added file header describing utility functions and classes
Documented RAvg class for running averages and error estimation
Added comments to utility functions like set_seed and get_device
Example Files

examples/example_1.py
Added comprehensive description of the unit circle and half-sphere integration examples
Documented the integrand functions and their expected values
Added comments explaining the different Monte Carlo methods being compared
Added notes about the true values of the integrals

examples/example_2.py
Added detailed explanation of the sharp peak integration in 4D
Documented the multi-dimensional integrand function with its three components
Added comments explaining the challenge of sharp peaks for Monte Carlo integration
Noted the expected improvement from VEGAS adaptive sampling
The comments provide a clear understanding of how the MCintegration package works, from the base distributions and transformations to the integration algorithms, with practical examples demonstrating their application to different integration problems.

@kunyuan kunyuan requested a review from houpc March 19, 2025 09:37
Copy link

codecov bot commented Mar 19, 2025

Codecov Report

Attention: Patch coverage is 82.85714% with 6 lines in your changes missing coverage. Please review.

Project coverage is 95.50%. Comparing base (240adc2) to head (38f2018).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
MCintegration/maps.py 85.00% 3 Missing ⚠️
MCintegration/base.py 71.42% 2 Missing ⚠️
MCintegration/integrators.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #35      +/-   ##
==========================================
+ Coverage   95.36%   95.50%   +0.13%     
==========================================
  Files          10       10              
  Lines        1359     1356       -3     
==========================================
- Hits         1296     1295       -1     
+ Misses         63       61       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@houpc houpc merged commit 345fded into master Mar 19, 2025
5 checks passed
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.

3 participants