uncscode / particula

a simple, fast, and powerful particle simulator
https://uncscode.github.io/particula
MIT License
5 stars 7 forks source link

Pre-Condensation 0 Builder ABC class #461

Closed Gorkowski closed 1 month ago

Gorkowski commented 2 months ago

Changes Implemented:

Example usage, from the Future, for how mixin's are used to add methods dynamically to builders.

class SurfaceStrategyMolarBuilder(
    BuilderABC,
    BuilderDensityMixin,
    BuilderSurfaceTensionMixin,
    BuilderMolarMassMixin
):
    """Builder class for SurfaceStrategyMolar objects.

    Methods:
    --------
    - set_surface_tension(surface_tension, surface_tension_units): Set the
        surface tension of the particle in N/m. Default units are 'N/m'.
    - set_density(density, density_units): Set the density of the particle in
        kg/m^3. Default units are 'kg/m^3'.
    - set_molar_mass(molar_mass, molar_mass_units): Set the molar mass of the
        particle in kg/mol. Default units are 'kg/mol'.
    - set_parameters(params): Set the parameters of the SurfaceStrategyMolar
        object from a dictionary including optional units.
    - build(): Validate and return the SurfaceStrategyMolar object.
    """

    def __init__(self):
        required_parameters = ['surface_tension', 'density', 'molar_mass']
        BuilderABC.__init__(self, required_parameters)
        BuilderSurfaceTensionMixin.__init__(self)
        BuilderDensityMixin.__init__(self)
        BuilderMolarMassMixin.__init__(self)
github-actions[bot] commented 2 months ago

PR Preview Action v1.4.7 :---: :rocket: Deployed preview to https://uncscode.github.io/particula/pr-preview/pr-461/ on branch gh-pages at 2024-05-29 00:42 UTC

Gorkowski commented 2 months ago

@ngmahfouz <500