This is a set of two sample Beam Pipelines that we use to calculate Pi with a monte carlo algorithm that relies on generating random points in an n-dimentional cube, and validating whether they are located within a circle in that space.
These examples are meant to showcase the use of Beam's Batched DoFns developed by @TheNeuralBit.
From testing on my laptop, batched DoFns have slightly better performance; however, I expect the performance gains to be larger with larger data sizes.
To try out the example:
# Create your own virtual environment for Python
# Install dependencies
pip install -r requirements.txt
# Run simulations
python simple_numeric.py