{ "info": { "author": "mocquin", "author_email": "mocquin@me.com", "bugtrack_url": null, "classifiers": [], "description": "# physipy\n\nThis python package allows you to manipulate physical quantities, basically considering in the association of a value (scalar, numpy.ndarray and more) and a physical unit (like meter or joule).\n\n```python\n>>> from physipy.quickstart import nm, hp, c, J\n>>> E_ph = hp * c / (500 * nm)\n>>> print(E_ph)\n3.9728916483435158e-19 kg*m**2/s**2\n>>> E_ph.favunit = J\n>>> print(E_ph)\n3.9728916483435158e-19 J\n```\n\nFor a quickstart, check the [quickstart notebook](quickstart.ipynb)\n\n## Installation\n\n```\npip install physipy\n```\n\n## Goals\n\n- Few LOC\n- Simple architecture, with only 2 classes (namely Dimension and Quantity)\n- High numpy compatibility\n- Human-readable syntax (fast syntax !)\n\n## Use case\n\n- Define scalar and arrays of physical quantities\n- Compute operation between them : add, sub, mul, div, pow\n- Display physical quantities in various \u201cunits\u201d.\n\n## Implementatoin approach\n\nThe implementation is pretty simple : \n- a Dimension object represents a [physical dimension](https://en.wikipedia.org/wiki/Dimensional_analysis). For now, these dimension are based on the [SI unit](https://en.wikipedia.org/wiki/International_System_of_Units). It is basically a dictionary where the keys represent the base dimensions, and the values are the exponent these dimensions.\n- a Quantity object is simply the association of a value, scalar or array (or more!), and a Dimension object. Note that this Quantity classe does not sub-class numpy.ndarray (although Quantity objects are compatible with numpy's ufuncs). Most of the work is done by this class.\n- By default, a Quantity is displayed in term of SI untis. To express a Quantity in another unit, just set the \"favunit\", which stands for \"favourite unit\" of the Quantity : ```my_toe_length.favunit = mm```.\n- Plenty of common units (ex : Watt) and constants (ex : speed of light) are packed in. Your physical quantities (```my_toe_length```), units (```kg```), and constants (```kB```) are all Quantity objects.\n\n## Alternative packages\n\nThere are plenty of python package that handle physical quantities computation. Some of them are full packages while some are just plain python module. Here is a list of those I could find (approximately sorted by guessed-popularity) :\n\n - [astropy](http://www.astropy.org/astropy-tutorials/Quantities.html)\n - [sympy](https://docs.sympy.org/latest/modules/physics/units/philosophy.html)\n - [pint](https://pint.readthedocs.io/en/latest/)\n - [Unum](https://bitbucket.org/kiv/unum/)\n - [magnitude](http://juanreyero.com/open/magnitude/)\n - physics.py : there are actually several packages based on the same core code : [ipython-physics](https://bitbucket.org/birkenfeld/ipython-physics) (python 2 only) and [python3-physics](https://github.com/TheGrum/python3-physics) (python 3 only)\n - [ScientificPython.Scientific.Physics.PhysicalQuantities](https://github.com/ScientificPython/ScientificPython)\n - [numericalunits](https://github.com/sbyrnes321/numericalunits)\n - [dimensions.py](https://code.activestate.com/recipes/577333-numerical-type-with-units-dimensionspy/) (python 2 only)\n - [units](https://bitbucket.org/adonohue/units/)\n - [quantities](https://pythonhosted.org/quantities/user/tutorial.html)\n - [physical-quantities](https://github.com/hplgit/physical-quantities)\n - [quanitphy](https://github.com/KenKundert/quantiphy)\n - [parampy](https://github.com/matthewwardrop/python-parampy/blob/master/parampy/quantities.pyx)\n - [pynbody](https://github.com/pynbody/pynbody)\n - [misu](https://github.com/cjrh/misu)\n\nIf you know another package that is not in this list yet, feel free to contribute ! Also, if you are interested in the subject of physical quantities packages in python, check this [quantities-comparison](https://github.com/tbekolay/quantities-comparison) repo and [this talk](https://www.youtube.com/watch?v=N-edLdxiM40).\n\n## Future\n\nHere are some functionnality/fixes/TODOs for down the road :\n - Add a list of main functionnalities of the package\n - Improve the README\n - Create a full benchmark based on an expected behaviour, and bench physical quantities packages.\n - Improve numpy compatibility\n - Add [uncertainty](https://github.com/lebigot/uncertainties/) support\n - Allow changing base unit system (cgs, Planck units, etc)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n## Acknowledgment\n\nThumbs up to phicem and his [pysics](https://bitbucket.org/Phicem/pysics) package, on which this package was higly inspired. Check it out !\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mocquin/physipy", "keywords": "physics physical unit units dimension quantity quantities", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "physipy", "package_url": "https://pypi.org/project/physipy/", "platform": "", "project_url": "https://pypi.org/project/physipy/", "project_urls": { "Homepage": "https://github.com/mocquin/physipy" }, "release_url": "https://pypi.org/project/physipy/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Manipulate physical quantities in Python", "version": "0.1.0" }, "last_serial": 5138920, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "14bce5650b82d2f1efb5a4330ad3e20e", "sha256": "9d79751b514cf076d2e94cdf68eb6125a9b6232acfd54a18367d6abc1fe1e8ab" }, "downloads": -1, "filename": "physipy-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "14bce5650b82d2f1efb5a4330ad3e20e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24798, "upload_time": "2019-04-13T19:16:29", "url": "https://files.pythonhosted.org/packages/cc/7a/879c361cc082428615af41e395f73fd7236a125a378d6970863d3b374040/physipy-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "51b342514e7d0cdf3f06cbef7cd2761f", "sha256": "af6e8e5d11e634d58a932ec70da9c3655b73aa8f627a10617bac7231361eaa46" }, "downloads": -1, "filename": "physipy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "51b342514e7d0cdf3f06cbef7cd2761f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20534, "upload_time": "2019-04-13T19:16:31", "url": "https://files.pythonhosted.org/packages/3e/80/a8ac0d85e5ad8f4485ad1215f8789a374387a3f56cb39b8e5b7c39f3ee40/physipy-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "14bce5650b82d2f1efb5a4330ad3e20e", "sha256": "9d79751b514cf076d2e94cdf68eb6125a9b6232acfd54a18367d6abc1fe1e8ab" }, "downloads": -1, "filename": "physipy-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "14bce5650b82d2f1efb5a4330ad3e20e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24798, "upload_time": "2019-04-13T19:16:29", "url": "https://files.pythonhosted.org/packages/cc/7a/879c361cc082428615af41e395f73fd7236a125a378d6970863d3b374040/physipy-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "51b342514e7d0cdf3f06cbef7cd2761f", "sha256": "af6e8e5d11e634d58a932ec70da9c3655b73aa8f627a10617bac7231361eaa46" }, "downloads": -1, "filename": "physipy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "51b342514e7d0cdf3f06cbef7cd2761f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20534, "upload_time": "2019-04-13T19:16:31", "url": "https://files.pythonhosted.org/packages/3e/80/a8ac0d85e5ad8f4485ad1215f8789a374387a3f56cb39b8e5b7c39f3ee40/physipy-0.1.0.tar.gz" } ] }