Skip to content

Commit

Permalink
Improving documentation, in process.
Browse files Browse the repository at this point in the history
  • Loading branch information
dprada committed May 25, 2021
1 parent f95fa8a commit 6f93a8a
Show file tree
Hide file tree
Showing 99 changed files with 5,223 additions and 9,811 deletions.
Binary file removed docs/_build/doctrees/contents/AAA.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/contents/Convert.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/contents/Dimensionality.doctree
Binary file not shown.
Binary file removed docs/_build/doctrees/contents/Forms.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/contents/Importing.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/contents/In_Your_Library.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_build/doctrees/contents/Quick_Guide.doctree
Binary file not shown.
Binary file removed docs/_build/doctrees/contents/Quick_Tutorial.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/contents/Standardize.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/contents/Strings.doctree
Binary file not shown.
Binary file removed docs/_build/doctrees/contents/Translate.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
51 changes: 0 additions & 51 deletions docs/_build/doctrees/nbsphinx/contents/AAA.ipynb

This file was deleted.

122 changes: 116 additions & 6 deletions docs/_build/doctrees/nbsphinx/contents/Convert.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"metadata": {},
"source": [
"# Convert quantities\n",
"*Text*\n",
"*Quantities can be converted into other form and units with PyUnitWizard.*\n",
"\n",
"Text here"
"To facilitate the conversion of units between different forms, PyUnitWizard includes the method `pyunitwizard.convert()`. This way quantities and units can be converted between different forms and units:"
]
},
{
Expand All @@ -31,17 +31,127 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": []
"source": [
"puw.configure.load_libraries(['pint', 'simtk.unit'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": []
"source": [
"q = puw.quantity(value=3.0, unit='joules', form='simtk.unit')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"q2 = puw.convert(q, to_unit='kilocalories', to_form='pint')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"0.0007170172084130018 kilocalorie"
],
"text/latex": [
"$0.0007170172084130018\\ \\mathrm{kilocalorie}$"
],
"text/plain": [
"0.0007170172084130018 <Unit('kilocalorie')>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"q2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If the output form is not specified with the argument `to_form`, a quantity with the same form is obtained:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"q = puw.quantity(value=1000.0, unit='kN/m**2', form='pint')"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"q2 = puw.convert(q, to_unit='atmospheres')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"9.869232667160128 standard_atmosphere"
],
"text/latex": [
"$9.869232667160128\\ \\mathrm{standard\\_atmosphere}$"
],
"text/plain": [
"9.869232667160128 <Unit('standard_atmosphere')>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"q2"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'pint'"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"puw.get_form(q2)"
]
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 6f93a8a

Please sign in to comment.