Skip to content

Commit

Permalink
Documentation and removing string literals and replacing with enums
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinFasusi committed Feb 16, 2016
1 parent 410a6c6 commit fc56d25
Show file tree
Hide file tree
Showing 36 changed files with 464 additions and 146 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ An alternative is to clone the repository and run `python setup.py install`
- NumPy
- pandas
- matplotlib

- xlwings
- openpyxl

##Python Version

Expand Down Expand Up @@ -64,7 +65,7 @@ change promptly.
Further examples and explanations will be available in the documentation. Please find below.


Documentation:
[Documentation](http://supplychainpy.readthedocs.org/)

Website:

Expand Down
2 changes: 2 additions & 0 deletions docs/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Optional Dependencies
- pandas
- matplotlib
- Ipython
- openpyxl
- xlwings

Installing the `Anaconda <https://www.continuum.io/downloads>`_ package may be preferable as it comes with Python 3.5 and
all the dependencies.
Binary file modified docs/_build/doctrees/Installation.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.
Binary file modified docs/_build/doctrees/ipythontest.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/modules.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/quickstart.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/supplychainpy.demand.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/supplychainpy.distribution.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/supplychainpy.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/supplychainpy.production.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/supplychainpy.warehouse.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/tutorial.doctree
Binary file not shown.
10 changes: 9 additions & 1 deletion docs/_build/html/Installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#inventory-analysis">Inventory Analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#where-to-go-from-here">Where to go from here?</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#features-in-development">Features in development</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Supplychainpy, Xlwings, Pandas and Ipython Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#inventory-analysis-example">Inventory Analysis Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#demand-planning-and-forecasting">Demand Planning and Forecasting</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#warehousing-and-picking-and-packing">Warehousing and Picking and Packing</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#distribution-optimisation">Distribution Optimisation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#simulation">Simulation</a></li>
</ul>


Expand Down Expand Up @@ -154,6 +160,8 @@ <h2>Optional Dependencies<a class="headerlink" href="#optional-dependencies" tit
<li>pandas</li>
<li>matplotlib</li>
<li>Ipython</li>
<li>openpyxl</li>
<li>xlwings</li>
</ul>
<p>Installing the <a class="reference external" href="https://www.continuum.io/downloads">Anaconda</a> package may be preferable as it comes with Python 3.5 and
all the dependencies.</p>
Expand Down
2 changes: 2 additions & 0 deletions docs/_build/html/_sources/Installation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Optional Dependencies
- pandas
- matplotlib
- Ipython
- openpyxl
- xlwings

Installing the `Anaconda <https://www.continuum.io/downloads>`_ package may be preferable as it comes with Python 3.5 and
all the dependencies.
85 changes: 75 additions & 10 deletions docs/_build/html/_sources/quickstart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ While the supplychainpy library can be used in any way you deem fit, the library
is reliant on Excel, Excel formulas and VBA. First we go through the use cases and implementations specific to the
domain (supply chain, operations and manufacturing), before covering the technologies that allow you to work with Excel.

Inventory Analysis
==================
Summarising Inventory
---------------------

Calculating the critical values for inventory analysis using a spreadsheet requires several
A quick example of a typical inventory analysis takes several formulas, manual processes or pivot tables and in
some cases vba to achieve. With supplychainpy the same analysis can be achieved in 10 lines of code
(**only 3 lines of code** for the analysis and another 7 to get the results into Excel). In the example below supplying
a `dict` of "Orders" data-points can generate a summary that includes:

Summarising Inventory
----------------------
- demand variability
- reorder level
- safety stock
- reorder quantities ...

.. code:: python

Expand All @@ -24,12 +29,72 @@ Summarising Inventory
>>> 'sep': 25, 'oct': 25, 'nov': 25, 'dec': 25}
>>> summary = model_inventory.analyse_orders(data_set= yearly_demand,
>>> sku_id='RX983-90',
>>> lead_time=3, unit_cost=.99,
>>> reorder_cost=400,z_value= 1.28)
>>> lead_time=Decimal(3), unit_cost=Decimal(34.99),
>>> reorder_cost=Decimal(400),z_value=Decimal(1.28)
>>> print(summary)

.. parsed-literal::

{'economic_order_quantity': '0', 'standard_deviation': '25','demand_variability': '0.500', 'sku': 'RX983-90',
'reorder_level': '142', 'average_order': '50', 'safety_stock': '55', 'economic_order_variable_cost': '0.00',
'revenue': '30594.00', 'reorder_quantity': '56', 'ABC_XYZ_Classification': ''}
{'standard_deviation': '25',
'demand_variability': '0.500', 'sku': 'RX983-90',
'reorder_level': '142', 'average_order': '50',
'safety_stock': '55', 'economic_order_variable_cost': '0.00',
'revenue': '30594.00', 'reorder_quantity': '56'}

The same analysis can be made by supplying a preformatted `.csv` or `.txt`:

.. code:: python

>>> from supplychainpy.model_inventory import analyse_orders_abcxyz_from_file
>>> from supplychainpy.enum_formats import FileFormats
>>> abc = analyse_orders_abcxyz_from_file(file_path="data.csv", z_value= 1.28,
>>> reorder_cost=Decimal(5000), file_type="text")
>>> for sku in abc.orders
>>> print ('Sku: {} Economic Order Quantity: {} Sku Revenue: {} ABCXYZ Classification: {}'
>>> .format(sku.sku_id sku.economic_order_qty, sku.revenue, sku.abcxyz_classification)


Using openpyxl or xlwings this analysis can be placed in a worksheet or used in further calculations. Below is an
xlwings example:

.. code:: python

>>> from xlwings import Workbook, Range
>>> from supplychainpy.model_inventory import analyse_orders_abcxyz_from_file
>>> wb = Workbook(r'~/Desktop/test.xlsx'), Range
>>> abc = analyse_orders_abcxyz_from_file(file_path="data.csv", z_value= 1.28, reorder_cost=5000, file_type="csv")
>>> x = 1
>>> for sku in abc.orders:
>>> Range('A'+ str(x)).value = sku.sku_id
>>> Range('B' + str(x)).value = float(sku.economic_order_qty)
>>> Range('C' + str(x)).value = float(sku.revenue)
>>> Range('D' + str(x)).value = sku.abcxyz_classification
>>> +=1

The columns A-D will now be populated with the values indicated.



Where to go from here?
======================

While the library is currently in development there are several ways the current functionality can be extended:

Filtering
---------
Using python list comprehensions or yield to filter in comparison to using pivot tables.

Further Analysis
----------------


Features in development
=======================



You are more than a filthy sheet spreader!
------------------------------------------

Much maligned but an essential tool

33 changes: 31 additions & 2 deletions docs/_build/html/_sources/tutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,47 @@ The book is in its 1st edition (1 Nov 2012) but still very relevant and useful.

Fire up the unix

Inventory Analysis Example
==========================

Calculating the critical values for inventory analysis using a spreadsheet, often requires several steps. Extracting
transforming and loading (ETL) data, writing formulas, manual processes or pivot tables and in some cases vba. This
process is time consuming, repetitive, does not scale and could benefit from automation. Often the ETL is the first
part of that gets automated, while the rise in self service business intelligence tools assist a comprehensive library
in a productive language is a useful middle ground. Supplychainpy, Python and the expansive libraries fulfils the niche
for rolling out a scalable and automated suite of analysis.

Inventory Analysis
------------------

The inventory analysis functions can be accessed from supplychainpy by importing `model_inventory`.


Demand Planning and Forecasting
===============================



Warehousing and Picking and Packing
===================================



Distribution Optimisation
=========================


Simulation
==========

Monte Carlo simulation
----------------------

Agent based modeling
--------------------



Are you a dirty sheet spreader?
-------------------------------



Expand Down
51 changes: 11 additions & 40 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,14 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="Installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#inventory-analysis">Inventory Analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#where-to-go-from-here">Where to go from here?</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#features-in-development">Features in development</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Supplychainpy, Xlwings, Pandas and Ipython Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#inventory-analysis-example">Inventory Analysis Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#demand-planning-and-forecasting">Demand Planning and Forecasting</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#warehousing-and-picking-and-packing">Warehousing and Picking and Packing</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#distribution-optimisation">Distribution Optimisation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#simulation">Simulation</a></li>
</ul>


Expand Down Expand Up @@ -136,7 +142,6 @@ <h1 id="index">Index</h1>
| <a href="#D"><strong>D</strong></a>
| <a href="#E"><strong>E</strong></a>
| <a href="#F"><strong>F</strong></a>
| <a href="#G"><strong>G</strong></a>
| <a href="#L"><strong>L</strong></a>
| <a href="#M"><strong>M</strong></a>
| <a href="#O"><strong>O</strong></a>
Expand Down Expand Up @@ -365,16 +370,6 @@ <h2 id="F">F</h2>
</dl></td>
</tr></table>

<h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>

<dt><a href="supplychainpy.demand.html#supplychainpy.demand.analyse_uncertain_demand.OrdersUncertainDemandFactory.get_orders">get_orders() (supplychainpy.demand.analyse_uncertain_demand.OrdersUncertainDemandFactory method)</a>
</dt>

</dl></td>
</tr></table>

<h2 id="L">L</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
Expand Down Expand Up @@ -454,28 +449,14 @@ <h2 id="O">O</h2>
</dt>

</dl></dd>

<dt><a href="supplychainpy.demand.html#supplychainpy.demand.abc_xyz.AbcXyz.orders">orders (supplychainpy.demand.abc_xyz.AbcXyz attribute)</a>
</dt>

</dl></td>
<td style="width: 33%" valign="top"><dl>

<dt><a href="supplychainpy.demand.html#supplychainpy.demand.analyse_uncertain_demand.OrdersUncertainDemandAbstraction.orders_summary">orders_summary() (supplychainpy.demand.analyse_uncertain_demand.OrdersUncertainDemandAbstraction method)</a>
</dt>

<dd><dl>

<dt><a href="supplychainpy.demand.html#supplychainpy.demand.analyse_uncertain_demand.UncertainDemand.orders_summary">(supplychainpy.demand.analyse_uncertain_demand.UncertainDemand method)</a>
</dt>

</dl></dd>

<dt><a href="supplychainpy.demand.html#supplychainpy.demand.analyse_uncertain_demand.OrdersUncertainDemandAbstraction">OrdersUncertainDemandAbstraction (class in supplychainpy.demand.analyse_uncertain_demand)</a>
<dt><a href="supplychainpy.demand.html#supplychainpy.demand.abc_xyz.AbcXyz.orders">orders (supplychainpy.demand.abc_xyz.AbcXyz attribute)</a>
</dt>


<dt><a href="supplychainpy.demand.html#supplychainpy.demand.analyse_uncertain_demand.OrdersUncertainDemandFactory">OrdersUncertainDemandFactory (class in supplychainpy.demand.analyse_uncertain_demand)</a>
<dt><a href="supplychainpy.demand.html#supplychainpy.demand.analyse_uncertain_demand.UncertainDemand.orders_summary">orders_summary() (supplychainpy.demand.analyse_uncertain_demand.UncertainDemand method)</a>
</dt>

</dl></td>
Expand All @@ -492,14 +473,10 @@ <h2 id="P">P</h2>
<dt><a href="supplychainpy.demand.html#supplychainpy.demand.abc_xyz.AbcXyz.percentage_revenue">percentage_revenue() (supplychainpy.demand.abc_xyz.AbcXyz method)</a>
</dt>


<dt><a href="supplychainpy.html#supplychainpy.enum_formats.PeriodFormats">PeriodFormats (class in supplychainpy.enum_formats)</a>
</dt>

</dl></td>
<td style="width: 33%" valign="top"><dl>

<dt><a href="supplychainpy.demand.html#supplychainpy.demand.analyse_uncertain_demand.UncertainDemandNp.print_period">print_period() (supplychainpy.demand.analyse_uncertain_demand.UncertainDemandNp method)</a>
<dt><a href="supplychainpy.html#supplychainpy.enum_formats.PeriodFormats">PeriodFormats (class in supplychainpy.enum_formats)</a>
</dt>


Expand Down Expand Up @@ -644,12 +621,6 @@ <h2 id="T">T</h2>
<dt><a href="supplychainpy.html#supplychainpy.enum_formats.FileFormats.text">text (supplychainpy.enum_formats.FileFormats attribute)</a>
</dt>

</dl></td>
<td style="width: 33%" valign="top"><dl>

<dt><a href="supplychainpy.demand.html#supplychainpy.demand.analyse_uncertain_demand.UncertainDemandNp.total_orders">total_orders (supplychainpy.demand.analyse_uncertain_demand.UncertainDemandNp attribute)</a>
</dt>

</dl></td>
</tr></table>

Expand All @@ -663,7 +634,7 @@ <h2 id="U">U</h2>
</dl></td>
<td style="width: 33%" valign="top"><dl>

<dt><a href="supplychainpy.demand.html#supplychainpy.demand.analyse_uncertain_demand.UncertainDemandNp">UncertainDemandNp (class in supplychainpy.demand.analyse_uncertain_demand)</a>
<dt><a href="supplychainpy.demand.html#supplychainpy.demand.analyse_uncertain_demand.UncertainDemandSimple">UncertainDemandSimple (class in supplychainpy.demand.analyse_uncertain_demand)</a>
</dt>

</dl></td>
Expand Down
32 changes: 28 additions & 4 deletions docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,14 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="Installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#inventory-analysis">Inventory Analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#where-to-go-from-here">Where to go from here?</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#features-in-development">Features in development</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Supplychainpy, Xlwings, Pandas and Ipython Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#inventory-analysis-example">Inventory Analysis Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#demand-planning-and-forecasting">Demand Planning and Forecasting</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#warehousing-and-picking-and-packing">Warehousing and Picking and Packing</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#distribution-optimisation">Distribution Optimisation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#simulation">Simulation</a></li>
</ul>


Expand Down Expand Up @@ -139,15 +145,33 @@ <h1>Welcome to supplychainpy&#8217;s documentation!<a class="headerlink" href="#
<li class="toctree-l2"><a class="reference internal" href="Installation.html#optional-dependencies">Optional Dependencies</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#inventory-analysis">Inventory Analysis</a><ul>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick Guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#summarising-inventory">Summarising Inventory</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#where-to-go-from-here">Where to go from here?</a><ul>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#filtering">Filtering</a></li>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#further-analysis">Further Analysis</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#features-in-development">Features in development</a><ul>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#you-are-more-than-a-filthy-sheet-spreader">You are more than a filthy sheet spreader!</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Supplychainpy, Xlwings, Pandas and Ipython Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial.html#ipython-the-command-line-cli-or-an-integrated-development-environment-ide">Ipython, the command line (cli) or an integrated development environment (IDE)</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#inventory-analysis-example">Inventory Analysis Example</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial.html#inventory-analysis">Inventory Analysis</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial.html#are-you-a-dirty-sheet-spreader">Are you a dirty sheet spreader?</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#demand-planning-and-forecasting">Demand Planning and Forecasting</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#warehousing-and-picking-and-packing">Warehousing and Picking and Packing</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#distribution-optimisation">Distribution Optimisation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#simulation">Simulation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial.html#monte-carlo-simulation">Monte Carlo simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial.html#agent-based-modeling">Agent based modeling</a></li>
</ul>
</li>
</ul>
Expand Down
8 changes: 7 additions & 1 deletion docs/_build/html/ipythontest.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,14 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="Installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#inventory-analysis">Inventory Analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#where-to-go-from-here">Where to go from here?</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html#features-in-development">Features in development</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Supplychainpy, Xlwings, Pandas and Ipython Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#inventory-analysis-example">Inventory Analysis Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#demand-planning-and-forecasting">Demand Planning and Forecasting</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#warehousing-and-picking-and-packing">Warehousing and Picking and Packing</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#distribution-optimisation">Distribution Optimisation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html#simulation">Simulation</a></li>
</ul>


Expand Down

0 comments on commit fc56d25

Please sign in to comment.