Skip to main content

calculate pi via the monte carlo method

Project description

calculating pi with modern tooling

image image image

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.3.0.tar.gz (47.6 kB view details)

Uploaded Source

Built Distribution

picarlo-0.3.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for picarlo-0.3.0.tar.gz
Algorithm Hash digest
SHA256 809842c0834da11b1a421cacdb0cc2b0bd102b90a58384b853642c6bc6a1639a
MD5 13cea3fa6b75044ff4a6affd0400f5c9
BLAKE2b-256 659f5f22bba3351a7f9e58b29695cdf2fe4e1f201b5d957cce51735f516fe9a3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for picarlo-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe46747069ad953fe0c7fecbd02ff4b339e72a83be86f67b69fd3c2d6f233d10
MD5 dd75e9c9a2a983336c17b131f7e5e301
BLAKE2b-256 9af89aa8846e0eb7f51e69c921cc177aae25fe36734eda768d419dceb9895279

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