Skip to content

Commit

Permalink
Merge pull request #77 from juhasch/fix/examples
Browse files Browse the repository at this point in the history
Update examples
  • Loading branch information
juhasch committed Apr 16, 2016
2 parents b4cf0c5 + 842599d commit 81e8f4b
Show file tree
Hide file tree
Showing 9 changed files with 818 additions and 366 deletions.
206 changes: 97 additions & 109 deletions examples/Index.ipynb
Original file line number Diff line number Diff line change
@@ -1,117 +1,105 @@
{
"metadata": {
"kernelspec": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"display_name": "IPython (Python 3)",
"language": "python",
"name": "python3"
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Physical Quantities"
]
},
"name": "",
"signature": "sha256:4e42a13d33ae49e4d1b53a3b08cee84e8219c693f9de6b85ed4fda2bc6a661ad"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Physical Quantities"
]
},
{
"cell_type": "markdown",
"metadata": {
"variables": {}
},
"source": [
"PhysicalQuantities is a python module that allows calculations to be aware of physical units. Built-in unit conversion ensures that calculations will result in the correct unit.\n",
"\n",
"The module also contains an extension for IPython. This allows much simplified usage by typing in physical quantities as number and unit:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"a = 1m ; b = 1s\n",
"print(\"a=\", a, \", b=\",b,\", a/b=\", a/b)"
],
"language": "python",
"metadata": {
"run_control": {
"breakpoint": false
}
},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"a= 1 m , b= 1 s , a/b= 1.0 m/s\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {
"variables": {}
},
"source": [
"The Github repository for this module can be found here: https://github.com/juhasch/PhysicalQuantities\n",
"\n",
"This module is based on the IPython extension by Georg Brandl: https://bitbucket.org/birkenfeld/ipython-physics.\n",
"It was converted into a standalone Python module and extended heavily to be as flexible as possible."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Notebooks"
]
},
"cell_type": "markdown",
"metadata": {},
"source": [
"PhysicalQuantities is a python module that allows calculations to be aware of physical units. Built-in unit conversion ensures that calculations will result in the correct unit.\n",
"\n",
"The module also contains an extension for IPython. This allows much simplified usage by typing in physical quantities as number and unit:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false,
"run_control": {
"breakpoint": false
}
},
"outputs": [
{
"cell_type": "markdown",
"metadata": {
"variables": {}
},
"source": [
"* [Basics and Installation](pq-basics.ipynb)\n",
"* [Using Physical Quantities in IPython](pq-ipython.ipynb)\n",
"* [Output Formatting](pq-formatting.ipynb)\n",
"* [Doing dB Calculations](pq-dbquantity.ipynb)\n",
"* [Using Numpy Arrays](pq-numpy.ipynb)\n",
"* [Autoscaling](pq-autoscale.ipynb)\n",
"* [SymPy](pq-sympy.ipynb)\n",
"* [Uncertainties](pq-uncertainties.ipynb)\n",
"* [Practical Example - Calculate a RC Circuit](pq-example.ipynb)\n"
"name": "stdout",
"output_type": "stream",
"text": [
"a= 1 m , b= 1 s , a/b= 1.0 m/s\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {
"run_control": {
"breakpoint": false
}
},
"outputs": [],
"prompt_number": 1
}
],
"metadata": {}
"source": [
"a = 1m ; b = 1s\n",
"print(\"a=\", a, \", b=\",b,\", a/b=\", a/b)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The Github repository for this module can be found here: https://github.com/juhasch/PhysicalQuantities\n",
"\n",
"This module is based on the IPython extension by Georg Brandl: https://bitbucket.org/birkenfeld/ipython-physics.\n",
"It was converted into a standalone Python module and extended heavily to be as flexible as possible."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example Notebooks"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* [Basics and Installation](pq-basics.ipynb)\n",
"* [Using Physical Quantities in IPython](pq-ipython.ipynb)\n",
"* [Output Formatting](pq-formatting.ipynb)\n",
"* [Doing dB Calculations](pq-dbquantity.ipynb)\n",
"* [Using Numpy Arrays](pq-numpy.ipynb)\n",
"* [Autoscaling](pq-autoscale.ipynb)\n",
"* [SymPy](pq-sympy.ipynb)\n",
"* [Uncertainties](pq-uncertainties.ipynb)\n",
"* [Practical Example - Calculate a RC Circuit](pq-example.ipynb)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
25 changes: 23 additions & 2 deletions examples/pq-autoscale.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"outputs": [
{
"data": {
"text/latex": [
"1.0 $\\text{mm}$"
],
"text/markdown": [
"1.0 $\\text{mm}$"
],
Expand All @@ -49,6 +52,9 @@
"outputs": [
{
"data": {
"text/latex": [
"300.0 $\\text{µs}$"
],
"text/markdown": [
"300.0 $\\text{µs}$"
],
Expand All @@ -75,6 +81,9 @@
"outputs": [
{
"data": {
"text/latex": [
"1.0 $\\text{m}$"
],
"text/markdown": [
"1.0 $\\text{m}$"
],
Expand All @@ -99,8 +108,20 @@
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"s 4\n",
"A 2\n",
"m 2\n"
]
},
{
"data": {
"text/latex": [
"3.00 $\\text{nF}$"
],
"text/markdown": [
"3.00 $\\text{nF}$"
],
Expand Down Expand Up @@ -145,9 +166,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.3"
"version": "3.4.4"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
Loading

0 comments on commit 81e8f4b

Please sign in to comment.