_analysis module¶
Analysis module for pyrockfall¶
This module defines the Analysis class — an orchestration layer that
coordinates sampling, physics kernels, and interaction with the slope/geometry
backend in a vectorised manner for both 2D and 3D simulations.
Design Philosophy¶
Classes (e.g.,
Seeder,Rock,Material,SlopeModel) are used for configuration.Before simulation, all classes are sampled into NumPy arrays (and a sampled slope batch), after which the
Analysismethods operate as pure, argument-in / value-out kernels to preserve vectorisation and enable easy testing/parallelism.Intersection queries are delegated to the sampled slope object (e.g.,
SlopeBatch), which provides batched, broadcastable kernels.
Contents¶
Analysis: Public API comprising validation, sampling, frame transforms, impact and sliding mechanics, free-fall integration, metrics, and high-level preprocessing/processing/postprocessing orchestration.
Notes
This file contains signatures and docstrings only (no implementations) to
clarify the public API and expected array shapes. Implementations should be
vectorised and side-effect free (no mutation of self), except where a method
explicitly writes into an external container (e.g., Trajectories).
- class pyrockfall._analysis.Sampling(*values)[source]¶
Bases:
EnumEnumeration of stochastic sampling methods.
- LatinHypercube¶
Use Latin Hypercube Sampling.
- MonteCarlo¶
Use simple Monte Carlo sampling.
- LatinHypercube = 1¶
- MonteCarlo = 2¶
- class pyrockfall._analysis.AnalysisRocksThrown(*values)[source]¶
Bases:
EnumEnumeration of rock-throwing strategies in simulation.
- DistributedFromNumberOfRocks¶
Rocks distributed globally among all seeders.
- IndividuallyPerSeeder¶
Each seeder throws its specified number of rocks.
- DistributedFromNumberOfRocks = 1¶
- IndividuallyPerSeeder = 2¶
- class pyrockfall._analysis.SampleMaps(rockSamples: 'Dict[Rock, List[int]]', seederSamples: 'Dict[Seeder, List[int]]', numSamples: 'int')[source]¶
Bases:
object
- class pyrockfall._analysis.Analysis(copy: Analysis | None = None)[source]¶
Bases:
objectRefactored Analysis class that avoids adding new instance attributes at runtime. - All configuration stays on self. - Every method receives exactly the arrays/values it needs and returns outputs explicitly. - The main loop threads the necessary arrays between steps.
- property vegetation: Vegetation¶
- property maps: SampleMaps¶