Skip to content

Commit

Permalink
Deploying to gh-pages from @ 6ac79fa 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
tschm committed Dec 25, 2023
1 parent 4880459 commit c5c5dab
Show file tree
Hide file tree
Showing 39 changed files with 990 additions and 144 deletions.
2 changes: 2 additions & 0 deletions build/show.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ bson 0.5.10 BSON codec for Python
├── python-dateutil >=2.4.0
│ └── six >=1.5
└── six >=1.9.0
jinja2 3.1.2 A very fast and expressive template engine.
└── markupsafe >=2.0
numpy 1.26.2 Fundamental package for array computing in Python
numpyencoder 0.3.0 Python JSON encoder for handling Numpy data types.
└── numpy >=1.14.3
Expand Down
Binary file added sphinx/.doctrees/autoapi/data/index.doctree
Binary file not shown.
Binary file not shown.
Binary file modified sphinx/.doctrees/autoapi/index.doctree
Binary file not shown.
Binary file modified sphinx/.doctrees/environment.pickle
Binary file not shown.
16 changes: 15 additions & 1 deletion sphinx/_modules/bson/io.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ <h1>Source code for bson.io</h1><div class="highlight"><pre>
<span class="c1"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<span class="c1"># See the License for the specific language governing permissions and</span>
<span class="c1"># limitations under the License.</span>
<span class="kn">import</span> <span class="nn">json</span>
<span class="kn">from</span> <span class="nn">io</span> <span class="kn">import</span> <span class="n">BytesIO</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Union</span>

Expand Down Expand Up @@ -122,9 +123,19 @@ <h1>Source code for bson.io</h1><div class="highlight"><pre>
<span class="n">result</span><span class="o">.</span><span class="n">seek</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="k">return</span> <span class="n">result</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>

<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Invalid Datatype </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">data</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span></div>
<span class="n">converted</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">data</span><span class="p">)</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">encoding</span><span class="o">=</span><span class="s2">&quot;utf-8&quot;</span><span class="p">)</span>
<span class="n">arr</span> <span class="o">=</span> <span class="nb">bytes</span><span class="p">(</span><span class="s2">&quot;cvx&quot;</span><span class="p">,</span> <span class="s2">&quot;utf-8&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">arr</span> <span class="o">+</span> <span class="n">converted</span></div>


<span class="c1"># return bytes.</span>
<span class="c1"># print(encoded_tuple)</span>
<span class="c1"># decoded_color = encoded_color.decode()</span>
<span class="c1"># orginal_form = json.load(decoded_color)</span>
<span class="c1"># return</span>

<span class="c1"># raise TypeError(f&quot;Invalid Datatype {type(data)}&quot;)</span>


<div class="viewcode-block" id="decode">
<a class="viewcode-back" href="../../autoapi/bson/io/index.html#bson.io.decode">[docs]</a>
Expand All @@ -149,6 +160,9 @@ <h1>Source code for bson.io</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">header</span> <span class="o">==</span> <span class="sa">b</span><span class="s2">&quot;PAR&quot;</span><span class="p">:</span>
<span class="k">return</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_parquet</span><span class="p">(</span><span class="n">BytesIO</span><span class="p">(</span><span class="n">data</span><span class="p">))</span>

<span class="k">if</span> <span class="n">header</span> <span class="o">==</span> <span class="sa">b</span><span class="s2">&quot;cvx&quot;</span><span class="p">:</span>
<span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="mi">3</span><span class="p">:]</span><span class="o">.</span><span class="n">decode</span><span class="p">())</span>

<span class="c1"># if still here we try numpy</span>
<span class="k">return</span> <span class="n">pa</span><span class="o">.</span><span class="n">ipc</span><span class="o">.</span><span class="n">read_tensor</span><span class="p">(</span><span class="n">data</span><span class="p">)</span><span class="o">.</span><span class="n">to_numpy</span><span class="p">()</span></div>

Expand Down
141 changes: 141 additions & 0 deletions sphinx/_modules/data/render.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<!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>data.render &mdash; cvxbson 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" />
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css?v=eafc0fe6" />
<link rel="stylesheet" type="text/css" href="../../_static/custom.css?v=c267ad58" />


<!--[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=5929fcd5"></script>
<script src="../../_static/doctools.js?v=888ff710"></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">
cvxbson
</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">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../license.html">License</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../autoapi/index.html">API Reference</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">cvxbson</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">data.render</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 data.render</h1><div class="highlight"><pre>
<span></span><span class="c1"># Copyright 2023 Stanford University Convex Optimization Group</span>
<span class="c1">#</span>
<span class="c1"># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
<span class="c1"># you may not use this file except in compliance with the License.</span>
<span class="c1"># You may obtain a copy of the License at</span>
<span class="c1">#</span>
<span class="c1"># http://www.apache.org/licenses/LICENSE-2.0</span>
<span class="c1">#</span>
<span class="c1"># Unless required by applicable law or agreed to in writing, software</span>
<span class="c1"># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<span class="c1"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<span class="c1"># See the License for the specific language governing permissions and</span>
<span class="c1"># limitations under the License.</span>
<span class="sd">&quot;&quot;&quot;Create a dataclass from a template&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>

<span class="kn">from</span> <span class="nn">jinja2</span> <span class="kn">import</span> <span class="n">Template</span>


<div class="viewcode-block" id="render">
<a class="viewcode-back" href="../../autoapi/data/render/index.html#data.render.render">[docs]</a>
<span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="n">names</span><span class="p">,</span> <span class="n">strategy</span><span class="p">):</span>
<span class="c1"># gain this dictionary through reflection</span>
<span class="c1"># every table has a shortname, e.g. prices and a longer descriptive name</span>
<span class="c1"># we use the shortname to name the variable refering to the code</span>
<span class="c1"># names = {&quot;A&quot;: &quot;AAA&quot;, &quot;B&quot;: &quot;BBB&quot;, &quot;C&quot;: &quot;CCC&quot;}</span>
<span class="n">path</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)</span><span class="o">.</span><span class="n">parent</span>

<span class="c1"># open the template</span>
<span class="n">template</span> <span class="o">=</span> <span class="n">Template</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">path</span> <span class="o">/</span> <span class="s2">&quot;data_api.py.jinja2&quot;</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">&quot;utf-8&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>

<span class="c1"># we copy &amp; paste the new class into a new file</span>
<span class="k">return</span> <span class="n">template</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="n">names</span><span class="o">=</span><span class="n">names</span><span class="p">,</span> <span class="n">strategy</span><span class="o">=</span><span class="n">strategy</span><span class="p">)</span></div>

</pre></div>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright .</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>
1 change: 1 addition & 0 deletions sphinx/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ <h1>All modules for which code is available</h1>
<ul><li><a href="bson/dataclass.html">bson.dataclass</a></li>
<li><a href="bson/file.html">bson.file</a></li>
<li><a href="bson/io.html">bson.io</a></li>
<li><a href="data/render.html">data.render</a></li>
<li><a href="json/file.html">json.file</a></li>
</ul>

Expand Down
15 changes: 15 additions & 0 deletions sphinx/_sources/autoapi/data/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:py:mod:`data`
==============

.. py:module:: data
Submodules
----------
.. toctree::
:titlesonly:
:maxdepth: 1

render/index.rst


27 changes: 27 additions & 0 deletions sphinx/_sources/autoapi/data/render/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
:py:mod:`data.render`
=====================

.. py:module:: data.render
.. autoapi-nested-parse::

Create a dataclass from a template



Module Contents
---------------


Functions
~~~~~~~~~

.. autoapisummary::

data.render.render



.. py:function:: render(names, strategy)
1 change: 1 addition & 0 deletions sphinx/_sources/autoapi/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This page contains auto-generated API reference documentation [#f1]_.
.. toctree::
:titlesonly:

/autoapi/data/index
/autoapi/bson/index
/autoapi/json/index

Expand Down
1 change: 1 addition & 0 deletions sphinx/autoapi/bson/dataclass/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../data/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">data</span></code></a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../index.html#submodules">Submodules</a><ul class="current">
<li class="toctree-l4 current"><a class="current reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.dataclass</span></code></a></li>
Expand Down
1 change: 1 addition & 0 deletions sphinx/autoapi/bson/file/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../data/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">data</span></code></a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../index.html#submodules">Submodules</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="../dataclass/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.dataclass</span></code></a></li>
Expand Down
5 changes: 3 additions & 2 deletions sphinx/autoapi/bson/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="bson.dataclass" href="dataclass/index.html" />
<link rel="prev" title="API Reference" href="../index.html" />
<link rel="prev" title="data.render" href="../data/render/index.html" />
</head>

<body class="wy-body-for-nav">
Expand All @@ -51,6 +51,7 @@
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../data/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">data</span></code></a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#submodules">Submodules</a><ul>
<li class="toctree-l4"><a class="reference internal" href="dataclass/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.dataclass</span></code></a></li>
Expand Down Expand Up @@ -108,7 +109,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="../index.html" class="btn btn-neutral float-left" title="API Reference" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="../data/render/index.html" class="btn btn-neutral float-left" title="data.render" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="dataclass/index.html" class="btn btn-neutral float-right" title="bson.dataclass" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

Expand Down
1 change: 1 addition & 0 deletions sphinx/autoapi/bson/io/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../data/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">data</span></code></a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../index.html#submodules">Submodules</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="../dataclass/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.dataclass</span></code></a></li>
Expand Down
Loading

0 comments on commit c5c5dab

Please sign in to comment.