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.1.2.tar.gz (8.7 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.1.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: symeval-0.1.2.tar.gz
  • Upload date:
  • Size: 8.7 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.1.2.tar.gz
Algorithm Hash digest
SHA256 a7d871000640ee0c7661029513c24349cacf7f9c9f2a377723baee39ccde3d2f
MD5 77fe8320735eb76b7dd0b859b9369294
BLAKE2b-256 7fd444222ec152dbbdffcc0e8baaa9b15c14e2ff373b427e8c9a58b070b7b46a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: symeval-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c87fb1cc97a1823e137ba2a53a38eb8506898baea00bc4b8bf03e1ffb6451020
MD5 95a194a706e8a9e0e1369628ba2691ea
BLAKE2b-256 e7ab989664c1c7891aba6a6349baa5615099967922fb2715666202d307109583

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