Skip to main content

calculate pi via the monte carlo method

Project description

calculating pi with modern tooling

We need a few things:

  1. a CLI tool to specify the number of iterations and the number of cores it runs on: picarlo --cores 4 --iterations 10000
  2. a library that can be imported in a notebook

basic tooling setup (runs on each commit)

  1. uv self update & uv sync
  2. linting/format checking: uv run ruff check
  3. auto-formatting: uv run ruff format
  4. type checking: uv run pyright
  1. testing: uv run pytest, run them in parallel
  2. integrate into pre-commit pre-commit run --all-files

Checks

  1. check that the package can be installed: uv run --with picarlo --no-project -- python -c "import picarlo"

Goal

  1. run from command-line (uvx)
  2. import lib into notebook (either via pypy or from local dist)
  3. published module

required

  1. split between dev and prod dependencies: uv add --dev
  2. add a build system, hatchling in pyproject.toml
  3. run a build uv build
  4. try maturing build backend

useful stuff

  1. create docstrings via LLM
  2. create docs from docstrings
  3. calculate test coverage
  4. tracing

release preparation

  1. generate changelog from commit messages
  2. update version indicator
  3. build package/wheel
  4. publish assets

vscode extensions

  1. Ruff
  2. TOML syntax highlighting

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

picarlo-0.2.0.tar.gz (47.5 kB view details)

Uploaded Source

Built Distribution

picarlo-0.2.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file picarlo-0.2.0.tar.gz.

File metadata

  • Download URL: picarlo-0.2.0.tar.gz
  • Upload date:
  • Size: 47.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.2

File hashes

Hashes for picarlo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bb6059f115bd9968e0252a9932baf097d1a013456a0524e38ab70f052a4c853b
MD5 78644f719764e7d2a7091f1d1e48f7cb
BLAKE2b-256 e81c9afbb3ed6034e0094ed473ddafb6f07f1d027348f9cc2acee2c610f90bf1

See more details on using hashes here.

File details

Details for the file picarlo-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: picarlo-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.2

File hashes

Hashes for picarlo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd66c4b20ef25964f253f9534daf25b012ba91b8b1dc6606ec4bc78a5e55e2ce
MD5 7c97182c31215ad86b781921b54cc8d8
BLAKE2b-256 0b4e4666577d4cad6af63127f4997ab0f035862ae24b73e6b1c580dc00d43629

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page