Skip to main content

Symbolic evaluation for engineering calculations — renders expression → numbers with units → result as LaTeX

Project description

symeval

Idea

The idea is to build something like handcalcs and Calcpad, but then for Python notebooks (marimo & jupyter) using sympy symbolic math expressions and pint quantities (value + unit) as a starting point, such that we can create Explorable Explanations in Python notebooks.

symeval adds two methods to a sympy expression that allows you to fill in pint quantities (value + unit). These methods are:

  • quant_evalf: evaluate a sympy expression using pint units. (I don't remember why exactly, but I decided to not use sympy quantities for some reason, I think because sympy quantities can't handle things like GPa at all or intuitively and because pint units can be rendered nicely using pint's formatter "~L". Could that be?) This is especially useful when you want to calculate the quantities of a new column in a dataframe in a unit-aware manner.
  • sym_evalf: evaluate a sympy expression using pint units and return the LaTeX expression of the filled in formula.

Shortly explain what's great about handcalcs, i.e. it's raison d'etre, here. Then shortly explain that it isn't great that it relys on Jupyter cell magic, i.e. what the disadvantages of Jupyter cell magic are (such as the inability to render variables when doing e.g. a = x1 where x1 was calculated in another cell).

Advantages of using sympy:

  • ability to use symbolic math with sympy before plugging in the numbers
  • ability to apply .evalf or .quant_evalf to a dataframe of values.

Inspiration

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

symeval-0.2.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

symeval-0.2.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: symeval-0.2.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for symeval-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9e6e5d05878e69807320e353a35eb064c3e7a78ade6379d2c50a57cf05fb1f2e
MD5 60e09e5a1cf7a1b8459d803f7f428344
BLAKE2b-256 b3978876360f2619192a79f4cc4866c0b78e4638358c19566c6e9950fec7ff21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: symeval-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for symeval-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57d5888105d50a773bda6aea10c4c2211aacb0f13e4a6cebf2e610cf5a80be24
MD5 ada5e20d43ab2fd013612f5e204a088c
BLAKE2b-256 7c5efbf5d47233c4267a363aeddca0ae40fbd8d33c233f7e6e757add0e9937e0

See more details on using hashes here.

Supported by

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