Skip to main content

A library to speed up physics work

Project description

PyFys

PyFys is a Python library designed to simplify physics calculations and visualizations. It provides tools for computing common physics quantities and creating graphs.

The philosophy of the project is speed and simplicity. Physics is challenging enough as it is, so PyFys aims to make the programming side of things as easy as possible.

Example Use Case

Imagine you have a list of masses and want to calculate their kinetic energy, given a constant velocity. With PyFys, you can compute this in a single line and visualize the results with a bar plot:

import pyfys
fys = pyfys.fys()

masses = [1, 2, 3, 4, 5]
velocity = 10

fys.bar(fys.kinetic_energy(masses, velocity))

Features

  • Calculate physical quantities like kinetic energy, force, and relativistic momentum. (More equations coming soon!)
  • Generate and visualize graphs for functions and data.
  • Supports scalar and vector inputs for maximum flexibility and speed.

Installation

To install PyFys, run the following command:

pip install pyfys

Quickstart

Import the Library

Here's an example of how to use PyFys to calculate kinetic energy:

import pyfys

# Example: Calculate kinetic energy
fys = pyfys.fys()
mass = 10
energy = [5, 10, 15]
energy = fys.kinetic_energy(mass, energy)
print(energy)  # Output: [125.0, 500.0, 1125.0]

Generate a Graph

This example demonstrates how to plot a simple graph of a quadratic function:

fys.graph(lambda x: x**2, start=0, stop=10, title="Quadratic Function")

Documentation

TODO: Add documentation "For detailed usage and examples, visit the official documentation."


Contributing

Contributions are welcome!


License

This project is licensed under the MIT License. See the LICENSE file for details.

TODO

  • Add more equations
  • Add more constants
  • Add more unit conversions
  • Create documentation
  • Update functions to work with both lists and single values

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

pyfys-0.2.9.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

pyfys-0.2.9-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file pyfys-0.2.9.tar.gz.

File metadata

  • Download URL: pyfys-0.2.9.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for pyfys-0.2.9.tar.gz
Algorithm Hash digest
SHA256 1720d1af3822f67707e97ebf6666ca7b1e8d1b2528fc393b7a11a5b58a1800d0
MD5 7824a56ee2c27f0ef9ff62c0321053fe
BLAKE2b-256 de016b341f0b2deabc437a274b4d85c5c71d0a57a88de4bff7a2f68a0b84f288

See more details on using hashes here.

File details

Details for the file pyfys-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: pyfys-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for pyfys-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c475b3fe4a35b0a6eb7fd68682e7a613bb23dab0b1029c1fa9aa1908c4266d20
MD5 8a21dda83ebd961556dd95696cc7bd12
BLAKE2b-256 77fd82e7650e00a2b32e83857a6ef8a5579c76339c9a1de0ae884d204cf9728e

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