VirtualPhotonics / VTS

Virtual Tissue Simulator
https://virtualphotonics.org
Other
34 stars 9 forks source link

Please add default values for objects to documentation #158

Open scottprahl opened 2 months ago

scottprahl commented 2 months ago

Is your feature request related to a problem? Please describe. I have to look at the source code to know that SimulationInput() returns an object that has a (perfectly sensible) SourceInput value of DirectionalPointSourceInput

Describe the solution you'd like Ideally this would be built into the documentation using the <returns> ... </returns> tag. For example, the CustomCircularSource tells us nothing about the returned object other than it is an ISource.

/// <summary>
/// Required code to create a source based on the input values
/// </summary>
/// <param name="rng">random number generator</param>
/// <returns>source class that implements ISource</returns>
public ISource CreateSource(Random rng = null)
{
    rng = rng ?? new Random();

    return new CustomCircularSource(
        this.OuterRadius,
        this.InnerRadius,
        this.SourceProfile,
        this.PolarAngleEmissionRange,
        this.AzimuthalAngleEmissionRange,
        this.NewDirectionOfPrincipalSourceAxis,
        this.TranslationFromOrigin,
        this.BeamRotationFromInwardNormal,
        this.InitialTissueRegionIndex) { Rng = rng };
}

Describe alternatives you've considered Rummaging around in the source code works, but is tedious.

Additional context This will be a lot of work. Starting with the object creation would be nice. It also seems like this is something that AI would be great at assisting with.

lmalenfant commented 2 months ago

Hi Scott,

This is a great suggestion and one that Carole and I discussed last week after the challenges we faced with the Python sample. Some of the default values are in the code but it would be better if they were also in the XML comments to appear in the documentation.