add comments to source files, class and functions #35
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.
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.