-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
147 additions
and
67 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
******************** | ||
Introduction to PyQn | ||
******************** | ||
|
||
|
||
|
||
PyQn is a Python package for parsing, validating, manipulating and | ||
transforming physical quantities and their units. | ||
|
||
Units are specified as strings using a simple and flexible syntax, | ||
and may be compared, output in different formats and manipulated using a | ||
variety of predefined Python methods. | ||
|
||
|
||
|
||
Installation: | ||
============= | ||
|
||
The PyQn package can be installed either from PyPI_ using pip | ||
|
||
.. code-block:: bash | ||
python3 -m pip install pyqn | ||
or from the source by running (one of the two) from the project source directory. | ||
|
||
.. code-block:: bash | ||
# either | ||
python setup.py install | ||
# or | ||
python3 -m pip install . | ||
Examples: | ||
========= | ||
|
||
Units | ||
----- | ||
The units of physical quantities are represented by the ``Units`` class. A | ||
``Units`` object is instantiated from a valid units string and supports ions, | ||
isotopologues, as well as a few special species. This object contains | ||
attributes including the dimensions, HTML and LaTeX representations, and | ||
methods for conversion to different compatible units. | ||
|
||
.. code-block:: pycon | ||
>>> from pyqn.units import Units | ||
>>> u1 = Units('km') | ||
>>> u2 = Units('hr') | ||
>>> u3 = u1/u2 | ||
>>> print(u3) | ||
km.hr-1 | ||
>>> u4 = Units('m/s') | ||
>>> u3.conversion(u4) # OK: can convert from km/hr to m/s | ||
Out[7]: 0.2777777777777778 | ||
>>> u3.conversion(u2) # Oops: can't convert from km/hr to m! | ||
... | ||
UnitsError: Failure in units conversion: units km.hr-1[L.T-1] and hr[T] have | ||
different dimensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["setuptools>=43", "wheel"] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[metadata] | ||
# This includes the license file(s) in the wheel (requires setuptools>=42) | ||
license_files = LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,48 @@ | ||
from setuptools import setup, find_packages | ||
setup( | ||
name = 'pyqn', | ||
version = '1.2.2', | ||
packages = find_packages(), | ||
author = 'Christian Hill', | ||
url = 'https://github.com/xnx/pyqn', | ||
license = 'GPL', | ||
author_email = '[email protected]', | ||
|
||
from pathlib import Path | ||
|
||
description = 'A package for managing physical units and quantities', | ||
) | ||
root = Path(__file__).parent.resolve() | ||
|
||
# Get the long description from the README file | ||
long_description = (root / "README.rst").read_text(encoding="utf-8") | ||
|
||
setup( | ||
name="pyqn", | ||
version="1.3", | ||
description="A package for managing physical units and quantities", | ||
long_description=long_description, | ||
long_description_content_type="text/x-rst", | ||
url="https://github.com/xnx/pyqn", | ||
author="Christian Hill", | ||
author_email="[email protected]", | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Science/Research", | ||
"Topic :: Scientific/Engineering :: Chemistry", | ||
"Topic :: Scientific/Engineering :: Physics", | ||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Operating System :: OS Independent", | ||
], | ||
keywords="chemistry, units, physical quantities, unit conversion", | ||
package_dir={"": "src"}, | ||
packages=find_packages(where="src"), | ||
python_requires=">=3.6", | ||
install_requires=[ | ||
"pyparsing>=2.3", | ||
'importlib-resources>=1.0; python_version < "3.7.0"', | ||
], | ||
extras_require={"dev": ["black", "pytest-cov", "tox", "ipython"]}, | ||
# package_data will include all the resolved globs into both the wheel and sdist | ||
#package_data={}, | ||
# no need for MANIFEST.in, which should be reserved only for build-time files | ||
project_urls={ | ||
"Bug Reports": "https://github.com/xnx/pyqn/issues", | ||
}, | ||
) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters