Skip to content

Commit

Permalink
FINALLY fix gh-pages deployment???
Browse files Browse the repository at this point in the history
  • Loading branch information
yinchi committed May 4, 2024
1 parent 7adadf9 commit 2c6c49c
Show file tree
Hide file tree
Showing 136 changed files with 22,318 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/html_dir_to_gh_pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: actions/upload-pages-artifact@v3
with:
name: html-docs
path: docs/_build/html/
path: docs/html/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build-docs() {
poetry run sphinx-apidoc -fe -o docs/apidoc/ histopath_bim_des/
cd docs
poetry run make html
cp -r _build/html html
popd
}

Expand Down
4 changes: 4 additions & 0 deletions docs/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: 661ee7406388d085c75b2b522d567f0f
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added docs/html/.nojekyll
Empty file.
Binary file added docs/html/_images/Config.erd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/html/_images/uml_flowchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
550 changes: 550 additions & 0 deletions docs/html/_modules/histopath_bim_des/bim.html

Large diffs are not rendered by default.

195 changes: 195 additions & 0 deletions docs/html/_modules/histopath_bim_des/config/arrivals.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>histopath_bim_des.config.arrivals &mdash; histopath-bim-des 0.0.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=19f00094" />


<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="../../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../../_static/documentation_options.js?v=7026087e"></script>
<script src="../../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="../../../index.html" class="icon icon-home">
histopath-bim-des
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../config.html">Model Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../simulation.html">Simulation and KPI extraction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../processes.html">Histopathology processes</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">API reference:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../apidoc/histopath_bim_des.html">histopath_bim_des package</a></li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">histopath-bim-des</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../../index.html">Module code</a></li>
<li class="breadcrumb-item active">histopath_bim_des.config.arrivals</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>Source code for histopath_bim_des.config.arrivals</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;Arrival process configuration module for the histopath simulation model.&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">typing</span> <span class="k">as</span> <span class="nn">ty</span>

<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">import</span> <span class="nn">pydantic</span> <span class="k">as</span> <span class="nn">pyd</span>
<span class="kn">from</span> <span class="nn">annotated_types</span> <span class="kn">import</span> <span class="n">Annotated</span><span class="p">,</span> <span class="n">Len</span>
<span class="kn">from</span> <span class="nn">openpyxl</span> <span class="kn">import</span> <span class="n">Workbook</span>

<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">excel</span>


<div class="viewcode-block" id="ArrivalSchedule">
<a class="viewcode-back" href="../../../apidoc/histopath_bim_des.config.arrivals.html#histopath_bim_des.config.arrivals.ArrivalSchedule">[docs]</a>
<span class="k">class</span> <span class="nc">ArrivalSchedule</span><span class="p">(</span><span class="n">pyd</span><span class="o">.</span><span class="n">BaseModel</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;An arrival schedule for specimens.&quot;&quot;&quot;</span>

<span class="n">rates</span><span class="p">:</span> <span class="n">Annotated</span><span class="p">[</span><span class="n">ty</span><span class="o">.</span><span class="n">Sequence</span><span class="p">[</span><span class="n">pyd</span><span class="o">.</span><span class="n">NonNegativeFloat</span><span class="p">],</span> <span class="n">Len</span><span class="p">(</span><span class="mi">168</span><span class="p">,</span> <span class="mi">168</span><span class="p">)]</span>
<span class="s2">&quot;Hourly arrival rates for the arrival process, for one week (168 hours).&quot;</span>

<div class="viewcode-block" id="ArrivalSchedule.from_pd">
<a class="viewcode-back" href="../../../apidoc/histopath_bim_des.config.arrivals.html#histopath_bim_des.config.arrivals.ArrivalSchedule.from_pd">[docs]</a>
<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">from_pd</span><span class="p">(</span><span class="n">df</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="s1">&#39;ArrivalSchedule&#39;</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Construct an arrival schedule from a dataframe with the 24 hours the day as rows</span>
<span class="sd"> and the seven days of the week as columns (starting on Monday). Each value is the</span>
<span class="sd"> arrival rate for one hour of the week</span>

<span class="sd"> Args:</span>
<span class="sd"> df: The dataframe containing the arrival schedule information.</span>

<span class="sd"> Returns:</span>
<span class="sd"> The ArrivalSchedule object.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="vm">__class__</span><span class="p">(</span><span class="n">rates</span><span class="o">=</span><span class="n">df</span><span class="o">.</span><span class="n">to_numpy</span><span class="p">()</span><span class="o">.</span><span class="n">flatten</span><span class="p">(</span><span class="s1">&#39;F&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">())</span> <span class="c1"># F = column-major order</span></div>
</div>



<div class="viewcode-block" id="ArrivalSchedules">
<a class="viewcode-back" href="../../../apidoc/histopath_bim_des.config.arrivals.html#histopath_bim_des.config.arrivals.ArrivalSchedules">[docs]</a>
<span class="k">class</span> <span class="nc">ArrivalSchedules</span><span class="p">(</span><span class="n">pyd</span><span class="o">.</span><span class="n">BaseModel</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Dataclass for tracking the specimen arrival schedules of the histopathology model.&quot;&quot;&quot;</span>

<span class="n">cancer</span><span class="p">:</span> <span class="n">ArrivalSchedule</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Arrival schedule for cancer pathway specimens.&quot;&quot;&quot;</span>

<span class="n">noncancer</span><span class="p">:</span> <span class="n">ArrivalSchedule</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Arrival schedule for non-cancer pathway specimens.&quot;&quot;&quot;</span>

<div class="viewcode-block" id="ArrivalSchedules.from_workbook">
<a class="viewcode-back" href="../../../apidoc/histopath_bim_des.config.arrivals.html#histopath_bim_des.config.arrivals.ArrivalSchedules.from_workbook">[docs]</a>
<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">from_workbook</span><span class="p">(</span><span class="n">wbook</span><span class="p">:</span> <span class="n">Workbook</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="s1">&#39;ArrivalSchedules&#39;</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Construct a dataclass instance from an Excel workbook.</span>

<span class="sd"> Args:</span>
<span class="sd"> wbook: The Excel workbook to parse.</span>

<span class="sd"> Returns:</span>
<span class="sd"> The parsed dataclass instance.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">arrival_schedule_cancer_df</span> <span class="o">=</span> <span class="p">(</span>
<span class="n">df</span> <span class="o">:=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span>
<span class="p">(</span>
<span class="n">table</span> <span class="o">:=</span> <span class="n">excel</span><span class="o">.</span><span class="n">get_table</span><span class="p">(</span><span class="n">wbook</span><span class="p">,</span> <span class="s1">&#39;Arrival Schedules&#39;</span><span class="p">,</span> <span class="s1">&#39;ArrivalScheduleCancer&#39;</span><span class="p">)</span>
<span class="p">)[</span><span class="mi">1</span><span class="p">:],</span>
<span class="n">columns</span><span class="o">=</span><span class="n">table</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="p">)</span><span class="o">.</span><span class="n">set_index</span><span class="p">(</span><span class="s1">&#39;Hour&#39;</span><span class="p">)</span>
<span class="p">)</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span><span class="n">df</span><span class="o">.</span><span class="n">index</span> <span class="o">!=</span> <span class="s1">&#39;Total&#39;</span><span class="p">]</span>

<span class="n">arrival_schedule_noncancer_df</span> <span class="o">=</span> <span class="p">(</span>
<span class="n">df</span> <span class="o">:=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span>
<span class="p">(</span>
<span class="n">table</span> <span class="o">:=</span> <span class="n">excel</span><span class="o">.</span><span class="n">get_table</span><span class="p">(</span><span class="n">wbook</span><span class="p">,</span> <span class="s1">&#39;Arrival Schedules&#39;</span><span class="p">,</span> <span class="s1">&#39;ArrivalScheduleNonCancer&#39;</span><span class="p">)</span>
<span class="p">)[</span><span class="mi">1</span><span class="p">:],</span>
<span class="n">columns</span><span class="o">=</span><span class="n">table</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="p">)</span><span class="o">.</span><span class="n">set_index</span><span class="p">(</span><span class="s1">&#39;Hour&#39;</span><span class="p">)</span>
<span class="p">)</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span><span class="n">df</span><span class="o">.</span><span class="n">index</span> <span class="o">!=</span> <span class="s1">&#39;Total&#39;</span><span class="p">]</span>

<span class="k">return</span> <span class="n">ArrivalSchedules</span><span class="p">(</span>
<span class="n">cancer</span><span class="o">=</span><span class="n">ArrivalSchedule</span><span class="o">.</span><span class="n">from_pd</span><span class="p">(</span><span class="n">arrival_schedule_cancer_df</span><span class="p">),</span>
<span class="n">noncancer</span><span class="o">=</span><span class="n">ArrivalSchedule</span><span class="o">.</span><span class="n">from_pd</span><span class="p">(</span><span class="n">arrival_schedule_noncancer_df</span><span class="p">),</span>
<span class="p">)</span></div>
</div>

</pre></div>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2024, Yin-Chi Chan, Nicola Moretti.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
Loading

0 comments on commit 2c6c49c

Please sign in to comment.