Skip to content

Commit

Permalink
add more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
elpham6 authored and elpham6 committed May 9, 2024
1 parent 34f6ddb commit 48e2307
Show file tree
Hide file tree
Showing 97 changed files with 8,321 additions and 0 deletions.
Binary file not shown.
Binary file added docs/_build/doctrees/auto_examples/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added docs/_build/doctrees/calculator.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/calculator.intro.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/_build/doctrees/helloworld.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/modules.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/overview.calculator.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/overview.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/overview.helloworld.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/sg_execution_times.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 0025beda8fc0d120d54fafe2ae70fca1
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""
Calculator Example
##################
This is some example code using functions from the calculator module.
"""
import os
import sys
sys.path.insert(0, os.path.abspath("../src"))
from calculator import sum, subtract, multiply, divide

# Example numbers for operations
number1 = 8
number2 = 2

# Using the sum function to add two numbers
result_addition = sum(number1, number2)
print(f"The sum of {number1} and {number2} is {result_addition}.")

# Using the subtract function to subtract the second number from the first
result_subtraction = subtract(number1, number2)
print(f"The result of subtracting {number2} from {number1} is {result_subtraction}.")

# Using the multiply function to multiply two numbers
result_multiplication = multiply(number1, number2)
print(f"The product of {number1} and {number2} is {result_multiplication}.")

# Using the divide function to divide the first number by the second
try:
result_division = divide(number1, number2)
print(f"The quotient of {number1} divided by {number2} is {result_division}.")
except ZeroDivisionError:
print("Cannot divide by zero.")

# Attempt to divide by zero to demonstrate error handling
try:
zero_division_test = divide(number1, 0)
except ZeroDivisionError:
print("An error occurred: cannot divide by zero.")
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Calculator Example\n\nThis is some example code using functions from the calculator module.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import os\nimport sys\nsys.path.insert(0, os.path.abspath(\"../src\"))\nfrom calculator import sum, subtract, multiply, divide\n\n# Example numbers for operations\nnumber1 = 8\nnumber2 = 2\n\n# Using the sum function to add two numbers\nresult_addition = sum(number1, number2)\nprint(f\"The sum of {number1} and {number2} is {result_addition}.\")\n\n# Using the subtract function to subtract the second number from the first\nresult_subtraction = subtract(number1, number2)\nprint(f\"The result of subtracting {number2} from {number1} is {result_subtraction}.\")\n\n# Using the multiply function to multiply two numbers\nresult_multiplication = multiply(number1, number2)\nprint(f\"The product of {number1} and {number2} is {result_multiplication}.\")\n\n# Using the divide function to divide the first number by the second\ntry:\n result_division = divide(number1, number2)\n print(f\"The quotient of {number1} divided by {number2} is {result_division}.\")\nexcept ZeroDivisionError:\n print(\"Cannot divide by zero.\")\n\n# Attempt to divide by zero to demonstrate error handling\ntry:\n zero_division_test = divide(number1, 0)\nexcept ZeroDivisionError:\n print(\"An error occurred: cannot divide by zero.\")"
]
}
],
"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.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions docs/_build/html/_sources/auto_examples/calc_example.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples/calc_example.py"
.. LINE NUMBERS ARE GIVEN BELOW.
.. only:: html

.. note::
:class: sphx-glr-download-link-note

:ref:`Go to the end <sphx_glr_download_auto_examples_calc_example.py>`
to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_calc_example.py:


Calculator Example
##################

This is some example code using functions from the calculator module.

.. GENERATED FROM PYTHON SOURCE LINES 8-40
.. code-block:: Python
import os
import sys
sys.path.insert(0, os.path.abspath("../src"))
from calculator import sum, subtract, multiply, divide
# Example numbers for operations
number1 = 8
number2 = 2
# Using the sum function to add two numbers
result_addition = sum(number1, number2)
print(f"The sum of {number1} and {number2} is {result_addition}.")
# Using the subtract function to subtract the second number from the first
result_subtraction = subtract(number1, number2)
print(f"The result of subtracting {number2} from {number1} is {result_subtraction}.")
# Using the multiply function to multiply two numbers
result_multiplication = multiply(number1, number2)
print(f"The product of {number1} and {number2} is {result_multiplication}.")
# Using the divide function to divide the first number by the second
try:
result_division = divide(number1, number2)
print(f"The quotient of {number1} divided by {number2} is {result_division}.")
except ZeroDivisionError:
print("Cannot divide by zero.")
# Attempt to divide by zero to demonstrate error handling
try:
zero_division_test = divide(number1, 0)
except ZeroDivisionError:
print("An error occurred: cannot divide by zero.")
.. _sphx_glr_download_auto_examples_calc_example.py:

.. only:: html

.. container:: sphx-glr-footer sphx-glr-footer-example

.. container:: sphx-glr-download sphx-glr-download-jupyter

:download:`Download Jupyter notebook: calc_example.ipynb <calc_example.ipynb>`

.. container:: sphx-glr-download sphx-glr-download-python

:download:`Download Python source code: calc_example.py <calc_example.py>`


.. only:: html

.. rst-class:: sphx-glr-signature

`Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
59 changes: 59 additions & 0 deletions docs/_build/html/_sources/auto_examples/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
:orphan:

Calculator Examples
###################

This folder contains example code for the **calculator.py** module.


.. raw:: html

<div class="sphx-glr-thumbnails">


.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="This is some example code using functions from the calculator module.">

.. only:: html

.. image:: /auto_examples/images/thumb/sphx_glr_calc_example_thumb.png
:alt:

:ref:`sphx_glr_auto_examples_calc_example.py`

.. raw:: html

<div class="sphx-glr-thumbnail-title">Calculator Example</div>
</div>


.. raw:: html

</div>


.. toctree::
:hidden:

/auto_examples/calc_example


.. only:: html

.. container:: sphx-glr-footer sphx-glr-footer-gallery

.. container:: sphx-glr-download sphx-glr-download-python

:download:`Download all examples in Python source code: auto_examples_python.zip </auto_examples/auto_examples_python.zip>`

.. container:: sphx-glr-download sphx-glr-download-jupyter

:download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip </auto_examples/auto_examples_jupyter.zip>`


.. only:: html

.. rst-class:: sphx-glr-signature

`Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
37 changes: 37 additions & 0 deletions docs/_build/html/_sources/auto_examples/sg_execution_times.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

:orphan:

.. _sphx_glr_auto_examples_sg_execution_times:


Computation times
=================
**00:00.000** total execution time for 1 file **from auto_examples**:

.. container::

.. raw:: html

<style scoped>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap5.min.css" rel="stylesheet" />
</style>
<script src="https://code.jquery.com/jquery-3.7.0.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap5.min.js"></script>
<script type="text/javascript" class="init">
$(document).ready( function () {
$('table.sg-datatable').DataTable({order: [[1, 'desc']]});
} );
</script>

.. list-table::
:header-rows: 1
:class: table table-striped sg-datatable

* - Example
- Time
- Mem (MB)
* - :ref:`sphx_glr_auto_examples_calc_example.py` (``calc_example.py``)
- 00:00.000
- 0.0
25 changes: 25 additions & 0 deletions docs/_build/html/_sources/calculator.intro.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Calculator
##########

The module **calculator.py** provides four methods that perform very basic mathematical functions.

1. sum(x, y)
=============

This adds two numbers and returns their sum.

2. subtract(x, y)
=================

This subtracts y from x and returns the result.

3. multiply(x, y)
=================

This returns the product of x and y.

4. divide(x, y)
===============

This returns the quotient of two numbers.

7 changes: 7 additions & 0 deletions docs/_build/html/_sources/calculator.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
calculator module
=================

.. automodule:: calculator
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/_build/html/_sources/helloworld.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
helloworld module
===================

.. automodule:: helloworld
:members:
:undoc-members:
:show-inheritance:
24 changes: 24 additions & 0 deletions docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. Sphinx Demo documentation master file, created by
sphinx-quickstart on Wed May 8 21:58:44 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Sphinx Demo's documentation!
=======================================

.. toctree::
:maxdepth: 4
:caption: Contents:

overview
calculator
helloworld
auto_examples/index


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
8 changes: 8 additions & 0 deletions docs/_build/html/_sources/modules.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
src
===

.. toctree::
:maxdepth: 4

calculator
helloworld
25 changes: 25 additions & 0 deletions docs/_build/html/_sources/overview.calculator.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Calculator
##########

The module **calculator.py** provides four methods that perform very basic mathematical functions.

1. sum(x, y)
=============

This adds two numbers and returns their sum.

2. subtract(x, y)
=================

This subtracts y from x and returns the result.

3. multiply(x, y)
=================

This returns the product of x and y.

4. divide(x, y)
===============

This returns the quotient of two numbers.

5 changes: 5 additions & 0 deletions docs/_build/html/_sources/overview.helloworld.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Hello World
###########

This module provides two simple functions that says "hello" in two different languages respectively.

10 changes: 10 additions & 0 deletions docs/_build/html/_sources/overview.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Demo Modules Overview
#####################

This demo has two modules in ``src``: **calculator.py** and **helloworld.py**.

.. toctree::
:maxdepth: 4

overview.calculator
overview.helloworld
Loading

0 comments on commit 48e2307

Please sign in to comment.