finally documentation
This commit is contained in:
BIN
docs/_build/doctrees/api/cristallina.doctree
vendored
Normal file
BIN
docs/_build/doctrees/api/cristallina.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/_build/doctrees/api/modules.doctree
vendored
Normal file
BIN
docs/_build/doctrees/api/modules.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/_build/doctrees/authors.doctree
vendored
Normal file
BIN
docs/_build/doctrees/authors.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/_build/doctrees/changelog.doctree
vendored
Normal file
BIN
docs/_build/doctrees/changelog.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/_build/doctrees/contributing.doctree
vendored
Normal file
BIN
docs/_build/doctrees/contributing.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/_build/doctrees/environment.pickle
vendored
Normal file
BIN
docs/_build/doctrees/environment.pickle
vendored
Normal file
Binary file not shown.
BIN
docs/_build/doctrees/index.doctree
vendored
Normal file
BIN
docs/_build/doctrees/index.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/_build/doctrees/license.doctree
vendored
Normal file
BIN
docs/_build/doctrees/license.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/_build/doctrees/readme.doctree
vendored
Normal file
BIN
docs/_build/doctrees/readme.doctree
vendored
Normal file
Binary file not shown.
4
docs/_build/html/.buildinfo
vendored
Normal file
4
docs/_build/html/.buildinfo
vendored
Normal file
@@ -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: 87b1ead7c24148993fc29b0da8b0fcb9
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
296
docs/_build/html/_modules/cristallina/SEA_GraphClient.html
vendored
Normal file
296
docs/_build/html/_modules/cristallina/SEA_GraphClient.html
vendored
Normal file
@@ -0,0 +1,296 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>cristallina.SEA_GraphClient — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css" />
|
||||
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
|
||||
<script src="../../_static/doctools.js"></script>
|
||||
<script src="../../_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for cristallina.SEA_GraphClient</h1><div class="highlight"><pre>
|
||||
<span></span><span class="sd">"""client for SEA GraphServer</span>
|
||||
|
||||
<span class="sd">Usage:</span>
|
||||
|
||||
<span class="sd"># open a client to host 'samenv', port 8764</span>
|
||||
<span class="sd"># the port number for the graph server may be retrived by</span>
|
||||
<span class="sd"># the command 'sea list' on the samenv machine</span>
|
||||
|
||||
<span class="sd">client = GraphClient('samenv:8764')</span>
|
||||
|
||||
<span class="sd"># get one curve</span>
|
||||
|
||||
<span class="sd">tlist, vlist, period = client.get_curves(start, end, name)</span>
|
||||
|
||||
<span class="sd">or</span>
|
||||
|
||||
<span class="sd"># get all important curves</span>
|
||||
<span class="sd">curves = client.get_curves(start, end)</span>
|
||||
|
||||
|
||||
<span class="sd"># where:</span>
|
||||
|
||||
<span class="sd"> start, end: interval (unix time, as retrieved from time.time())</span>
|
||||
<span class="sd"> name: the name of a curve (if no name or a list of names</span>
|
||||
<span class="sd"> is given, the result is a curves dict)</span>
|
||||
<span class="sd"> curves: dict <name> of [tlist, vlist, period]</span>
|
||||
<span class="sd"> tlist: time axis (unix time)</span>
|
||||
<span class="sd"> vlist: values (y-axis)</span>
|
||||
<span class="sd"> period: the expected resolution (a hint for graphic clients,</span>
|
||||
<span class="sd"> saying that for a time step t(n) - t(n-1) significantly</span>
|
||||
<span class="sd"> bigger than period, an additional point should be added</span>
|
||||
<span class="sd"> at t(n) - period)</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">socket</span>
|
||||
<span class="kn">import</span> <span class="nn">time</span>
|
||||
|
||||
|
||||
<span class="n">FINISH</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">'</span><span class="se">\n</span><span class="s1">TRANSACTIONFINISHED'</span>
|
||||
<span class="n">START</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">'TRANSACTIONSTART'</span>
|
||||
<span class="n">FMIN</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">FINISH</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span>
|
||||
<span class="n">FMAX</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">FINISH</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="expect_reply"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.SEA_GraphClient.expect_reply">[docs]</a><span class="k">def</span> <span class="nf">expect_reply</span><span class="p">(</span><span class="n">sock</span><span class="p">,</span> <span class="n">expected</span><span class="p">):</span>
|
||||
<span class="k">while</span> <span class="n">expected</span><span class="p">:</span>
|
||||
<span class="n">got</span> <span class="o">=</span> <span class="n">sock</span><span class="o">.</span><span class="n">recv</span><span class="p">(</span><span class="mi">8192</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">expected</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">got</span><span class="p">):</span>
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">'expected </span><span class="si">%r</span><span class="s1"> but got </span><span class="si">%r</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span><span class="n">expected</span><span class="p">,</span> <span class="n">got</span><span class="p">))</span>
|
||||
<span class="n">expected</span> <span class="o">=</span> <span class="n">expected</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">got</span><span class="p">):]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="raw_sics_client"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.SEA_GraphClient.raw_sics_client">[docs]</a><span class="k">def</span> <span class="nf">raw_sics_client</span><span class="p">(</span><span class="n">hostport</span><span class="p">,</span> <span class="n">login</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="s1">':'</span> <span class="ow">in</span> <span class="n">hostport</span><span class="p">:</span>
|
||||
<span class="n">host</span><span class="p">,</span> <span class="n">port</span> <span class="o">=</span> <span class="n">hostport</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">':'</span><span class="p">)</span>
|
||||
<span class="n">hostport</span> <span class="o">=</span> <span class="p">(</span><span class="n">host</span><span class="p">,</span> <span class="nb">int</span><span class="p">(</span><span class="n">port</span><span class="p">))</span>
|
||||
<span class="n">sock</span> <span class="o">=</span> <span class="n">socket</span><span class="o">.</span><span class="n">create_connection</span><span class="p">(</span><span class="n">hostport</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
|
||||
<span class="n">bbuf</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">''</span>
|
||||
<span class="n">expect_reply</span><span class="p">(</span><span class="n">sock</span><span class="p">,</span> <span class="sa">b</span><span class="s1">'OK</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span>
|
||||
<span class="n">sock</span><span class="o">.</span><span class="n">sendall</span><span class="p">(</span><span class="n">login</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s1">'latin-1'</span><span class="p">)</span> <span class="o">+</span> <span class="sa">b</span><span class="s1">'</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span>
|
||||
<span class="n">expect_reply</span><span class="p">(</span><span class="n">sock</span><span class="p">,</span> <span class="sa">b</span><span class="s1">'Login OK</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span>
|
||||
<span class="n">request</span> <span class="o">=</span> <span class="k">yield</span> <span class="kc">None</span>
|
||||
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
|
||||
<span class="n">sock</span><span class="o">.</span><span class="n">sendall</span><span class="p">(</span><span class="sa">b</span><span class="s1">'fulltransact </span><span class="si">%s</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="n">request</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s1">'latin-1'</span><span class="p">))</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">reply</span> <span class="o">=</span> <span class="n">sock</span><span class="o">.</span><span class="n">recv</span><span class="p">(</span><span class="mi">8192</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">reply</span><span class="p">:</span>
|
||||
<span class="n">sock</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
||||
<span class="k">return</span>
|
||||
<span class="k">except</span> <span class="n">socket</span><span class="o">.</span><span class="n">timeout</span><span class="p">:</span>
|
||||
<span class="n">sock</span><span class="o">.</span><span class="n">shutdown</span><span class="p">(</span><span class="n">socket</span><span class="o">.</span><span class="n">SHUT_RDWR</span><span class="p">)</span>
|
||||
<span class="n">sock</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
||||
<span class="k">raise</span>
|
||||
<span class="n">before</span><span class="p">,</span> <span class="n">tag</span><span class="p">,</span> <span class="n">after</span> <span class="o">=</span> <span class="n">reply</span><span class="o">.</span><span class="n">partition</span><span class="p">(</span><span class="n">FINISH</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">tag</span><span class="p">:</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">bbuf</span> <span class="o">+</span> <span class="n">before</span>
|
||||
<span class="k">elif</span> <span class="n">FMIN</span> <span class="o"><=</span> <span class="n">reply</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o"><=</span> <span class="n">FMAX</span><span class="p">:</span> <span class="c1"># the FINISH tag may have been cut</span>
|
||||
<span class="n">bbuf</span><span class="p">,</span> <span class="n">tag</span><span class="p">,</span> <span class="n">after</span> <span class="o">=</span> <span class="p">(</span><span class="n">bbuf</span> <span class="o">+</span> <span class="n">reply</span><span class="p">)</span><span class="o">.</span><span class="n">partition</span><span class="p">(</span><span class="n">FINISH</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">tag</span><span class="p">:</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">bbuf</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">bbuf</span> <span class="o">+=</span> <span class="n">before</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">bbuf</span> <span class="o">=</span> <span class="n">after</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
|
||||
<span class="n">before</span><span class="p">,</span> <span class="n">tag</span><span class="p">,</span> <span class="n">result</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">rpartition</span><span class="p">(</span><span class="n">START</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">tag</span><span class="p">:</span>
|
||||
<span class="n">before</span><span class="p">,</span> <span class="n">nl</span><span class="p">,</span> <span class="n">result</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">partition</span><span class="p">(</span><span class="sa">b</span><span class="s1">'</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">request</span> <span class="o">=</span> <span class="k">yield</span> <span class="n">result</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s1">'latin-1'</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">GeneratorExit</span><span class="p">:</span>
|
||||
<span class="n">sock</span><span class="o">.</span><span class="n">shutdown</span><span class="p">(</span><span class="n">socket</span><span class="o">.</span><span class="n">SHUT_RDWR</span><span class="p">)</span>
|
||||
<span class="n">sock</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
||||
<span class="k">return</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="sics_client"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.SEA_GraphClient.sics_client">[docs]</a><span class="k">def</span> <span class="nf">sics_client</span><span class="p">(</span><span class="n">hostport</span><span class="p">,</span> <span class="n">command</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">login</span><span class="o">=</span><span class="s1">'Spy 007'</span><span class="p">):</span>
|
||||
<span class="n">sics</span> <span class="o">=</span> <span class="n">raw_sics_client</span><span class="p">(</span><span class="n">hostport</span><span class="p">,</span> <span class="n">login</span><span class="p">)</span>
|
||||
<span class="nb">next</span><span class="p">(</span><span class="n">sics</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">command</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">sics</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">sics</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="n">command</span><span class="p">)</span>
|
||||
<span class="n">sics</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="n">result</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="GraphClient"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.SEA_GraphClient.GraphClient">[docs]</a><span class="k">class</span> <span class="nc">GraphClient</span><span class="p">:</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hostport</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">sc</span> <span class="o">=</span> <span class="n">sics_client</span><span class="p">(</span><span class="n">hostport</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="GraphClient.close"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.SEA_GraphClient.GraphClient.close">[docs]</a> <span class="k">def</span> <span class="nf">close</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">sc</span><span class="o">.</span><span class="n">close</span><span class="p">()</span></div>
|
||||
|
||||
<div class="viewcode-block" id="GraphClient.get_raw"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.SEA_GraphClient.GraphClient.get_raw">[docs]</a> <span class="k">def</span> <span class="nf">get_raw</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">start</span><span class="p">,</span> <span class="n">end</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""get raw curves (values as text)"""</span>
|
||||
<span class="n">arglist</span> <span class="o">=</span> <span class="s1">' '</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">args</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">reply</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sc</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="sa">f</span><span class="s1">'graph </span><span class="si">{</span><span class="n">start</span><span class="si">}</span><span class="s1"> </span><span class="si">{</span><span class="n">end</span><span class="si">}</span><span class="s1"> </span><span class="si">{</span><span class="n">arglist</span><span class="si">}</span><span class="s1">'</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">StopIteration</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">ConnectionError</span><span class="p">(</span><span class="s1">'connection closed'</span><span class="p">)</span>
|
||||
<span class="n">lines</span> <span class="o">=</span> <span class="n">reply</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">'</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span>
|
||||
<span class="n">curve</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
<span class="n">t</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">lines</span><span class="p">[</span><span class="mi">1</span><span class="p">:]:</span> <span class="c1"># skip first line</span>
|
||||
<span class="k">if</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">'*'</span><span class="p">):</span>
|
||||
<span class="n">spl</span> <span class="o">=</span> <span class="n">line</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="n">spl</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s1">'0'</span><span class="p">,</span> <span class="s1">'1'</span><span class="p">):</span>
|
||||
<span class="k">break</span>
|
||||
<span class="n">tlist</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">vlist</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">curve</span> <span class="o">=</span> <span class="p">[</span><span class="n">tlist</span><span class="p">,</span> <span class="n">vlist</span><span class="p">,</span> <span class="mi">1</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">spl</span><span class="p">)</span> <span class="o">>=</span> <span class="mi">3</span> <span class="ow">and</span> <span class="n">spl</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'period'</span><span class="p">:</span>
|
||||
<span class="n">curve</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">spl</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
|
||||
<span class="n">result</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">curve</span>
|
||||
<span class="n">t</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">tdif</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">value</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">partition</span><span class="p">(</span><span class="s1">' '</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">t</span> <span class="o">+=</span> <span class="nb">float</span><span class="p">(</span><span class="n">tdif</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">lines</span><span class="p">)</span>
|
||||
<span class="n">tlist</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">t</span><span class="p">)</span>
|
||||
<span class="n">vlist</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">result</span></div>
|
||||
|
||||
<div class="viewcode-block" id="GraphClient.get_names"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.SEA_GraphClient.GraphClient.get_names">[docs]</a> <span class="k">def</span> <span class="nf">get_names</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">start</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""get names and properties of curves configured to be display on SEA GUI graphics"""</span>
|
||||
<span class="n">end</span> <span class="o">=</span> <span class="n">start</span> <span class="k">if</span> <span class="n">end</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">end</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_raw</span><span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">end</span><span class="p">,</span> <span class="s1">'text'</span><span class="p">,</span> <span class="s1">'vars'</span><span class="p">)</span>
|
||||
<span class="n">curves</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
<span class="k">for</span> <span class="n">vlist</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s1">'vars'</span><span class="p">][</span><span class="mi">1</span><span class="p">]:</span> <span class="c1"># text values</span>
|
||||
<span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">vlist</span><span class="o">.</span><span class="n">split</span><span class="p">():</span>
|
||||
<span class="n">item</span> <span class="o">=</span> <span class="n">item</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">'|'</span><span class="p">)</span>
|
||||
<span class="n">curves</span><span class="p">[</span><span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">=</span> <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="o">+</span> <span class="p">[</span><span class="s1">''</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="mi">4</span> <span class="o">-</span> <span class="nb">len</span><span class="p">(</span><span class="n">item</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="n">curves</span></div>
|
||||
|
||||
<div class="viewcode-block" id="GraphClient.get_curves"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.SEA_GraphClient.GraphClient.get_curves">[docs]</a> <span class="k">def</span> <span class="nf">get_curves</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">start</span><span class="p">,</span> <span class="n">end</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">none_value</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">nmax</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""get curves</span>
|
||||
|
||||
<span class="sd"> start, end: interval (unix time, as retrieved from time.time())</span>
|
||||
<span class="sd"> non positive values are taken relative to the current time</span>
|
||||
<span class="sd"> name: a single name or a list of names or None to get all curves (as shown in the SEA GUI)</span>
|
||||
<span class="sd"> none_value: replacement when no value is defined</span>
|
||||
<span class="sd"> nmax: max. number of points per curve</span>
|
||||
|
||||
<span class="sd"> when name is a string, returns [tlist, vlist, period]</span>
|
||||
<span class="sd"> when name is None or a list of strings (names) returns a dict <name> of [tlist, vlist, period]</span>
|
||||
|
||||
<span class="sd"> tlist: time axis (unix time)</span>
|
||||
<span class="sd"> vlist: values (y-axis)</span>
|
||||
<span class="sd"> period: the expected resolution (a hint for graphic clients)</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
|
||||
<span class="n">names</span> <span class="o">=</span> <span class="p">[</span><span class="n">name</span><span class="p">]</span>
|
||||
<span class="k">elif</span> <span class="n">name</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">names</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_names</span><span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">end</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span> <span class="c1"># assume names is a list of strings</span>
|
||||
<span class="n">names</span> <span class="o">=</span> <span class="n">name</span>
|
||||
<span class="n">args</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'np'</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">nmax</span><span class="p">)]</span> <span class="o">+</span> <span class="n">names</span> <span class="k">if</span> <span class="n">nmax</span> <span class="k">else</span> <span class="n">names</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_raw</span><span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">end</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">curve</span> <span class="ow">in</span> <span class="n">result</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
|
||||
<span class="n">vlist</span> <span class="o">=</span> <span class="n">curve</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
|
||||
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">vlist</span><span class="p">):</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">vlist</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">v</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
|
||||
<span class="n">vlist</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">none_value</span>
|
||||
<span class="k">return</span> <span class="n">result</span><span class="p">[</span><span class="n">name</span><span class="p">]</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="nb">str</span><span class="p">)</span> <span class="k">else</span> <span class="n">result</span></div></div>
|
||||
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="../../index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="../../index.html">Documentation overview</a><ul>
|
||||
<li><a href="../index.html">Module code</a><ul>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
327
docs/_build/html/_modules/cristallina/analysis.html
vendored
Normal file
327
docs/_build/html/_modules/cristallina/analysis.html
vendored
Normal file
@@ -0,0 +1,327 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>cristallina.analysis — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css" />
|
||||
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
|
||||
<script src="../../_static/doctools.js"></script>
|
||||
<script src="../../_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for cristallina.analysis</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">import</span> <span class="nn">re</span>
|
||||
<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">defaultdict</span>
|
||||
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Optional</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">lmfit</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">sfdata</span> <span class="kn">import</span> <span class="n">SFDataFiles</span><span class="p">,</span> <span class="n">sfdatafile</span><span class="p">,</span> <span class="n">SFScanInfo</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">joblib</span>
|
||||
<span class="kn">from</span> <span class="nn">joblib</span> <span class="kn">import</span> <span class="n">Parallel</span><span class="p">,</span> <span class="n">delayed</span><span class="p">,</span> <span class="n">Memory</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">utils</span>
|
||||
<span class="kn">from</span> <span class="nn">.utils</span> <span class="kn">import</span> <span class="n">ROI</span>
|
||||
|
||||
<span class="n">memory</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="setup_cachedirs"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.analysis.setup_cachedirs">[docs]</a><span class="k">def</span> <span class="nf">setup_cachedirs</span><span class="p">(</span><span class="n">pgroup</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">cachedir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Sets the path to a persistent cache directory either from the given p-group (e.g. "p20841")</span>
|
||||
<span class="sd"> or an explicitly given directory.</span>
|
||||
|
||||
<span class="sd"> If heuristics fail we use "/tmp" as a non-persistent alternative.</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="k">global</span> <span class="n">memory</span>
|
||||
<span class="k">if</span> <span class="n">cachedir</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="c1"># explicit directory given, use this choice</span>
|
||||
<span class="n">memory</span> <span class="o">=</span> <span class="n">Memory</span><span class="p">(</span><span class="n">cachedir</span><span class="p">,</span> <span class="n">verbose</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">compress</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">pgroup</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">pgroup_no</span> <span class="o">=</span> <span class="n">utils</span><span class="o">.</span><span class="n">heuristic_extract_pgroup</span><span class="p">()</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">parts</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="sa">r</span><span class="s2">"(\d.*)"</span><span class="p">,</span> <span class="n">pgroup</span><span class="p">)</span> <span class="c1"># ['p', '2343', '']</span>
|
||||
<span class="n">pgroup_no</span> <span class="o">=</span> <span class="n">parts</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span>
|
||||
<span class="n">cachedir</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"/das/work/units/cristallina/p</span><span class="si">{</span><span class="n">pgroup_no</span><span class="si">}</span><span class="s2">/cachedir"</span>
|
||||
<span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">e</span><span class="p">)</span>
|
||||
<span class="n">cachedir</span> <span class="o">=</span> <span class="s2">"/das/work/units/cristallina/p19739/cachedir"</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">memory</span> <span class="o">=</span> <span class="n">Memory</span><span class="p">(</span><span class="n">cachedir</span><span class="p">,</span> <span class="n">verbose</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">compress</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">PermissionError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">cachedir</span> <span class="o">=</span> <span class="s2">"/tmp"</span>
|
||||
<span class="n">memory</span> <span class="o">=</span> <span class="n">Memory</span><span class="p">(</span><span class="n">cachedir</span><span class="p">,</span> <span class="n">verbose</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">compress</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<span class="n">setup_cachedirs</span><span class="p">()</span>
|
||||
|
||||
|
||||
<span class="nd">@memory</span><span class="o">.</span><span class="n">cache</span><span class="p">(</span><span class="n">ignore</span><span class="o">=</span><span class="p">[</span><span class="s2">"batch_size"</span><span class="p">])</span> <span class="c1"># we ignore batch_size for caching purposes</span>
|
||||
<span class="k">def</span> <span class="nf">perform_image_calculations</span><span class="p">(</span>
|
||||
<span class="n">fileset</span><span class="p">,</span>
|
||||
<span class="n">channel</span><span class="o">=</span><span class="s2">"JF16T03V01"</span><span class="p">,</span>
|
||||
<span class="n">alignment_channels</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">batch_size</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
|
||||
<span class="n">roi</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">ROI</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">preview</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
|
||||
<span class="n">operations</span><span class="o">=</span><span class="p">[</span><span class="s2">"sum"</span><span class="p">],</span>
|
||||
<span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Performs one or more calculations ("sum", "mean" or "std") for a given region of interest (roi)</span>
|
||||
<span class="sd"> for an image channel from a fileset (e.g. "run0352/data/acq0001.*.h5" or step.fnames from a SFScanInfo object).</span>
|
||||
|
||||
<span class="sd"> Allows alignment, i.e. reducing only to a common subset with other channels.</span>
|
||||
|
||||
<span class="sd"> Calculations are performed in batches to reduce maximum memory requirements.</span>
|
||||
|
||||
<span class="sd"> Preview only applies calculation to first batch and returns.</span>
|
||||
|
||||
<span class="sd"> Returns a dictionary ({"JF16T03V01_intensity":[11, 18, 21, 55, ...]})</span>
|
||||
<span class="sd"> with the given channel values for each pulse and corresponding pulse id.</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="n">possible_operations</span> <span class="o">=</span> <span class="p">{</span>
|
||||
<span class="s2">"sum"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"intensity"</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">],</span>
|
||||
<span class="s2">"mean"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"mean"</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">],</span>
|
||||
<span class="s2">"std"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"mean"</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">std</span><span class="p">],</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">with</span> <span class="n">SFDataFiles</span><span class="p">(</span><span class="o">*</span><span class="n">fileset</span><span class="p">)</span> <span class="k">as</span> <span class="n">data</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">alignment_channels</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">channels</span> <span class="o">=</span> <span class="p">[</span><span class="n">channel</span><span class="p">]</span> <span class="o">+</span> <span class="p">[</span><span class="n">ch</span> <span class="k">for</span> <span class="n">ch</span> <span class="ow">in</span> <span class="n">alignment_channels</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">channels</span> <span class="o">=</span> <span class="p">[</span><span class="n">channel</span><span class="p">]</span>
|
||||
|
||||
<span class="n">subset</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">channels</span><span class="p">]</span>
|
||||
|
||||
<span class="n">subset</span><span class="o">.</span><span class="n">drop_missing</span><span class="p">()</span>
|
||||
|
||||
<span class="n">Images</span> <span class="o">=</span> <span class="n">subset</span><span class="p">[</span><span class="n">channel</span><span class="p">]</span>
|
||||
|
||||
<span class="n">res</span> <span class="o">=</span> <span class="n">defaultdict</span><span class="p">(</span><span class="nb">list</span><span class="p">)</span>
|
||||
<span class="n">res</span><span class="p">[</span><span class="s2">"roi"</span><span class="p">]</span> <span class="o">=</span> <span class="nb">repr</span><span class="p">(</span><span class="n">roi</span><span class="p">)</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">image_slice</span> <span class="ow">in</span> <span class="n">Images</span><span class="o">.</span><span class="n">in_batches</span><span class="p">(</span><span class="n">batch_size</span><span class="p">):</span>
|
||||
|
||||
<span class="n">index_slice</span><span class="p">,</span> <span class="n">im</span> <span class="o">=</span> <span class="n">image_slice</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">roi</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">im_ROI</span> <span class="o">=</span> <span class="n">im</span><span class="p">[:]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">im_ROI</span> <span class="o">=</span> <span class="n">im</span><span class="p">[:,</span> <span class="n">roi</span><span class="o">.</span><span class="n">rows</span><span class="p">,</span> <span class="n">roi</span><span class="o">.</span><span class="n">cols</span><span class="p">]</span>
|
||||
|
||||
<span class="c1"># iterate over all operations</span>
|
||||
<span class="k">for</span> <span class="n">op</span> <span class="ow">in</span> <span class="n">operations</span><span class="p">:</span>
|
||||
<span class="n">label</span><span class="p">,</span> <span class="n">func</span> <span class="o">=</span> <span class="n">possible_operations</span><span class="p">[</span><span class="n">op</span><span class="p">]</span>
|
||||
<span class="n">res</span><span class="p">[</span><span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">channel</span><span class="si">}</span><span class="s2">_</span><span class="si">{</span><span class="n">label</span><span class="si">}</span><span class="s2">"</span><span class="p">]</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">func</span><span class="p">(</span><span class="n">im_ROI</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)))</span>
|
||||
|
||||
<span class="n">res</span><span class="p">[</span><span class="s2">"pids"</span><span class="p">]</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">Images</span><span class="o">.</span><span class="n">pids</span><span class="p">[</span><span class="n">index_slice</span><span class="p">])</span>
|
||||
|
||||
<span class="c1"># only return first batch</span>
|
||||
<span class="k">if</span> <span class="n">preview</span><span class="p">:</span>
|
||||
<span class="k">break</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">res</span>
|
||||
|
||||
|
||||
<span class="nd">@memory</span><span class="o">.</span><span class="n">cache</span><span class="p">(</span><span class="n">ignore</span><span class="o">=</span><span class="p">[</span><span class="s2">"batch_size"</span><span class="p">])</span> <span class="c1"># we ignore batch_size for caching purposes</span>
|
||||
<span class="k">def</span> <span class="nf">sum_images</span><span class="p">(</span>
|
||||
<span class="n">fileset</span><span class="p">,</span>
|
||||
<span class="n">channel</span><span class="o">=</span><span class="s2">"JF16T03V01"</span><span class="p">,</span>
|
||||
<span class="n">alignment_channels</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">batch_size</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
|
||||
<span class="n">roi</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">ROI</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">preview</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
|
||||
<span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Sums a given region of interest (roi) for an image channel from a</span>
|
||||
<span class="sd"> given fileset (e.g. "run0352/data/acq0001.*.h5" or step.fnames from a SFScanInfo object).</span>
|
||||
|
||||
<span class="sd"> Allows alignment, i.e. reducing only to a common subset with other channels.</span>
|
||||
|
||||
<span class="sd"> Summation is performed in batches to reduce maximum memory requirements.</span>
|
||||
|
||||
<span class="sd"> Preview only sums and returns the first batch.</span>
|
||||
|
||||
<span class="sd"> Returns a dictionary ({"JF16T03V01_intensity":[11, 18, 21, 55, ...]})</span>
|
||||
<span class="sd"> with the given channel intensity for each pulse and corresponding pulse id.</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">perform_image_calculations</span><span class="p">(</span>
|
||||
<span class="n">fileset</span><span class="p">,</span>
|
||||
<span class="n">channel</span><span class="o">=</span><span class="n">channel</span><span class="p">,</span>
|
||||
<span class="n">alignment_channels</span><span class="o">=</span><span class="n">alignment_channels</span><span class="p">,</span>
|
||||
<span class="n">batch_size</span><span class="o">=</span><span class="n">batch_size</span><span class="p">,</span>
|
||||
<span class="n">roi</span><span class="o">=</span><span class="n">roi</span><span class="p">,</span>
|
||||
<span class="n">preview</span><span class="o">=</span><span class="n">preview</span><span class="p">,</span>
|
||||
<span class="n">operations</span><span class="o">=</span><span class="p">[</span><span class="s2">"sum"</span><span class="p">],</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_contrast_images"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.analysis.get_contrast_images">[docs]</a><span class="k">def</span> <span class="nf">get_contrast_images</span><span class="p">(</span>
|
||||
<span class="n">fileset</span><span class="p">,</span>
|
||||
<span class="n">channel</span><span class="o">=</span><span class="s2">"JF16T03V01"</span><span class="p">,</span>
|
||||
<span class="n">alignment_channels</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">batch_size</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
|
||||
<span class="n">roi</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">ROI</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">preview</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
|
||||
<span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> See perform_image_calculations. Here calculates mean and standard deviation for a given set of images.</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">perform_image_calculations</span><span class="p">(</span>
|
||||
<span class="n">fileset</span><span class="p">,</span>
|
||||
<span class="n">channel</span><span class="o">=</span><span class="n">channel</span><span class="p">,</span>
|
||||
<span class="n">alignment_channels</span><span class="o">=</span><span class="n">alignment_channels</span><span class="p">,</span>
|
||||
<span class="n">batch_size</span><span class="o">=</span><span class="n">batch_size</span><span class="p">,</span>
|
||||
<span class="n">roi</span><span class="o">=</span><span class="n">roi</span><span class="p">,</span>
|
||||
<span class="n">preview</span><span class="o">=</span><span class="n">preview</span><span class="p">,</span>
|
||||
<span class="n">operations</span><span class="o">=</span><span class="p">[</span><span class="s2">"mean"</span><span class="p">,</span> <span class="s2">"std"</span><span class="p">],</span>
|
||||
<span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="fit_2d_gaussian"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.analysis.fit_2d_gaussian">[docs]</a><span class="k">def</span> <span class="nf">fit_2d_gaussian</span><span class="p">(</span><span class="n">image</span><span class="p">,</span> <span class="n">roi</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">ROI</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> 2D Gaussian fit using LMFit for a given image and an optional region of interest.</span>
|
||||
|
||||
<span class="sd"> Returns the x, y coordinates of the center and the results object which contains</span>
|
||||
<span class="sd"> further fit statistics.</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="c1"># given an image and optional ROI</span>
|
||||
<span class="k">if</span> <span class="n">roi</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">im</span> <span class="o">=</span> <span class="n">image</span><span class="p">[</span><span class="n">roi</span><span class="o">.</span><span class="n">rows</span><span class="p">,</span> <span class="n">roi</span><span class="o">.</span><span class="n">cols</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">im</span> <span class="o">=</span> <span class="n">image</span>
|
||||
|
||||
<span class="n">len_y</span><span class="p">,</span> <span class="n">len_x</span> <span class="o">=</span> <span class="n">im</span><span class="o">.</span><span class="n">shape</span>
|
||||
|
||||
<span class="n">y</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">len_y</span><span class="p">)</span>
|
||||
<span class="n">x</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">len_x</span><span class="p">)</span>
|
||||
|
||||
<span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">meshgrid</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span> <span class="c1"># here now a 2D mesh</span>
|
||||
|
||||
<span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">ravel</span><span class="p">(),</span> <span class="n">y</span><span class="o">.</span><span class="n">ravel</span><span class="p">()</span> <span class="c1"># and all back into sequences of 1D arrays</span>
|
||||
|
||||
<span class="n">z</span> <span class="o">=</span> <span class="n">im</span><span class="o">.</span><span class="n">ravel</span><span class="p">()</span> <span class="c1"># and this also as a 1D</span>
|
||||
|
||||
<span class="n">model</span> <span class="o">=</span> <span class="n">lmfit</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">Gaussian2dModel</span><span class="p">()</span>
|
||||
<span class="n">params</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">guess</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span>
|
||||
<span class="n">z</span><span class="p">,</span>
|
||||
<span class="n">x</span><span class="o">=</span><span class="n">x</span><span class="p">,</span>
|
||||
<span class="n">y</span><span class="o">=</span><span class="n">y</span><span class="p">,</span>
|
||||
<span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">roi</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="c1"># convert back to original image coordinates</span>
|
||||
<span class="n">center_x</span> <span class="o">=</span> <span class="n">roi</span><span class="o">.</span><span class="n">left</span> <span class="o">+</span> <span class="n">result</span><span class="o">.</span><span class="n">params</span><span class="p">[</span><span class="s2">"centerx"</span><span class="p">]</span>
|
||||
<span class="n">center_y</span> <span class="o">=</span> <span class="n">roi</span><span class="o">.</span><span class="n">bottom</span> <span class="o">+</span> <span class="n">result</span><span class="o">.</span><span class="n">params</span><span class="p">[</span><span class="s2">"centery"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">center_x</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">params</span><span class="p">[</span><span class="s2">"centerx"</span><span class="p">]</span><span class="o">.</span><span class="n">value</span>
|
||||
<span class="n">center_y</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">params</span><span class="p">[</span><span class="s2">"centery"</span><span class="p">]</span><span class="o">.</span><span class="n">value</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">center_x</span><span class="p">,</span> <span class="n">center_y</span><span class="p">,</span> <span class="n">result</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="../../index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="../../index.html">Documentation overview</a><ul>
|
||||
<li><a href="../index.html">Module code</a><ul>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
323
docs/_build/html/_modules/cristallina/plot.html
vendored
Normal file
323
docs/_build/html/_modules/cristallina/plot.html
vendored
Normal file
@@ -0,0 +1,323 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>cristallina.plot — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css" />
|
||||
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
|
||||
<script src="../../_static/doctools.js"></script>
|
||||
<script src="../../_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for cristallina.plot</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">import</span> <span class="nn">re</span>
|
||||
<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">defaultdict</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">matplotlib</span>
|
||||
<span class="kn">from</span> <span class="nn">matplotlib</span> <span class="kn">import</span> <span class="n">pyplot</span> <span class="k">as</span> <span class="n">plt</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">warnings</span>
|
||||
<span class="c1"># because of https://github.com/kornia/kornia/issues/1425</span>
|
||||
<span class="n">warnings</span><span class="o">.</span><span class="n">simplefilter</span><span class="p">(</span><span class="s2">"ignore"</span><span class="p">,</span> <span class="ne">DeprecationWarning</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">tqdm</span> <span class="kn">import</span> <span class="n">tqdm</span>
|
||||
<span class="kn">from</span> <span class="nn">matplotlib</span> <span class="kn">import</span> <span class="n">patches</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">sfdata</span> <span class="kn">import</span> <span class="n">SFDataFiles</span><span class="p">,</span> <span class="n">sfdatafile</span><span class="p">,</span> <span class="n">SFScanInfo</span>
|
||||
<span class="kn">import</span> <span class="nn">jungfrau_utils</span> <span class="k">as</span> <span class="nn">ju</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">utils</span>
|
||||
<span class="kn">from</span> <span class="nn">.utils</span> <span class="kn">import</span> <span class="n">ROI</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="ju_patch_less_verbose"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.plot.ju_patch_less_verbose">[docs]</a><span class="k">def</span> <span class="nf">ju_patch_less_verbose</span><span class="p">(</span><span class="n">ju_module</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Quick monkey patch to suppress verbose messages from gain & pedestal file searcher."""</span>
|
||||
<span class="n">ju_module</span><span class="o">.</span><span class="n">swissfel_helpers</span><span class="o">.</span><span class="n">_locate_gain_file</span> <span class="o">=</span> <span class="n">ju_module</span><span class="o">.</span><span class="n">swissfel_helpers</span><span class="o">.</span><span class="n">locate_gain_file</span>
|
||||
<span class="n">ju_module</span><span class="o">.</span><span class="n">swissfel_helpers</span><span class="o">.</span><span class="n">_locate_pedestal_file</span> <span class="o">=</span> <span class="n">ju_module</span><span class="o">.</span><span class="n">swissfel_helpers</span><span class="o">.</span><span class="n">locate_pedestal_file</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">less_verbose_gain</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">kwargs</span><span class="p">[</span><span class="s2">"verbose"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="k">return</span> <span class="n">ju_module</span><span class="o">.</span><span class="n">swissfel_helpers</span><span class="o">.</span><span class="n">_locate_gain_file</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">less_verbose_pedestal</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">kwargs</span><span class="p">[</span><span class="s2">"verbose"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="k">return</span> <span class="n">ju_module</span><span class="o">.</span><span class="n">swissfel_helpers</span><span class="o">.</span><span class="n">_locate_pedestal_file</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># ju_module.swissfel_helpers.locate_gain_file = less_verbose_gain</span>
|
||||
<span class="c1"># ju_module.swissfel_helpers.locate_pedestal_file = less_verbose_pedestal</span>
|
||||
|
||||
<span class="n">ju_module</span><span class="o">.</span><span class="n">file_adapter</span><span class="o">.</span><span class="n">locate_gain_file</span> <span class="o">=</span> <span class="n">less_verbose_gain</span>
|
||||
<span class="n">ju_module</span><span class="o">.</span><span class="n">file_adapter</span><span class="o">.</span><span class="n">locate_pedestal_file</span> <span class="o">=</span> <span class="n">less_verbose_pedestal</span></div>
|
||||
|
||||
|
||||
<span class="n">ju_patch_less_verbose</span><span class="p">(</span><span class="n">ju</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="plot_correlation"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.plot.plot_correlation">[docs]</a><span class="k">def</span> <span class="nf">plot_correlation</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">ax_kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Plots the correlation of x and y in a normalized scatterplot.</span>
|
||||
<span class="sd"> If no axis is given a figure and axis are created.</span>
|
||||
|
||||
<span class="sd"> Returns: The axis object and the correlation coefficient between</span>
|
||||
<span class="sd"> x and y.</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="n">xstd</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">std</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
|
||||
<span class="n">ystd</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">std</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
|
||||
|
||||
<span class="n">xnorm</span> <span class="o">=</span> <span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">x</span><span class="p">))</span> <span class="o">/</span> <span class="n">xstd</span>
|
||||
<span class="n">ynorm</span> <span class="o">=</span> <span class="p">(</span><span class="n">y</span> <span class="o">-</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">y</span><span class="p">))</span> <span class="o">/</span> <span class="n">ystd</span>
|
||||
|
||||
<span class="n">n</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
|
||||
|
||||
<span class="n">r</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">/</span> <span class="p">(</span><span class="n">n</span><span class="p">)</span> <span class="o">*</span> <span class="nb">sum</span><span class="p">(</span><span class="n">xnorm</span> <span class="o">*</span> <span class="n">ynorm</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ax</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">()</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ax_kwargs</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="o">**</span><span class="n">ax_kwargs</span><span class="p">)</span>
|
||||
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">xnorm</span><span class="p">,</span> <span class="n">ynorm</span><span class="p">,</span> <span class="s2">"o"</span><span class="p">)</span>
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="mf">0.95</span><span class="p">,</span> <span class="mf">0.05</span><span class="p">,</span> <span class="sa">f</span><span class="s2">"r = </span><span class="si">{</span><span class="n">r</span><span class="si">:</span><span class="s2">.2f</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> <span class="n">transform</span><span class="o">=</span><span class="n">ax</span><span class="o">.</span><span class="n">transAxes</span><span class="p">,</span> <span class="n">horizontalalignment</span><span class="o">=</span><span class="s2">"right"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">ax</span><span class="p">,</span> <span class="n">r</span></div>
|
||||
|
||||
<div class="viewcode-block" id="plot_channel"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.plot.plot_channel">[docs]</a><span class="k">def</span> <span class="nf">plot_channel</span><span class="p">(</span><span class="n">data</span> <span class="p">:</span> <span class="n">SFDataFiles</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">""" </span>
|
||||
<span class="sd"> Plots a given channel from an SFDataFiles object. </span>
|
||||
<span class="sd"> </span>
|
||||
<span class="sd"> Optionally: a matplotlib axis to plot into</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="n">channel_dim</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">channel_name</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span>
|
||||
<span class="c1"># dim == 3: a 2D Image</span>
|
||||
<span class="c1"># dim == 2: an array per pulse (probably)</span>
|
||||
<span class="c1"># dim == 1: a single value per pulse (probably)</span>
|
||||
|
||||
<span class="n">plot_f</span> <span class="o">=</span> <span class="p">{</span>
|
||||
<span class="mi">1</span><span class="p">:</span> <span class="n">plot_1d_channel</span><span class="p">,</span>
|
||||
<span class="mi">2</span><span class="p">:</span> <span class="n">plot_2d_channel</span><span class="p">,</span>
|
||||
<span class="mi">3</span><span class="p">:</span> <span class="n">plot_image_channel</span><span class="p">,</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">plot_f</span><span class="p">[</span><span class="n">channel_dim</span><span class="p">](</span><span class="n">data</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="axis_styling"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.plot.axis_styling">[docs]</a><span class="k">def</span> <span class="nf">axis_styling</span><span class="p">(</span><span class="n">ax</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">description</span><span class="p">):</span>
|
||||
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">set_title</span><span class="p">(</span><span class="n">channel_name</span><span class="p">)</span>
|
||||
<span class="c1"># ax.set_xlabel('x')</span>
|
||||
<span class="c1"># ax.set_ylabel('a.u.')</span>
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">ticklabel_format</span><span class="p">(</span><span class="n">useOffset</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">text</span><span class="p">(</span>
|
||||
<span class="mf">0.05</span><span class="p">,</span>
|
||||
<span class="mf">0.05</span><span class="p">,</span>
|
||||
<span class="n">description</span><span class="p">,</span>
|
||||
<span class="n">transform</span><span class="o">=</span><span class="n">ax</span><span class="o">.</span><span class="n">transAxes</span><span class="p">,</span>
|
||||
<span class="n">horizontalalignment</span><span class="o">=</span><span class="s2">"left"</span><span class="p">,</span>
|
||||
<span class="n">bbox</span><span class="o">=</span><span class="nb">dict</span><span class="p">(</span><span class="n">boxstyle</span><span class="o">=</span><span class="s2">"round"</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">"lightgrey"</span><span class="p">),</span>
|
||||
<span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="plot_1d_channel"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.plot.plot_1d_channel">[docs]</a><span class="k">def</span> <span class="nf">plot_1d_channel</span><span class="p">(</span><span class="n">data</span> <span class="p">:</span> <span class="n">SFDataFiles</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Plots channel data for a channel that contains a single numeric value per pulse.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">mean</span><span class="p">,</span> <span class="n">std</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">channel_name</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">),</span> <span class="n">np</span><span class="o">.</span><span class="n">std</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">channel_name</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
|
||||
<span class="n">n_entries_per_frame</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">channel_name</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span>
|
||||
<span class="k">except</span> <span class="ne">TypeError</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot parse channel </span><span class="si">{</span><span class="n">channel_name</span><span class="si">}</span><span class="s2">. Check dimensionality."</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
<span class="n">y_data</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">channel_name</span><span class="p">]</span><span class="o">.</span><span class="n">data</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ax</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="n">constrained_layout</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">y_data</span><span class="p">)</span>
|
||||
<span class="n">description</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"mean: </span><span class="si">{</span><span class="n">mean</span><span class="si">:</span><span class="s2">.2e</span><span class="si">}</span><span class="s2">,</span><span class="se">\n</span><span class="s2">std: </span><span class="si">{</span><span class="n">std</span><span class="si">:</span><span class="s2">.2e</span><span class="si">}</span><span class="s2">"</span>
|
||||
<span class="n">axis_styling</span><span class="p">(</span><span class="n">ax</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">description</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="plot_2d_channel"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.plot.plot_2d_channel">[docs]</a><span class="k">def</span> <span class="nf">plot_2d_channel</span><span class="p">(</span><span class="n">data</span> <span class="p">:</span> <span class="n">SFDataFiles</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Plots channel data for a channel that contains a 1d array of numeric values per pulse.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">mean</span><span class="p">,</span> <span class="n">std</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">channel_name</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">),</span> <span class="n">np</span><span class="o">.</span><span class="n">std</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">channel_name</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
|
||||
<span class="c1"># data[channel_name].data</span>
|
||||
<span class="n">mean_over_frames</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">channel_name</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">TypeError</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unknown data in channel </span><span class="si">{</span><span class="n">channel_name</span><span class="si">}</span><span class="s2">."</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
<span class="n">y_data</span> <span class="o">=</span> <span class="n">mean_over_frames</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ax</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="n">constrained_layout</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">y_data</span><span class="p">)</span>
|
||||
<span class="n">description</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"mean: </span><span class="si">{</span><span class="n">mean</span><span class="si">:</span><span class="s2">.2e</span><span class="si">}</span><span class="s2">,</span><span class="se">\n</span><span class="s2">std: </span><span class="si">{</span><span class="n">std</span><span class="si">:</span><span class="s2">.2e</span><span class="si">}</span><span class="s2">"</span>
|
||||
<span class="n">axis_styling</span><span class="p">(</span><span class="n">ax</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">description</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="plot_image_channel"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.plot.plot_image_channel">[docs]</a><span class="k">def</span> <span class="nf">plot_image_channel</span><span class="p">(</span><span class="n">data</span> <span class="p">:</span> <span class="n">SFDataFiles</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">pulse</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">rois</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">norms</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Plots channel data for a channel that contains an image (2d array) of numeric values per pulse.</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="n">im</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">channel_name</span><span class="p">][</span><span class="n">pulse</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ax</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="n">constrained_layout</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="n">std</span> <span class="o">=</span> <span class="n">im</span><span class="o">.</span><span class="n">std</span><span class="p">()</span>
|
||||
<span class="n">mean</span> <span class="o">=</span> <span class="n">im</span><span class="o">.</span><span class="n">mean</span><span class="p">()</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">norms</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">norm</span> <span class="o">=</span> <span class="n">matplotlib</span><span class="o">.</span><span class="n">colors</span><span class="o">.</span><span class="n">Normalize</span><span class="p">(</span><span class="n">vmin</span><span class="o">=</span><span class="n">mean</span> <span class="o">-</span> <span class="n">std</span><span class="p">,</span> <span class="n">vmax</span><span class="o">=</span><span class="n">mean</span> <span class="o">+</span> <span class="n">std</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">norm</span> <span class="o">=</span> <span class="n">matplotlib</span><span class="o">.</span><span class="n">colors</span><span class="o">.</span><span class="n">Normalize</span><span class="p">(</span><span class="n">vmin</span><span class="o">=</span><span class="n">norms</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">vmax</span><span class="o">=</span><span class="n">norms</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
|
||||
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">im</span><span class="p">,</span> <span class="n">norm</span><span class="o">=</span><span class="n">norm</span><span class="p">)</span>
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">invert_yaxis</span><span class="p">()</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">rois</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="c1"># Plot rois if given</span>
|
||||
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">roi</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">rois</span><span class="p">):</span>
|
||||
<span class="c1"># Create a rectangle with ([bottom left corner coordinates], width, height)</span>
|
||||
<span class="n">rect</span> <span class="o">=</span> <span class="n">patches</span><span class="o">.</span><span class="n">Rectangle</span><span class="p">(</span>
|
||||
<span class="p">[</span><span class="n">roi</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="n">roi</span><span class="o">.</span><span class="n">bottom</span><span class="p">],</span> <span class="n">roi</span><span class="o">.</span><span class="n">width</span><span class="p">,</span> <span class="n">roi</span><span class="o">.</span><span class="n">height</span><span class="p">,</span>
|
||||
<span class="n">linewidth</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span>
|
||||
<span class="n">edgecolor</span><span class="o">=</span><span class="sa">f</span><span class="s2">"C</span><span class="si">{</span><span class="n">i</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span>
|
||||
<span class="n">facecolor</span><span class="o">=</span><span class="s2">"none"</span><span class="p">,</span>
|
||||
<span class="n">label</span><span class="o">=</span><span class="n">roi</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">add_patch</span><span class="p">(</span><span class="n">rect</span><span class="p">)</span>
|
||||
|
||||
<span class="n">description</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"mean: </span><span class="si">{</span><span class="n">mean</span><span class="si">:</span><span class="s2">.2e</span><span class="si">}</span><span class="s2">,</span><span class="se">\n</span><span class="s2">std: </span><span class="si">{</span><span class="n">std</span><span class="si">:</span><span class="s2">.2e</span><span class="si">}</span><span class="s2">"</span>
|
||||
<span class="n">axis_styling</span><span class="p">(</span><span class="n">ax</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">description</span><span class="p">)</span>
|
||||
<span class="n">plt</span><span class="o">.</span><span class="n">legend</span><span class="p">(</span><span class="n">loc</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span> </div>
|
||||
|
||||
<div class="viewcode-block" id="plot_spectrum_channel"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.plot.plot_spectrum_channel">[docs]</a><span class="k">def</span> <span class="nf">plot_spectrum_channel</span><span class="p">(</span><span class="n">data</span> <span class="p">:</span> <span class="n">SFDataFiles</span><span class="p">,</span> <span class="n">channel_name_x</span><span class="p">,</span> <span class="n">channel_name_y</span><span class="p">,</span> <span class="n">average</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">pulse</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Plots channel data for two channels where the first is taken as the (constant) x-axis</span>
|
||||
<span class="sd"> and the second as the y-axis (here we take by default the mean over the individual pulses).</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">mean</span><span class="p">,</span> <span class="n">std</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">channel_name_y</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">),</span> <span class="n">np</span><span class="o">.</span><span class="n">std</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">channel_name_y</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
|
||||
<span class="n">mean_over_frames</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">channel_name_y</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">TypeError</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unknown data in channel </span><span class="si">{</span><span class="n">channel_name_y</span><span class="si">}</span><span class="s2">."</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">average</span><span class="p">:</span>
|
||||
<span class="n">y_data</span> <span class="o">=</span> <span class="n">mean_over_frames</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">y_data</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">channel_name_y</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="n">pulse</span><span class="p">]</span>
|
||||
|
||||
|
||||
<span class="k">if</span> <span class="n">ax</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="n">constrained_layout</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">channel_name_x</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">y_data</span><span class="p">)</span>
|
||||
<span class="n">description</span> <span class="o">=</span> <span class="kc">None</span> <span class="c1"># f"mean: {mean:.2e},\nstd: {std:.2e}"</span>
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">set_xlabel</span><span class="p">(</span><span class="n">channel_name_x</span><span class="p">)</span>
|
||||
<span class="n">axis_styling</span><span class="p">(</span><span class="n">ax</span><span class="p">,</span> <span class="n">channel_name_y</span><span class="p">,</span> <span class="n">description</span><span class="p">)</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="../../index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="../../index.html">Documentation overview</a><ul>
|
||||
<li><a href="../index.html">Module code</a><ul>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
254
docs/_build/html/_modules/cristallina/skeleton.html
vendored
Normal file
254
docs/_build/html/_modules/cristallina/skeleton.html
vendored
Normal file
@@ -0,0 +1,254 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>cristallina.skeleton — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css" />
|
||||
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
|
||||
<script src="../../_static/doctools.js"></script>
|
||||
<script src="../../_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for cristallina.skeleton</h1><div class="highlight"><pre>
|
||||
<span></span><span class="sd">"""</span>
|
||||
<span class="sd">This is a skeleton file that can serve as a starting point for a Python</span>
|
||||
<span class="sd">console script. To run this script uncomment the following lines in the</span>
|
||||
<span class="sd">``[options.entry_points]`` section in ``setup.cfg``::</span>
|
||||
|
||||
<span class="sd"> console_scripts =</span>
|
||||
<span class="sd"> fibonacci = cristallina.skeleton:run</span>
|
||||
|
||||
<span class="sd">Then run ``pip install .`` (or ``pip install -e .`` for editable mode)</span>
|
||||
<span class="sd">which will install the command ``fibonacci`` inside your current environment.</span>
|
||||
|
||||
<span class="sd">Besides console scripts, the header (i.e. until ``_logger``...) of this file can</span>
|
||||
<span class="sd">also be used as template for Python modules.</span>
|
||||
|
||||
<span class="sd">Note:</span>
|
||||
<span class="sd"> This file can be renamed depending on your needs or safely removed if not needed.</span>
|
||||
|
||||
<span class="sd">References:</span>
|
||||
<span class="sd"> - https://setuptools.pypa.io/en/latest/userguide/entry_point.html</span>
|
||||
<span class="sd"> - https://pip.pypa.io/en/stable/reference/pip_install</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">argparse</span>
|
||||
<span class="kn">import</span> <span class="nn">logging</span>
|
||||
<span class="kn">import</span> <span class="nn">sys</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">cristallina</span> <span class="kn">import</span> <span class="n">__version__</span>
|
||||
|
||||
<span class="n">__author__</span> <span class="o">=</span> <span class="s2">"Alexander Steppke"</span>
|
||||
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s2">"Alexander Steppke"</span>
|
||||
<span class="n">__license__</span> <span class="o">=</span> <span class="s2">"MIT"</span>
|
||||
|
||||
<span class="n">_logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
|
||||
|
||||
|
||||
<span class="c1"># ---- Python API ----</span>
|
||||
<span class="c1"># The functions defined in this section can be imported by users in their</span>
|
||||
<span class="c1"># Python scripts/interactive interpreter, e.g. via</span>
|
||||
<span class="c1"># `from cristallina.skeleton import fib`,</span>
|
||||
<span class="c1"># when using this Python module as a library.</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="fib"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.skeleton.fib">[docs]</a><span class="k">def</span> <span class="nf">fib</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Fibonacci example function</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> n (int): integer</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> int: n-th Fibonacci number</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">assert</span> <span class="n">n</span> <span class="o">></span> <span class="mi">0</span>
|
||||
<span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span>
|
||||
<span class="k">for</span> <span class="n">_i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span> <span class="o">-</span> <span class="mi">1</span><span class="p">):</span>
|
||||
<span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="n">b</span><span class="p">,</span> <span class="n">a</span> <span class="o">+</span> <span class="n">b</span>
|
||||
<span class="k">return</span> <span class="n">a</span></div>
|
||||
|
||||
|
||||
<span class="c1"># ---- CLI ----</span>
|
||||
<span class="c1"># The functions defined in this section are wrappers around the main Python</span>
|
||||
<span class="c1"># API allowing them to be called directly from the terminal as a CLI</span>
|
||||
<span class="c1"># executable/script.</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="parse_args"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.skeleton.parse_args">[docs]</a><span class="k">def</span> <span class="nf">parse_args</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Parse command line parameters</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> args (List[str]): command line parameters as list of strings</span>
|
||||
<span class="sd"> (for example ``["--help"]``).</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> :obj:`argparse.Namespace`: command line parameters namespace</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">parser</span> <span class="o">=</span> <span class="n">argparse</span><span class="o">.</span><span class="n">ArgumentParser</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s2">"Just a Fibonacci demonstration"</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span>
|
||||
<span class="s2">"--version"</span><span class="p">,</span>
|
||||
<span class="n">action</span><span class="o">=</span><span class="s2">"version"</span><span class="p">,</span>
|
||||
<span class="n">version</span><span class="o">=</span><span class="s2">"cristallina </span><span class="si">{ver}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">ver</span><span class="o">=</span><span class="n">__version__</span><span class="p">),</span>
|
||||
<span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="n">dest</span><span class="o">=</span><span class="s2">"n"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"n-th Fibonacci number"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"INT"</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span>
|
||||
<span class="s2">"-v"</span><span class="p">,</span>
|
||||
<span class="s2">"--verbose"</span><span class="p">,</span>
|
||||
<span class="n">dest</span><span class="o">=</span><span class="s2">"loglevel"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"set loglevel to INFO"</span><span class="p">,</span>
|
||||
<span class="n">action</span><span class="o">=</span><span class="s2">"store_const"</span><span class="p">,</span>
|
||||
<span class="n">const</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">INFO</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span>
|
||||
<span class="s2">"-vv"</span><span class="p">,</span>
|
||||
<span class="s2">"--very-verbose"</span><span class="p">,</span>
|
||||
<span class="n">dest</span><span class="o">=</span><span class="s2">"loglevel"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"set loglevel to DEBUG"</span><span class="p">,</span>
|
||||
<span class="n">action</span><span class="o">=</span><span class="s2">"store_const"</span><span class="p">,</span>
|
||||
<span class="n">const</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">parser</span><span class="o">.</span><span class="n">parse_args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="setup_logging"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.skeleton.setup_logging">[docs]</a><span class="k">def</span> <span class="nf">setup_logging</span><span class="p">(</span><span class="n">loglevel</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Setup basic logging</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> loglevel (int): minimum loglevel for emitting messages</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">logformat</span> <span class="o">=</span> <span class="s2">"[</span><span class="si">%(asctime)s</span><span class="s2">] </span><span class="si">%(levelname)s</span><span class="s2">:</span><span class="si">%(name)s</span><span class="s2">:</span><span class="si">%(message)s</span><span class="s2">"</span>
|
||||
<span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">(</span>
|
||||
<span class="n">level</span><span class="o">=</span><span class="n">loglevel</span><span class="p">,</span> <span class="n">stream</span><span class="o">=</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="n">logformat</span><span class="p">,</span> <span class="n">datefmt</span><span class="o">=</span><span class="s2">"%Y-%m-</span><span class="si">%d</span><span class="s2"> %H:%M:%S"</span>
|
||||
<span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="main"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.skeleton.main">[docs]</a><span class="k">def</span> <span class="nf">main</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Wrapper allowing :func:`fib` to be called with string arguments in a CLI fashion</span>
|
||||
|
||||
<span class="sd"> Instead of returning the value from :func:`fib`, it prints the result to the</span>
|
||||
<span class="sd"> ``stdout`` in a nicely formatted message.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> args (List[str]): command line parameters as list of strings</span>
|
||||
<span class="sd"> (for example ``["--verbose", "42"]``).</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">args</span> <span class="o">=</span> <span class="n">parse_args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span>
|
||||
<span class="n">setup_logging</span><span class="p">(</span><span class="n">args</span><span class="o">.</span><span class="n">loglevel</span><span class="p">)</span>
|
||||
<span class="n">_logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Starting crazy calculations..."</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"The </span><span class="si">{}</span><span class="s2">-th Fibonacci number is </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">args</span><span class="o">.</span><span class="n">n</span><span class="p">,</span> <span class="n">fib</span><span class="p">(</span><span class="n">args</span><span class="o">.</span><span class="n">n</span><span class="p">)))</span>
|
||||
<span class="n">_logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Script ends here"</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="run"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.skeleton.run">[docs]</a><span class="k">def</span> <span class="nf">run</span><span class="p">():</span>
|
||||
<span class="w"> </span><span class="sd">"""Calls :func:`main` passing the CLI arguments extracted from :obj:`sys.argv`</span>
|
||||
|
||||
<span class="sd"> This function can be used as entry point to create console scripts with setuptools.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">main</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span></div>
|
||||
|
||||
|
||||
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s2">"__main__"</span><span class="p">:</span>
|
||||
<span class="c1"># ^ This is a guard statement that will prevent the following code from</span>
|
||||
<span class="c1"># being executed in the case someone imports this file instead of</span>
|
||||
<span class="c1"># executing it as a script.</span>
|
||||
<span class="c1"># https://docs.python.org/3/library/__main__.html</span>
|
||||
|
||||
<span class="c1"># After installing your project with pip, users can also run your Python</span>
|
||||
<span class="c1"># modules as scripts via the ``-m`` flag, as defined in PEP 338::</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># python -m cristallina.skeleton 42</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="n">run</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="../../index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="../../index.html">Documentation overview</a><ul>
|
||||
<li><a href="../index.html">Module code</a><ul>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
451
docs/_build/html/_modules/cristallina/utils.html
vendored
Normal file
451
docs/_build/html/_modules/cristallina/utils.html
vendored
Normal file
@@ -0,0 +1,451 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>cristallina.utils — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css" />
|
||||
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
|
||||
<script src="../../_static/doctools.js"></script>
|
||||
<script src="../../_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for cristallina.utils</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">import</span> <span class="nn">yaml</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">logging</span>
|
||||
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">()</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">sfdata</span> <span class="kn">import</span> <span class="n">SFDataFiles</span><span class="p">,</span> <span class="n">sfdatafile</span><span class="p">,</span> <span class="n">SFScanInfo</span><span class="p">,</span> <span class="n">SFProcFile</span>
|
||||
<span class="kn">from</span> <span class="nn">xraydb</span> <span class="kn">import</span> <span class="n">material_mu</span>
|
||||
<span class="kn">from</span> <span class="nn">joblib</span> <span class="kn">import</span> <span class="n">Parallel</span><span class="p">,</span> <span class="n">delayed</span><span class="p">,</span> <span class="n">cpu_count</span>
|
||||
|
||||
<div class="viewcode-block" id="scan_info"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.scan_info">[docs]</a><span class="k">def</span> <span class="nf">scan_info</span><span class="p">(</span><span class="n">run_number</span><span class="p">,</span> <span class="n">base_path</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">small_data</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Returns SFScanInfo object for a given run number. </span>
|
||||
<span class="sd"> If there is are small data channels, they will be added (small_data=False to suppress their loading).</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">base_path</span> <span class="o">==</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">base_path</span> <span class="o">=</span> <span class="n">heuristic_extract_base_path</span><span class="p">()</span>
|
||||
|
||||
<span class="n">scan</span> <span class="o">=</span> <span class="n">SFScanInfo</span><span class="p">(</span><span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">base_path</span><span class="si">}</span><span class="s2">run</span><span class="si">{</span><span class="n">run_number</span><span class="si">:</span><span class="s2">04</span><span class="si">}</span><span class="s2">/meta/scan.json"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">small_data</span><span class="p">:</span>
|
||||
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">scan</span><span class="o">.</span><span class="n">readbacks</span><span class="p">)):</span>
|
||||
<span class="n">sd_path_for_step</span><span class="o">=</span><span class="n">heuristic_extract_smalldata_path</span><span class="p">()</span><span class="o">+</span><span class="s1">'run'</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">run_number</span><span class="p">)</span><span class="o">.</span><span class="n">zfill</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span><span class="o">+</span><span class="s1">'/acq'</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">zfill</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span><span class="o">+</span><span class="s1">'.smalldata.h5'</span>
|
||||
<span class="n">scan</span><span class="o">.</span><span class="n">info</span><span class="p">[</span><span class="s1">'scan_files'</span><span class="p">][</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">sd_path_for_step</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">scan</span></div>
|
||||
|
||||
<div class="viewcode-block" id="channel_names"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.channel_names">[docs]</a><span class="k">def</span> <span class="nf">channel_names</span><span class="p">(</span><span class="n">run_number</span><span class="p">,</span><span class="n">verbose</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Prints channel names for a given run_number or scan object"""</span>
|
||||
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">run_number</span><span class="p">)</span> <span class="o">==</span> <span class="n">SFScanInfo</span><span class="p">:</span>
|
||||
<span class="n">scan</span> <span class="o">=</span> <span class="n">run_number</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">scan</span> <span class="o">=</span> <span class="n">scan_info</span><span class="p">(</span><span class="n">run_number</span><span class="p">)</span>
|
||||
|
||||
<span class="n">channel_list</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">scan</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">verbose</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">channel_list</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">channel_list</span></div>
|
||||
|
||||
<div class="viewcode-block" id="print_run_info"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.print_run_info">[docs]</a><span class="k">def</span> <span class="nf">print_run_info</span><span class="p">(</span>
|
||||
<span class="n">run_number</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">print_channels</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">extra_verbose</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">base_path</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Prints overview of run information.</span>
|
||||
|
||||
<span class="sd"> Extra verbose output contains all files and pids.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">scan</span> <span class="o">=</span> <span class="n">scan_info</span><span class="p">(</span><span class="n">run_number</span><span class="p">,</span> <span class="n">base_path</span><span class="o">=</span><span class="n">base_path</span><span class="p">)</span>
|
||||
<span class="n">short</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
<span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">scan</span><span class="o">.</span><span class="n">info</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
|
||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
|
||||
<span class="n">short</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span><span class="p">[:</span><span class="mi">2</span><span class="p">]</span>
|
||||
<span class="n">short</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"..."</span><span class="p">)</span>
|
||||
<span class="n">short</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">short</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">extra_verbose</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">yaml</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="n">scan</span><span class="o">.</span><span class="n">info</span><span class="p">,</span> <span class="n">sort_keys</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">default_flow_style</span><span class="o">=</span><span class="kc">False</span><span class="p">))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">yaml</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="n">short</span><span class="p">,</span> <span class="n">sort_keys</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">default_flow_style</span><span class="o">=</span><span class="kc">False</span><span class="p">))</span>
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Number of steps: </span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="n">scan</span><span class="o">.</span><span class="n">info</span><span class="p">[</span><span class="s1">'scan_readbacks'</span><span class="p">])</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">total_size</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="k">for</span> <span class="n">files_in_step</span> <span class="ow">in</span> <span class="n">scan</span><span class="o">.</span><span class="n">info</span><span class="p">[</span><span class="s2">"scan_files"</span><span class="p">]:</span>
|
||||
<span class="k">for</span> <span class="n">file</span> <span class="ow">in</span> <span class="n">files_in_step</span><span class="p">:</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">total_size</span> <span class="o">+=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">getsize</span><span class="p">(</span><span class="n">file</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">FileNotFoundError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="k">pass</span>
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Total file size: </span><span class="si">{</span><span class="n">total_size</span><span class="o">/</span><span class="p">(</span><span class="mi">1024</span><span class="o">*</span><span class="mi">1024</span><span class="o">*</span><span class="mi">1024</span><span class="p">)</span><span class="si">:</span><span class="s2">.1f</span><span class="si">}</span><span class="s2"> GB</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">step</span> <span class="ow">in</span> <span class="n">scan</span><span class="p">:</span>
|
||||
<span class="n">ch</span> <span class="o">=</span> <span class="n">step</span><span class="o">.</span><span class="n">channels</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="nb">str</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">ch</span><span class="p">]))</span>
|
||||
<span class="c1"># print only channels for first step</span>
|
||||
<span class="k">break</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="process_run"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.process_run">[docs]</a><span class="k">def</span> <span class="nf">process_run</span><span class="p">(</span><span class="n">run_number</span><span class="p">,</span> <span class="n">rois</span><span class="p">,</span><span class="n">detector</span><span class="o">=</span><span class="s1">'JF16T03V01'</span><span class="p">,</span> <span class="n">calculate</span> <span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">only_shots</span><span class="o">=</span><span class="nb">slice</span><span class="p">(</span><span class="kc">None</span><span class="p">),</span> <span class="n">n_jobs</span><span class="o">=</span><span class="n">cpu_count</span><span class="p">()):</span>
|
||||
<span class="w"> </span><span class="sd">"""Process rois for a given detector. Save the results small data in the res/small_data/run...</span>
|
||||
<span class="sd"> By default only sum of rois is calculated, [mean,std,img] can be added to the "calculate" optional parameter.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Load scan object with SFScanInfo</span>
|
||||
<span class="n">scan</span> <span class="o">=</span> <span class="n">scan_info</span><span class="p">(</span><span class="n">run_number</span><span class="p">,</span><span class="n">small_data</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Set the path for later small data saving</span>
|
||||
<span class="n">path_with_run_folder</span> <span class="o">=</span> <span class="n">heuristic_extract_smalldata_path</span><span class="p">()</span><span class="o">+</span><span class="s1">'run'</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">run_number</span><span class="p">)</span><span class="o">.</span><span class="n">zfill</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Make the small data run folder if it doesn't exist</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span> <span class="n">path_with_run_folder</span> <span class="p">):</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span> <span class="n">path_with_run_folder</span> <span class="p">)</span>
|
||||
|
||||
<span class="c1"># Add scan info into the small_data_object</span>
|
||||
<span class="c1">#for key in scan.info.keys():</span>
|
||||
<span class="c1"># d[key]= info.info[key]</span>
|
||||
|
||||
<span class="c1"># Check if there is only one roi. If yes, make a list of it so it can be iterated over.</span>
|
||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">rois</span><span class="p">,</span> <span class="n">ROI</span><span class="p">):</span>
|
||||
<span class="n">rois</span> <span class="o">=</span> <span class="p">[</span><span class="n">rois</span><span class="p">]</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">process_step</span><span class="p">(</span><span class="n">i</span><span class="p">):</span>
|
||||
<span class="n">scan</span> <span class="o">=</span> <span class="n">scan_info</span><span class="p">(</span><span class="n">run_number</span><span class="p">,</span><span class="n">small_data</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
|
||||
<span class="n">step</span> <span class="o">=</span> <span class="n">scan</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
|
||||
<span class="k">with</span> <span class="n">step</span> <span class="k">as</span> <span class="n">data</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">SFProcFile</span><span class="p">(</span><span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">path_with_run_folder</span><span class="si">}</span><span class="s2">/acq</span><span class="si">{</span><span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">zfill</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span><span class="si">}</span><span class="s2">.smalldata.h5"</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s2">"w"</span><span class="p">)</span> <span class="k">as</span> <span class="n">sd</span><span class="p">:</span>
|
||||
|
||||
<span class="c1"># Calculate everything related to JF_rois</span>
|
||||
<span class="k">for</span> <span class="n">roi</span> <span class="ow">in</span> <span class="n">rois</span><span class="p">:</span>
|
||||
|
||||
<span class="n">bottom</span><span class="p">,</span> <span class="n">top</span><span class="p">,</span> <span class="n">left</span><span class="p">,</span> <span class="n">right</span> <span class="o">=</span> <span class="n">roi</span><span class="o">.</span><span class="n">bottom</span><span class="p">,</span> <span class="n">roi</span><span class="o">.</span><span class="n">top</span><span class="p">,</span> <span class="n">roi</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="n">roi</span><span class="o">.</span><span class="n">right</span>
|
||||
|
||||
<span class="c1"># Pulse ids for saving the new channels</span>
|
||||
<span class="n">det_pids</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">detector</span><span class="p">]</span><span class="o">.</span><span class="n">pids</span>
|
||||
<span class="n">sd</span><span class="p">[</span><span class="n">roi</span><span class="o">.</span><span class="n">name</span><span class="p">]</span> <span class="o">=</span> <span class="n">det_pids</span><span class="p">[</span><span class="n">only_shots</span><span class="p">],</span> <span class="n">data</span><span class="p">[</span><span class="n">detector</span><span class="p">][</span><span class="n">only_shots</span><span class="p">,</span> <span class="n">bottom</span><span class="p">:</span><span class="n">top</span><span class="p">,</span><span class="n">left</span><span class="p">:</span><span class="n">right</span><span class="p">]</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">axis</span><span class="o">=</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
|
||||
<span class="k">if</span> <span class="n">calculate</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="s1">'mean'</span> <span class="ow">in</span> <span class="n">calculate</span><span class="p">:</span>
|
||||
<span class="n">sd</span><span class="p">[</span><span class="n">roi</span><span class="o">.</span><span class="n">name</span><span class="o">+</span><span class="s2">"_mean"</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="n">det_pids</span><span class="p">[</span><span class="n">only_shots</span><span class="p">],</span> <span class="n">data</span><span class="p">[</span><span class="n">detector</span><span class="p">][</span><span class="n">only_shots</span><span class="p">,</span> <span class="n">bottom</span><span class="p">:</span><span class="n">top</span><span class="p">,</span><span class="n">left</span><span class="p">:</span><span class="n">right</span><span class="p">]</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">axis</span><span class="o">=</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)))</span>
|
||||
<span class="k">if</span> <span class="s1">'std'</span> <span class="ow">in</span> <span class="n">calculate</span><span class="p">:</span>
|
||||
<span class="n">sd</span><span class="p">[</span><span class="n">roi</span><span class="o">.</span><span class="n">name</span><span class="o">+</span><span class="s2">"_std"</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="n">det_pids</span><span class="p">[</span><span class="n">only_shots</span><span class="p">],</span> <span class="n">data</span><span class="p">[</span><span class="n">detector</span><span class="p">][</span><span class="n">only_shots</span><span class="p">,</span> <span class="n">bottom</span><span class="p">:</span><span class="n">top</span><span class="p">,</span><span class="n">left</span><span class="p">:</span><span class="n">right</span><span class="p">]</span><span class="o">.</span><span class="n">std</span><span class="p">(</span><span class="n">axis</span><span class="o">=</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)))</span>
|
||||
<span class="k">if</span> <span class="s1">'img'</span> <span class="ow">in</span> <span class="n">calculate</span><span class="p">:</span>
|
||||
<span class="n">sd</span><span class="p">[</span><span class="sa">f</span><span class="s1">'</span><span class="si">{</span><span class="n">roi</span><span class="o">.</span><span class="n">name</span><span class="si">}</span><span class="s1">_img'</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="n">det_pids</span><span class="p">[</span><span class="n">only_shots</span><span class="p">],</span> <span class="n">data</span><span class="p">[</span><span class="n">detector</span><span class="p">][</span><span class="n">only_shots</span><span class="p">,</span> <span class="n">bottom</span><span class="p">:</span><span class="n">top</span><span class="p">,</span><span class="n">left</span><span class="p">:</span><span class="n">right</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Currently meta files can't be read by SFData, this will be modified by Sven and then we can use it. For now saving in roi_info</span>
|
||||
<span class="c1">#sd.meta[roi.name+"_info"] = f"roi {roi.name}: {left},{right}; {bottom},{top} (left, right, bottom, top)"</span>
|
||||
|
||||
<span class="c1"># These channels have only one dataset per step of the scan, so we take the first pulseID</span>
|
||||
<span class="n">sd</span><span class="p">[</span><span class="n">roi</span><span class="o">.</span><span class="n">name</span> <span class="o">+</span> <span class="s2">"_info"</span><span class="p">]</span> <span class="o">=</span><span class="p">([</span><span class="n">det_pids</span><span class="p">[</span><span class="mi">0</span><span class="p">]],</span> <span class="p">[</span><span class="sa">f</span><span class="s2">"roi </span><span class="si">{</span><span class="n">roi</span><span class="o">.</span><span class="n">name</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">left</span><span class="si">}</span><span class="s2">,</span><span class="si">{</span><span class="n">right</span><span class="si">}</span><span class="s2">; </span><span class="si">{</span><span class="n">bottom</span><span class="si">}</span><span class="s2">,</span><span class="si">{</span><span class="n">top</span><span class="si">}</span><span class="s2"> (left, right, bottom, top)"</span><span class="p">])</span>
|
||||
<span class="n">sd</span><span class="p">[</span><span class="n">roi</span><span class="o">.</span><span class="n">name</span> <span class="o">+</span> <span class="s2">"_mean_img"</span><span class="p">]</span> <span class="o">=</span> <span class="p">([</span><span class="n">det_pids</span><span class="p">[</span><span class="mi">0</span><span class="p">]],</span> <span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="n">detector</span><span class="p">][:,</span> <span class="n">bottom</span><span class="p">:</span><span class="n">top</span><span class="p">,</span><span class="n">left</span><span class="p">:</span><span class="n">right</span><span class="p">]</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">axis</span><span class="o">=</span><span class="p">(</span><span class="mi">0</span><span class="p">))]</span> <span class="p">)</span>
|
||||
|
||||
<span class="n">Parallel</span><span class="p">(</span><span class="n">n_jobs</span><span class="o">=</span><span class="n">n_jobs</span><span class="p">,</span><span class="n">verbose</span><span class="o">=</span><span class="mi">10</span><span class="p">)(</span><span class="n">delayed</span><span class="p">(</span><span class="n">process_step</span><span class="p">)(</span><span class="n">i</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">scan</span><span class="p">)))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ROI"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.ROI">[docs]</a><span class="k">class</span> <span class="nc">ROI</span><span class="p">:</span>
|
||||
<span class="w"> </span><span class="sd">"""Definition of region of interest (ROI) in image coordinates.</span>
|
||||
|
||||
<span class="sd"> Example: ROI(left=10, right=20, bottom=100, top=200). </span>
|
||||
|
||||
<span class="sd"> Directions assume that lower left corner of image is at (x=0, y=0).</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span>
|
||||
<span class="bp">self</span><span class="p">,</span>
|
||||
<span class="n">left</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">right</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">top</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">bottom</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">center_x</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">center_y</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">width</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">height</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">):</span>
|
||||
|
||||
<span class="k">if</span> <span class="kc">None</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">bottom</span><span class="p">,</span> <span class="n">top</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">right</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">bottom</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">top</span><span class="p">,</span> <span class="o">=</span> <span class="p">(</span>
|
||||
<span class="n">left</span><span class="p">,</span>
|
||||
<span class="n">right</span><span class="p">,</span>
|
||||
<span class="n">bottom</span><span class="p">,</span>
|
||||
<span class="n">top</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="kc">None</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="n">center_x</span><span class="p">,</span> <span class="n">center_y</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">height</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">from_centers_widths</span><span class="p">(</span><span class="n">center_x</span><span class="p">,</span> <span class="n">center_y</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">height</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"No valid ROI definition."</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Check that ROI has a name or generate default</span>
|
||||
<span class="k">if</span> <span class="n">name</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="sa">f</span><span class="s2">"No ROI name given, generating: </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="fm">__repr__</span><span class="p">()</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="n">name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="fm">__repr__</span><span class="p">()</span>
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
||||
|
||||
<div class="viewcode-block" id="ROI.from_centers_widths"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.ROI.from_centers_widths">[docs]</a> <span class="k">def</span> <span class="nf">from_centers_widths</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">center_x</span><span class="p">,</span> <span class="n">center_y</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">height</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">left</span> <span class="o">=</span> <span class="n">center_x</span> <span class="o">-</span> <span class="n">width</span> <span class="o">//</span> <span class="mi">2</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">right</span> <span class="o">=</span> <span class="n">center_x</span> <span class="o">+</span> <span class="n">width</span> <span class="o">//</span> <span class="mi">2</span>
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">top</span> <span class="o">=</span> <span class="n">center_y</span> <span class="o">+</span> <span class="n">height</span> <span class="o">//</span> <span class="mi">2</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">bottom</span> <span class="o">=</span> <span class="n">center_y</span> <span class="o">-</span> <span class="n">height</span> <span class="o">//</span> <span class="mi">2</span></div>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">rows</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="nb">slice</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">bottom</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">top</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">LeftRightBottomTop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">right</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">bottom</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">top</span><span class="p">]</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">cols</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="nb">slice</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">right</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">width</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">right</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">left</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">height</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">top</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">bottom</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="sa">f</span><span class="s2">"ROI(bottom=</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">bottom</span><span class="si">}</span><span class="s2">,top=</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">top</span><span class="si">}</span><span class="s2">,left=</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">left</span><span class="si">}</span><span class="s2">,right=</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">right</span><span class="si">}</span><span class="s2">)"</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
|
||||
<span class="c1"># we disregard the name for comparisons</span>
|
||||
<span class="k">return</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">right</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">bottom</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">top</span><span class="p">)</span> <span class="o">==</span> <span class="p">(</span><span class="n">other</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="n">other</span><span class="o">.</span><span class="n">right</span><span class="p">,</span> <span class="n">other</span><span class="o">.</span><span class="n">bottom</span><span class="p">,</span> <span class="n">other</span><span class="o">.</span><span class="n">top</span><span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__ne__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="ow">not</span> <span class="bp">self</span> <span class="o">==</span> <span class="n">other</span> </div>
|
||||
|
||||
|
||||
<span class="c1">######################## Setting up paths ########################</span>
|
||||
|
||||
<div class="viewcode-block" id="heuristic_extract_pgroup"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.heuristic_extract_pgroup">[docs]</a><span class="k">def</span> <span class="nf">heuristic_extract_pgroup</span><span class="p">(</span><span class="n">path</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">""" The function tries to guess the current p-group from the </span>
|
||||
<span class="sd"> current working directory (default) or the contents of </span>
|
||||
<span class="sd"> the given path.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">path</span> <span class="o">=</span> <span class="n">path</span> <span class="ow">or</span> <span class="n">os</span><span class="o">.</span><span class="n">getcwd</span><span class="p">()</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"/p"</span> <span class="ow">in</span> <span class="n">path</span><span class="p">:</span>
|
||||
<span class="c1"># Cut the string and look at the next five letters after /p</span>
|
||||
<span class="n">p_number</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">partition</span><span class="p">(</span><span class="s2">"/p"</span><span class="p">)[</span><span class="mi">2</span><span class="p">][:</span><span class="mi">5</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">p_number</span><span class="o">.</span><span class="n">isdigit</span><span class="p">():</span>
|
||||
<span class="k">raise</span> <span class="ne">KeyError</span><span class="p">(</span><span class="s2">"Automatic p-group extraction from the current working directory didn't work."</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">KeyError</span><span class="p">(</span><span class="s2">"Automatic p-group extraction from the current working directory didn't work."</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">p_number</span> </div>
|
||||
|
||||
<div class="viewcode-block" id="heuristic_extract_base_path"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.heuristic_extract_base_path">[docs]</a><span class="k">def</span> <span class="nf">heuristic_extract_base_path</span><span class="p">():</span>
|
||||
<span class="w"> </span><span class="sd">""" The function tries to guess the full path where the raw data is saved."""</span>
|
||||
<span class="n">p_number</span> <span class="o">=</span> <span class="n">heuristic_extract_pgroup</span><span class="p">()</span>
|
||||
<span class="n">base_path</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"/sf/cristallina/data/p</span><span class="si">{</span><span class="n">p_number</span><span class="si">}</span><span class="s2">/raw/"</span>
|
||||
<span class="k">return</span> <span class="n">base_path</span> </div>
|
||||
|
||||
<div class="viewcode-block" id="heuristic_extract_smalldata_path"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.heuristic_extract_smalldata_path">[docs]</a><span class="k">def</span> <span class="nf">heuristic_extract_smalldata_path</span><span class="p">():</span>
|
||||
<span class="w"> </span><span class="sd">""" The function tries to guess the full path where the small data is saved."""</span>
|
||||
<span class="n">p_number</span> <span class="o">=</span> <span class="n">heuristic_extract_pgroup</span><span class="p">()</span>
|
||||
<span class="n">small_data_path</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"/das/work/units/cristallina/p</span><span class="si">{</span><span class="n">p_number</span><span class="si">}</span><span class="s2">/smalldata/"</span>
|
||||
<span class="k">return</span> <span class="n">small_data_path</span> </div>
|
||||
|
||||
<span class="c1">######################## Little useful functions ########################</span>
|
||||
|
||||
<div class="viewcode-block" id="find_nearest"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.find_nearest">[docs]</a><span class="k">def</span> <span class="nf">find_nearest</span><span class="p">(</span><span class="n">array</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">'''Finds an index in an array with a value that is nearest to given number'''</span>
|
||||
<span class="n">array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">asarray</span><span class="p">(</span><span class="n">array</span><span class="p">)</span>
|
||||
<span class="n">idx</span> <span class="o">=</span> <span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">array</span> <span class="o">-</span> <span class="n">value</span><span class="p">))</span><span class="o">.</span><span class="n">argmin</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="n">idx</span></div>
|
||||
|
||||
<div class="viewcode-block" id="find_two_nearest"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.find_two_nearest">[docs]</a><span class="k">def</span> <span class="nf">find_two_nearest</span><span class="p">(</span><span class="n">time_array</span><span class="p">,</span><span class="n">percentage</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">'''Finds indeces of the two values that are the nearest to the given value in an array'''</span>
|
||||
<span class="n">array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">asarray</span><span class="p">(</span><span class="n">time_array</span><span class="p">)</span>
|
||||
<span class="n">value</span> <span class="o">=</span> <span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">max</span><span class="p">(</span><span class="n">array</span><span class="p">)</span><span class="o">-</span><span class="n">np</span><span class="o">.</span><span class="n">min</span><span class="p">(</span><span class="n">array</span><span class="p">))</span><span class="o">*</span><span class="n">percentage</span><span class="o">+</span><span class="n">np</span><span class="o">.</span><span class="n">min</span><span class="p">(</span><span class="n">array</span><span class="p">)</span>
|
||||
<span class="n">idx</span> <span class="o">=</span> <span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">array</span> <span class="o">-</span> <span class="n">value</span><span class="p">))</span><span class="o">.</span><span class="n">argmin</span><span class="p">()</span>
|
||||
<span class="n">indices</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sort</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">argsort</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">array</span><span class="o">-</span><span class="n">value</span><span class="p">))[</span><span class="mi">0</span><span class="p">],</span> <span class="n">np</span><span class="o">.</span><span class="n">argsort</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">array</span><span class="o">-</span><span class="n">value</span><span class="p">))[</span><span class="mi">1</span><span class="p">]])</span>
|
||||
<span class="k">return</span> <span class="n">indices</span> </div>
|
||||
|
||||
<div class="viewcode-block" id="gauss"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.gauss">[docs]</a><span class="k">def</span> <span class="nf">gauss</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">H</span><span class="p">,</span> <span class="n">A</span><span class="p">,</span> <span class="n">x0</span><span class="p">,</span> <span class="n">sigma</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Returns gauss function value"""</span>
|
||||
<span class="k">return</span> <span class="n">H</span> <span class="o">+</span> <span class="n">A</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="n">x0</span><span class="p">)</span> <span class="o">**</span> <span class="mi">2</span> <span class="o">/</span> <span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">sigma</span> <span class="o">**</span> <span class="mi">2</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="gauss_fit"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.gauss_fit">[docs]</a><span class="k">def</span> <span class="nf">gauss_fit</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">fit_details</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">plot</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">'''Returns [baseline_offset, Amplitude, center, sigma, FWHM]'''</span>
|
||||
|
||||
<span class="c1"># Initial guesses</span>
|
||||
<span class="n">mean</span> <span class="o">=</span> <span class="nb">sum</span><span class="p">(</span><span class="n">x</span> <span class="o">*</span> <span class="n">y</span><span class="p">)</span> <span class="o">/</span> <span class="nb">sum</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
|
||||
<span class="n">sigma</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="nb">sum</span><span class="p">(</span><span class="n">y</span> <span class="o">*</span> <span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="n">mean</span><span class="p">)</span> <span class="o">**</span> <span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="nb">sum</span><span class="p">(</span><span class="n">y</span><span class="p">))</span>
|
||||
<span class="n">FWHM</span> <span class="o">=</span> <span class="mf">2.35482</span> <span class="o">*</span> <span class="n">sigma</span>
|
||||
|
||||
<span class="c1"># Fit</span>
|
||||
<span class="n">popt</span><span class="p">,</span> <span class="n">pcov</span> <span class="o">=</span> <span class="n">curve_fit</span><span class="p">(</span><span class="n">gauss</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">p0</span><span class="o">=</span><span class="p">[</span><span class="nb">min</span><span class="p">(</span><span class="n">y</span><span class="p">),</span> <span class="nb">max</span><span class="p">(</span><span class="n">y</span><span class="p">),</span> <span class="n">mean</span><span class="p">,</span> <span class="n">sigma</span><span class="p">])</span>
|
||||
|
||||
<span class="c1"># Add FWHM to the ouptuts</span>
|
||||
<span class="n">popt</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">popt</span><span class="p">,</span><span class="mf">2.35482</span> <span class="o">*</span> <span class="n">popt</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span>
|
||||
|
||||
<span class="c1"># Print results</span>
|
||||
<span class="k">if</span> <span class="n">fit_details</span> <span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s1">'The baseline offset is'</span><span class="p">,</span> <span class="n">popt</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s1">'The center is'</span><span class="p">,</span> <span class="n">popt</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s1">'The sigma of the fit is'</span><span class="p">,</span> <span class="n">popt</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s1">'The maximum intensity is'</span><span class="p">,</span> <span class="n">popt</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">popt</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s1">'The Amplitude is'</span><span class="p">,</span> <span class="n">popt</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s1">'The FWHM is'</span><span class="p">,</span> <span class="mf">2.35482</span> <span class="o">*</span> <span class="n">popt</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span>
|
||||
|
||||
<span class="c1"># Show plot</span>
|
||||
<span class="k">if</span> <span class="n">plot</span><span class="p">:</span>
|
||||
<span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">()</span>
|
||||
<span class="n">plt</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="s1">'.k'</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s1">'data'</span><span class="p">)</span>
|
||||
<span class="n">plt</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">gauss</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">*</span><span class="n">gauss_fit</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)[</span><span class="mi">0</span><span class="p">:</span><span class="mi">4</span><span class="p">]),</span> <span class="s1">'--r'</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s1">'fit'</span><span class="p">)</span>
|
||||
|
||||
<span class="n">plt</span><span class="o">.</span><span class="n">legend</span><span class="p">()</span>
|
||||
<span class="n">plt</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s1">'Gaussian fit'</span><span class="p">)</span>
|
||||
<span class="n">plt</span><span class="o">.</span><span class="n">xlabel</span><span class="p">(</span><span class="s1">'X'</span><span class="p">)</span>
|
||||
<span class="n">plt</span><span class="o">.</span><span class="n">ylabel</span><span class="p">(</span><span class="s1">'Y'</span><span class="p">)</span>
|
||||
<span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">popt</span></div>
|
||||
|
||||
<div class="viewcode-block" id="xray_transmission"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.xray_transmission">[docs]</a><span class="k">def</span> <span class="nf">xray_transmission</span><span class="p">(</span><span class="n">energy</span><span class="p">,</span><span class="n">thickness</span><span class="p">,</span><span class="n">material</span><span class="o">=</span><span class="s1">'Si'</span><span class="p">,</span><span class="n">density</span><span class="o">=</span><span class="p">[]):</span>
|
||||
<span class="w"> </span><span class="sd">'''Calculate x-ray tranmission for given energy, thickness and material. Default material is Si. Add material=element as a string for another material. Density as optional parameter'''</span>
|
||||
|
||||
<span class="n">mu</span> <span class="o">=</span> <span class="n">material_mu</span><span class="p">(</span><span class="n">material</span><span class="p">,</span> <span class="n">energy</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">density</span> <span class="o">==</span> <span class="p">[]:</span>
|
||||
<span class="n">mu_array</span> <span class="o">=</span> <span class="n">material_mu</span><span class="p">(</span><span class="n">material</span><span class="p">,</span> <span class="n">energy</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">mu_array</span> <span class="o">=</span> <span class="n">material_mu</span><span class="p">(</span><span class="n">formula</span><span class="p">,</span> <span class="n">energy</span><span class="p">,</span> <span class="n">density</span><span class="o">=</span><span class="n">density</span><span class="p">)</span>
|
||||
|
||||
<span class="n">trans</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="mf">0.1</span><span class="o">*</span><span class="p">(</span><span class="n">thickness</span><span class="o">*</span><span class="mi">1000</span><span class="p">)</span><span class="o">*</span><span class="n">mu_array</span><span class="p">)</span> <span class="c1"># 0.1 is beccause mu is in 1/cm, thickness converted to mm from m</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">trans</span> </div>
|
||||
|
||||
<span class="c1">######################## Unit conversions ########################</span>
|
||||
|
||||
<div class="viewcode-block" id="joules_to_eV"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.joules_to_eV">[docs]</a><span class="k">def</span> <span class="nf">joules_to_eV</span><span class="p">(</span><span class="n">joules</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Just a unit conversion"""</span>
|
||||
<span class="n">eV</span> <span class="o">=</span> <span class="n">joules</span> <span class="o">*</span> <span class="mf">6.241509e18</span>
|
||||
<span class="k">return</span> <span class="n">eV</span></div>
|
||||
|
||||
<div class="viewcode-block" id="eV_to_joules"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.eV_to_joules">[docs]</a><span class="k">def</span> <span class="nf">eV_to_joules</span><span class="p">(</span><span class="n">eV</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Just a unit conversion"""</span>
|
||||
<span class="n">joules</span> <span class="o">=</span> <span class="n">eV</span> <span class="o">*</span> <span class="mf">1.602176565e-19</span>
|
||||
<span class="k">return</span> <span class="n">joules</span> </div>
|
||||
|
||||
<div class="viewcode-block" id="photon_energy_from_wavelength"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.photon_energy_from_wavelength">[docs]</a><span class="k">def</span> <span class="nf">photon_energy_from_wavelength</span><span class="p">(</span><span class="n">wavelength</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">'''Returns photon energy in eV from wavelength in meters. Source https://www.kmlabs.com/en/wavelength-to-photon-energy-calculator'''</span>
|
||||
<span class="n">Eph</span> <span class="o">=</span> <span class="mf">1239.8</span> <span class="o">/</span> <span class="p">(</span><span class="n">wavelength</span><span class="o">*</span><span class="mf">1e9</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">Eph</span></div>
|
||||
|
||||
<div class="viewcode-block" id="wavelength_from_photon_energy"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.wavelength_from_photon_energy">[docs]</a><span class="k">def</span> <span class="nf">wavelength_from_photon_energy</span><span class="p">(</span><span class="n">Eph</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">'''Returns wavelength in meters from photon energy in eV. Source https://www.kmlabs.com/en/wavelength-to-photon-energy-calculator'''</span>
|
||||
<span class="n">wavelength</span> <span class="o">=</span> <span class="mf">1239.8</span> <span class="o">/</span> <span class="p">(</span><span class="n">Eph</span><span class="o">*</span><span class="mf">1e9</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">wavelength</span></div>
|
||||
|
||||
<div class="viewcode-block" id="sigma_to_FWHM"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.sigma_to_FWHM">[docs]</a><span class="k">def</span> <span class="nf">sigma_to_FWHM</span><span class="p">(</span><span class="n">sigma</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Gaussian sigma to FWHM"""</span>
|
||||
<span class="n">FWHM</span> <span class="o">=</span> <span class="n">sigma</span> <span class="o">*</span> <span class="mf">2.355</span>
|
||||
<span class="k">return</span> <span class="n">FWHM</span></div>
|
||||
|
||||
<div class="viewcode-block" id="FWHM_to_sigma"><a class="viewcode-back" href="../../api/cristallina.html#cristallina.utils.FWHM_to_sigma">[docs]</a><span class="k">def</span> <span class="nf">FWHM_to_sigma</span><span class="p">(</span><span class="n">FWHM</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""FWHM to gaussian sigma"""</span>
|
||||
<span class="n">sigma</span> <span class="o">=</span> <span class="n">FWHM</span> <span class="o">/</span> <span class="mf">2.355</span>
|
||||
<span class="k">return</span> <span class="n">sigma</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="../../index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="../../index.html">Documentation overview</a><ul>
|
||||
<li><a href="../index.html">Module code</a><ul>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
108
docs/_build/html/_modules/index.html
vendored
Normal file
108
docs/_build/html/_modules/index.html
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Overview: module code — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css" />
|
||||
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
<script src="../_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
|
||||
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>All modules for which code is available</h1>
|
||||
<ul><li><a href="cristallina/SEA_GraphClient.html">cristallina.SEA_GraphClient</a></li>
|
||||
<li><a href="cristallina/analysis.html">cristallina.analysis</a></li>
|
||||
<li><a href="cristallina/plot.html">cristallina.plot</a></li>
|
||||
<li><a href="cristallina/skeleton.html">cristallina.skeleton</a></li>
|
||||
<li><a href="cristallina/utils.html">cristallina.utils</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="../index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="../index.html">Documentation overview</a><ul>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
61
docs/_build/html/_sources/api/cristallina.rst.txt
vendored
Normal file
61
docs/_build/html/_sources/api/cristallina.rst.txt
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
cristallina package
|
||||
===================
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
cristallina.SEA\_GraphClient module
|
||||
-----------------------------------
|
||||
|
||||
.. automodule:: cristallina.SEA_GraphClient
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
cristallina.analysis module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: cristallina.analysis
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
cristallina.config module
|
||||
-------------------------
|
||||
|
||||
.. automodule:: cristallina.config
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
cristallina.plot module
|
||||
-----------------------
|
||||
|
||||
.. automodule:: cristallina.plot
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
cristallina.skeleton module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: cristallina.skeleton
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
cristallina.utils module
|
||||
------------------------
|
||||
|
||||
.. automodule:: cristallina.utils
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: cristallina
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
7
docs/_build/html/_sources/api/modules.rst.txt
vendored
Normal file
7
docs/_build/html/_sources/api/modules.rst.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
cristallina
|
||||
===========
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
|
||||
cristallina
|
||||
2
docs/_build/html/_sources/authors.rst.txt
vendored
Normal file
2
docs/_build/html/_sources/authors.rst.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.. _authors:
|
||||
.. include:: ../AUTHORS.rst
|
||||
2
docs/_build/html/_sources/changelog.rst.txt
vendored
Normal file
2
docs/_build/html/_sources/changelog.rst.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.. _changes:
|
||||
.. include:: ../CHANGELOG.rst
|
||||
1
docs/_build/html/_sources/contributing.rst.txt
vendored
Normal file
1
docs/_build/html/_sources/contributing.rst.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.. include:: ../CONTRIBUTING.rst
|
||||
61
docs/_build/html/_sources/index.rst.txt
vendored
Normal file
61
docs/_build/html/_sources/index.rst.txt
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
===========
|
||||
cristallina
|
||||
===========
|
||||
|
||||
This is the documentation of **cristallina**.
|
||||
|
||||
.. note::
|
||||
|
||||
This is the main page of your project's `Sphinx`_ documentation.
|
||||
It is formatted in `reStructuredText`_. Add additional pages
|
||||
by creating rst-files in ``docs`` and adding them to the `toctree`_ below.
|
||||
Use then `references`_ in order to link them from this page, e.g.
|
||||
:ref:`authors` and :ref:`changes`.
|
||||
|
||||
It is also possible to refer to the documentation of other Python packages
|
||||
with the `Python domain syntax`_. By default you can reference the
|
||||
documentation of `Sphinx`_, `Python`_, `NumPy`_, `SciPy`_, `matplotlib`_,
|
||||
`Pandas`_, `Scikit-Learn`_. You can add more by extending the
|
||||
``intersphinx_mapping`` in your Sphinx's ``conf.py``.
|
||||
|
||||
The pretty useful extension `autodoc`_ is activated by default and lets
|
||||
you include documentation from docstrings. Docstrings can be written in
|
||||
`Google style`_ (recommended!), `NumPy style`_ and `classical style`_.
|
||||
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
Overview <readme>
|
||||
Contributions & Help <contributing>
|
||||
License <license>
|
||||
Authors <authors>
|
||||
Changelog <changelog>
|
||||
Module Reference <api/modules>
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
.. _toctree: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html
|
||||
.. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
|
||||
.. _references: https://www.sphinx-doc.org/en/stable/markup/inline.html
|
||||
.. _Python domain syntax: https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-python-domain
|
||||
.. _Sphinx: https://www.sphinx-doc.org/
|
||||
.. _Python: https://docs.python.org/
|
||||
.. _Numpy: https://numpy.org/doc/stable
|
||||
.. _SciPy: https://docs.scipy.org/doc/scipy/reference/
|
||||
.. _matplotlib: https://matplotlib.org/contents.html#
|
||||
.. _Pandas: https://pandas.pydata.org/pandas-docs/stable
|
||||
.. _Scikit-Learn: https://scikit-learn.org/stable
|
||||
.. _autodoc: https://www.sphinx-doc.org/en/master/ext/autodoc.html
|
||||
.. _Google style: https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
|
||||
.. _NumPy style: https://numpydoc.readthedocs.io/en/latest/format.html
|
||||
.. _classical style: https://www.sphinx-doc.org/en/master/domains.html#info-field-lists
|
||||
7
docs/_build/html/_sources/license.rst.txt
vendored
Normal file
7
docs/_build/html/_sources/license.rst.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
.. _license:
|
||||
|
||||
=======
|
||||
License
|
||||
=======
|
||||
|
||||
.. include:: ../LICENSE.txt
|
||||
2
docs/_build/html/_sources/readme.rst.txt
vendored
Normal file
2
docs/_build/html/_sources/readme.rst.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.. _readme:
|
||||
.. include:: ../README.rst
|
||||
703
docs/_build/html/_static/alabaster.css
vendored
Normal file
703
docs/_build/html/_static/alabaster.css
vendored
Normal file
@@ -0,0 +1,703 @@
|
||||
@import url("basic.css");
|
||||
|
||||
/* -- page layout ----------------------------------------------------------- */
|
||||
|
||||
body {
|
||||
font-family: Georgia, serif;
|
||||
font-size: 17px;
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
div.document {
|
||||
width: 1200px;
|
||||
margin: 30px auto 0 auto;
|
||||
}
|
||||
|
||||
div.documentwrapper {
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.bodywrapper {
|
||||
margin: 0 0 0 300px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar {
|
||||
width: 300px;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 1px solid #B1B4B6;
|
||||
}
|
||||
|
||||
div.body {
|
||||
background-color: #fff;
|
||||
color: #3E4349;
|
||||
padding: 0 30px 0 30px;
|
||||
}
|
||||
|
||||
div.body > .section {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.footer {
|
||||
width: 1200px;
|
||||
margin: 20px auto 30px auto;
|
||||
font-size: 14px;
|
||||
color: #888;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.footer a {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
p.caption {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
|
||||
div.relations {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
div.sphinxsidebar a {
|
||||
color: #444;
|
||||
text-decoration: none;
|
||||
border-bottom: 1px dotted #999;
|
||||
}
|
||||
|
||||
div.sphinxsidebar a:hover {
|
||||
border-bottom: 1px solid #999;
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper {
|
||||
padding: 18px 10px;
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper p.logo {
|
||||
padding: 0;
|
||||
margin: -10px 0 0 0px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper h1.logo {
|
||||
margin-top: -10px;
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper h1.logo-name {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper p.blurb {
|
||||
margin-top: 0;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3,
|
||||
div.sphinxsidebar h4 {
|
||||
font-family: Georgia, serif;
|
||||
color: #444;
|
||||
font-size: 24px;
|
||||
font-weight: normal;
|
||||
margin: 0 0 5px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h4 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3 a {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
div.sphinxsidebar p.logo a,
|
||||
div.sphinxsidebar h3 a,
|
||||
div.sphinxsidebar p.logo a:hover,
|
||||
div.sphinxsidebar h3 a:hover {
|
||||
border: none;
|
||||
}
|
||||
|
||||
div.sphinxsidebar p {
|
||||
color: #555;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul {
|
||||
margin: 10px 0;
|
||||
padding: 0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul li.toctree-l1 > a {
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul li.toctree-l2 > a {
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
div.sphinxsidebar input {
|
||||
border: 1px solid #CCC;
|
||||
font-family: Georgia, serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar hr {
|
||||
border: none;
|
||||
height: 1px;
|
||||
color: #AAA;
|
||||
background: #AAA;
|
||||
|
||||
text-align: left;
|
||||
margin-left: 0;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .badge {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .badge:hover {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
/* To address an issue with donation coming after search */
|
||||
div.sphinxsidebar h3.donation {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* -- body styles ----------------------------------------------------------- */
|
||||
|
||||
a {
|
||||
color: #004B6B;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #6D4100;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
div.body h1,
|
||||
div.body h2,
|
||||
div.body h3,
|
||||
div.body h4,
|
||||
div.body h5,
|
||||
div.body h6 {
|
||||
font-family: Georgia, serif;
|
||||
font-weight: normal;
|
||||
margin: 30px 0px 10px 0px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }
|
||||
div.body h2 { font-size: 180%; }
|
||||
div.body h3 { font-size: 150%; }
|
||||
div.body h4 { font-size: 130%; }
|
||||
div.body h5 { font-size: 100%; }
|
||||
div.body h6 { font-size: 100%; }
|
||||
|
||||
a.headerlink {
|
||||
color: #DDD;
|
||||
padding: 0 4px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.headerlink:hover {
|
||||
color: #444;
|
||||
background: #EAEAEA;
|
||||
}
|
||||
|
||||
div.body p, div.body dd, div.body li {
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
div.admonition {
|
||||
margin: 20px 0px;
|
||||
padding: 10px 30px;
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.admonition tt.xref, div.admonition code.xref, div.admonition a tt {
|
||||
background-color: #FBFBFB;
|
||||
border-bottom: 1px solid #fafafa;
|
||||
}
|
||||
|
||||
div.admonition p.admonition-title {
|
||||
font-family: Georgia, serif;
|
||||
font-weight: normal;
|
||||
font-size: 24px;
|
||||
margin: 0 0 10px 0;
|
||||
padding: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
div.admonition p.last {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div.highlight {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
dt:target, .highlight {
|
||||
background: #FAF3E8;
|
||||
}
|
||||
|
||||
div.warning {
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
}
|
||||
|
||||
div.danger {
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
-moz-box-shadow: 2px 2px 4px #D52C2C;
|
||||
-webkit-box-shadow: 2px 2px 4px #D52C2C;
|
||||
box-shadow: 2px 2px 4px #D52C2C;
|
||||
}
|
||||
|
||||
div.error {
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
-moz-box-shadow: 2px 2px 4px #D52C2C;
|
||||
-webkit-box-shadow: 2px 2px 4px #D52C2C;
|
||||
box-shadow: 2px 2px 4px #D52C2C;
|
||||
}
|
||||
|
||||
div.caution {
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
}
|
||||
|
||||
div.attention {
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
}
|
||||
|
||||
div.important {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.note {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.tip {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.hint {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.seealso {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.topic {
|
||||
background-color: #EEE;
|
||||
}
|
||||
|
||||
p.admonition-title {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
p.admonition-title:after {
|
||||
content: ":";
|
||||
}
|
||||
|
||||
pre, tt, code {
|
||||
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.hll {
|
||||
background-color: #FFC;
|
||||
margin: 0 -12px;
|
||||
padding: 0 12px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
img.screenshot {
|
||||
}
|
||||
|
||||
tt.descname, tt.descclassname, code.descname, code.descclassname {
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
tt.descname, code.descname {
|
||||
padding-right: 0.08em;
|
||||
}
|
||||
|
||||
img.screenshot {
|
||||
-moz-box-shadow: 2px 2px 4px #EEE;
|
||||
-webkit-box-shadow: 2px 2px 4px #EEE;
|
||||
box-shadow: 2px 2px 4px #EEE;
|
||||
}
|
||||
|
||||
table.docutils {
|
||||
border: 1px solid #888;
|
||||
-moz-box-shadow: 2px 2px 4px #EEE;
|
||||
-webkit-box-shadow: 2px 2px 4px #EEE;
|
||||
box-shadow: 2px 2px 4px #EEE;
|
||||
}
|
||||
|
||||
table.docutils td, table.docutils th {
|
||||
border: 1px solid #888;
|
||||
padding: 0.25em 0.7em;
|
||||
}
|
||||
|
||||
table.field-list, table.footnote {
|
||||
border: none;
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
table.footnote {
|
||||
margin: 15px 0;
|
||||
width: 100%;
|
||||
border: 1px solid #EEE;
|
||||
background: #FDFDFD;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
table.footnote + table.footnote {
|
||||
margin-top: -15px;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
table.field-list th {
|
||||
padding: 0 0.8em 0 0;
|
||||
}
|
||||
|
||||
table.field-list td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.field-list p {
|
||||
margin-bottom: 0.8em;
|
||||
}
|
||||
|
||||
/* Cloned from
|
||||
* https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68
|
||||
*/
|
||||
.field-name {
|
||||
-moz-hyphens: manual;
|
||||
-ms-hyphens: manual;
|
||||
-webkit-hyphens: manual;
|
||||
hyphens: manual;
|
||||
}
|
||||
|
||||
table.footnote td.label {
|
||||
width: .1px;
|
||||
padding: 0.3em 0 0.3em 0.5em;
|
||||
}
|
||||
|
||||
table.footnote td {
|
||||
padding: 0.3em 0.5em;
|
||||
}
|
||||
|
||||
dl {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
margin-top: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
dl dd {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 0 0 0 30px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
/* Matches the 30px from the narrow-screen "li > ul" selector below */
|
||||
margin: 10px 0 10px 30px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: #EEE;
|
||||
padding: 7px 30px;
|
||||
margin: 15px 0px;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
div.viewcode-block:target {
|
||||
background: #ffd;
|
||||
}
|
||||
|
||||
dl pre, blockquote pre, li pre {
|
||||
margin-left: 0;
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
tt, code {
|
||||
background-color: #ecf0f3;
|
||||
color: #222;
|
||||
/* padding: 1px 2px; */
|
||||
}
|
||||
|
||||
tt.xref, code.xref, a tt {
|
||||
background-color: #FBFBFB;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
|
||||
a.reference {
|
||||
text-decoration: none;
|
||||
border-bottom: 1px dotted #004B6B;
|
||||
}
|
||||
|
||||
/* Don't put an underline on images */
|
||||
a.image-reference, a.image-reference:hover {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
a.reference:hover {
|
||||
border-bottom: 1px solid #6D4100;
|
||||
}
|
||||
|
||||
a.footnote-reference {
|
||||
text-decoration: none;
|
||||
font-size: 0.7em;
|
||||
vertical-align: top;
|
||||
border-bottom: 1px dotted #004B6B;
|
||||
}
|
||||
|
||||
a.footnote-reference:hover {
|
||||
border-bottom: 1px solid #6D4100;
|
||||
}
|
||||
|
||||
a:hover tt, a:hover code {
|
||||
background: #EEE;
|
||||
}
|
||||
|
||||
|
||||
@media screen and (max-width: 870px) {
|
||||
|
||||
div.sphinxsidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.document {
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
div.documentwrapper {
|
||||
margin-left: 0;
|
||||
margin-top: 0;
|
||||
margin-right: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div.bodywrapper {
|
||||
margin-top: 0;
|
||||
margin-right: 0;
|
||||
margin-bottom: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
li > ul {
|
||||
/* Matches the 30px from the "ul, ol" selector above */
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.document {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.bodywrapper {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.github {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media screen and (max-width: 875px) {
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 20px 30px;
|
||||
}
|
||||
|
||||
div.documentwrapper {
|
||||
float: none;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
div.sphinxsidebar {
|
||||
display: block;
|
||||
float: none;
|
||||
width: 102.5%;
|
||||
margin: 50px -30px -20px -30px;
|
||||
padding: 10px 20px;
|
||||
background: #333;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,
|
||||
div.sphinxsidebar h3 a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
div.sphinxsidebar a {
|
||||
color: #AAA;
|
||||
}
|
||||
|
||||
div.sphinxsidebar p.logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.document {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.bodywrapper {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.body {
|
||||
min-height: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.rtd_doc_footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.document {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.github {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* misc. */
|
||||
|
||||
.revsys-inline {
|
||||
display: none!important;
|
||||
}
|
||||
|
||||
/* Make nested-list/multi-paragraph items look better in Releases changelog
|
||||
* pages. Without this, docutils' magical list fuckery causes inconsistent
|
||||
* formatting between different release sub-lists.
|
||||
*/
|
||||
div#changelog > div.section > ul > li > p:only-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Hide fugly table cell borders in ..bibliography:: directive output */
|
||||
table.docutils.citation, table.docutils.citation td, table.docutils.citation th {
|
||||
border: none;
|
||||
/* Below needed in some edge cases; if not applied, bottom shadows appear */
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
|
||||
/* relbar */
|
||||
|
||||
.related {
|
||||
line-height: 30px;
|
||||
width: 100%;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.related.top {
|
||||
border-bottom: 1px solid #EEE;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.related.bottom {
|
||||
border-top: 1px solid #EEE;
|
||||
}
|
||||
|
||||
.related ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.related li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
nav#rellinks {
|
||||
float: right;
|
||||
}
|
||||
|
||||
nav#rellinks li+li:before {
|
||||
content: "|";
|
||||
}
|
||||
|
||||
nav#breadcrumbs li+li:before {
|
||||
content: "\00BB";
|
||||
}
|
||||
|
||||
/* Hide certain items when printing */
|
||||
@media print {
|
||||
div.related {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
903
docs/_build/html/_static/basic.css
vendored
Normal file
903
docs/_build/html/_static/basic.css
vendored
Normal file
@@ -0,0 +1,903 @@
|
||||
/*
|
||||
* basic.css
|
||||
* ~~~~~~~~~
|
||||
*
|
||||
* Sphinx stylesheet -- basic theme.
|
||||
*
|
||||
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
||||
/* -- main layout ----------------------------------------------------------- */
|
||||
|
||||
div.clearer {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
div.section::after {
|
||||
display: block;
|
||||
content: '';
|
||||
clear: left;
|
||||
}
|
||||
|
||||
/* -- relbar ---------------------------------------------------------------- */
|
||||
|
||||
div.related {
|
||||
width: 100%;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
div.related h3 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.related ul {
|
||||
margin: 0;
|
||||
padding: 0 0 0 10px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
div.related li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div.related li.right {
|
||||
float: right;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
/* -- sidebar --------------------------------------------------------------- */
|
||||
|
||||
div.sphinxsidebarwrapper {
|
||||
padding: 10px 5px 0 10px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar {
|
||||
float: left;
|
||||
width: 230px;
|
||||
margin-left: -100%;
|
||||
font-size: 90%;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap : break-word;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul ul,
|
||||
div.sphinxsidebar ul.want-points {
|
||||
margin-left: 20px;
|
||||
list-style: square;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul ul {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar form {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar input {
|
||||
border: 1px solid #98dbcc;
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox form.search {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox input[type="text"] {
|
||||
float: left;
|
||||
width: 80%;
|
||||
padding: 0.25em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox input[type="submit"] {
|
||||
float: left;
|
||||
width: 20%;
|
||||
border-left: none;
|
||||
padding: 0.25em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* -- search page ----------------------------------------------------------- */
|
||||
|
||||
ul.search {
|
||||
margin: 10px 0 0 20px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul.search li {
|
||||
padding: 5px 0 5px 20px;
|
||||
background-image: url(file.png);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 0 7px;
|
||||
}
|
||||
|
||||
ul.search li a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.search li p.context {
|
||||
color: #888;
|
||||
margin: 2px 0 0 30px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
ul.keywordmatches li.goodmatch a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* -- index page ------------------------------------------------------------ */
|
||||
|
||||
table.contentstable {
|
||||
width: 90%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.contentstable p.biglink {
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
a.biglink {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
span.linkdescr {
|
||||
font-style: italic;
|
||||
padding-top: 5px;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
/* -- general index --------------------------------------------------------- */
|
||||
|
||||
table.indextable {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.indextable td {
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.indextable ul {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
table.indextable > tbody > tr > td > ul {
|
||||
padding-left: 0em;
|
||||
}
|
||||
|
||||
table.indextable tr.pcap {
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
table.indextable tr.cap {
|
||||
margin-top: 10px;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
img.toggler {
|
||||
margin-right: 3px;
|
||||
margin-top: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div.modindex-jumpbox {
|
||||
border-top: 1px solid #ddd;
|
||||
border-bottom: 1px solid #ddd;
|
||||
margin: 1em 0 1em 0;
|
||||
padding: 0.4em;
|
||||
}
|
||||
|
||||
div.genindex-jumpbox {
|
||||
border-top: 1px solid #ddd;
|
||||
border-bottom: 1px solid #ddd;
|
||||
margin: 1em 0 1em 0;
|
||||
padding: 0.4em;
|
||||
}
|
||||
|
||||
/* -- domain module index --------------------------------------------------- */
|
||||
|
||||
table.modindextable td {
|
||||
padding: 2px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
/* -- general body styles --------------------------------------------------- */
|
||||
|
||||
div.body {
|
||||
min-width: 360px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
div.body p, div.body dd, div.body li, div.body blockquote {
|
||||
-moz-hyphens: auto;
|
||||
-ms-hyphens: auto;
|
||||
-webkit-hyphens: auto;
|
||||
hyphens: auto;
|
||||
}
|
||||
|
||||
a.headerlink {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
h1:hover > a.headerlink,
|
||||
h2:hover > a.headerlink,
|
||||
h3:hover > a.headerlink,
|
||||
h4:hover > a.headerlink,
|
||||
h5:hover > a.headerlink,
|
||||
h6:hover > a.headerlink,
|
||||
dt:hover > a.headerlink,
|
||||
caption:hover > a.headerlink,
|
||||
p.caption:hover > a.headerlink,
|
||||
div.code-block-caption:hover > a.headerlink {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
div.body p.caption {
|
||||
text-align: inherit;
|
||||
}
|
||||
|
||||
div.body td {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.first {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
p.rubric {
|
||||
margin-top: 30px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
img.align-left, figure.align-left, .figure.align-left, object.align-left {
|
||||
clear: left;
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
img.align-right, figure.align-right, .figure.align-right, object.align-right {
|
||||
clear: right;
|
||||
float: right;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
img.align-center, figure.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
img.align-default, figure.align-default, .figure.align-default {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.align-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.align-default {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.align-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* -- sidebars -------------------------------------------------------------- */
|
||||
|
||||
div.sidebar,
|
||||
aside.sidebar {
|
||||
margin: 0 0 0.5em 1em;
|
||||
border: 1px solid #ddb;
|
||||
padding: 7px;
|
||||
background-color: #ffe;
|
||||
width: 40%;
|
||||
float: right;
|
||||
clear: right;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
p.sidebar-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
nav.contents,
|
||||
aside.topic,
|
||||
div.admonition, div.topic, blockquote {
|
||||
clear: left;
|
||||
}
|
||||
|
||||
/* -- topics ---------------------------------------------------------------- */
|
||||
|
||||
nav.contents,
|
||||
aside.topic,
|
||||
div.topic {
|
||||
border: 1px solid #ccc;
|
||||
padding: 7px;
|
||||
margin: 10px 0 10px 0;
|
||||
}
|
||||
|
||||
p.topic-title {
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* -- admonitions ----------------------------------------------------------- */
|
||||
|
||||
div.admonition {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
div.admonition dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
p.admonition-title {
|
||||
margin: 0px 10px 5px 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.body p.centered {
|
||||
text-align: center;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
/* -- content of sidebars/topics/admonitions -------------------------------- */
|
||||
|
||||
div.sidebar > :last-child,
|
||||
aside.sidebar > :last-child,
|
||||
nav.contents > :last-child,
|
||||
aside.topic > :last-child,
|
||||
div.topic > :last-child,
|
||||
div.admonition > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div.sidebar::after,
|
||||
aside.sidebar::after,
|
||||
nav.contents::after,
|
||||
aside.topic::after,
|
||||
div.topic::after,
|
||||
div.admonition::after,
|
||||
blockquote::after {
|
||||
display: block;
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* -- tables ---------------------------------------------------------------- */
|
||||
|
||||
table.docutils {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
border: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-default {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table caption span.caption-number {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
table caption span.caption-text {
|
||||
}
|
||||
|
||||
table.docutils td, table.docutils th {
|
||||
padding: 1px 8px 1px 5px;
|
||||
border-top: 0;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid #aaa;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
table.citation td {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
th > :first-child,
|
||||
td > :first-child {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
th > :last-child,
|
||||
td > :last-child {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
/* -- figures --------------------------------------------------------------- */
|
||||
|
||||
div.figure, figure {
|
||||
margin: 0.5em;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
div.figure p.caption, figcaption {
|
||||
padding: 0.3em;
|
||||
}
|
||||
|
||||
div.figure p.caption span.caption-number,
|
||||
figcaption span.caption-number {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.figure p.caption span.caption-text,
|
||||
figcaption span.caption-text {
|
||||
}
|
||||
|
||||
/* -- field list styles ----------------------------------------------------- */
|
||||
|
||||
table.field-list td, table.field-list th {
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
.field-list ul {
|
||||
margin: 0;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
.field-list p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.field-name {
|
||||
-moz-hyphens: manual;
|
||||
-ms-hyphens: manual;
|
||||
-webkit-hyphens: manual;
|
||||
hyphens: manual;
|
||||
}
|
||||
|
||||
/* -- hlist styles ---------------------------------------------------------- */
|
||||
|
||||
table.hlist {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
table.hlist td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* -- object description styles --------------------------------------------- */
|
||||
|
||||
.sig {
|
||||
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
||||
}
|
||||
|
||||
.sig-name, code.descname {
|
||||
background-color: transparent;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sig-name {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
code.descname {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.sig-prename, code.descclassname {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.optional {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.sig-paren {
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
.sig-param.n {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* C++ specific styling */
|
||||
|
||||
.sig-inline.c-texpr,
|
||||
.sig-inline.cpp-texpr {
|
||||
font-family: unset;
|
||||
}
|
||||
|
||||
.sig.c .k, .sig.c .kt,
|
||||
.sig.cpp .k, .sig.cpp .kt {
|
||||
color: #0033B3;
|
||||
}
|
||||
|
||||
.sig.c .m,
|
||||
.sig.cpp .m {
|
||||
color: #1750EB;
|
||||
}
|
||||
|
||||
.sig.c .s, .sig.c .sc,
|
||||
.sig.cpp .s, .sig.cpp .sc {
|
||||
color: #067D17;
|
||||
}
|
||||
|
||||
|
||||
/* -- other body styles ----------------------------------------------------- */
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha;
|
||||
}
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha;
|
||||
}
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman;
|
||||
}
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman;
|
||||
}
|
||||
|
||||
:not(li) > ol > li:first-child > :first-child,
|
||||
:not(li) > ul > li:first-child > :first-child {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
:not(li) > ol > li:last-child > :last-child,
|
||||
:not(li) > ul > li:last-child > :last-child {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
ol.simple ol p,
|
||||
ol.simple ul p,
|
||||
ul.simple ol p,
|
||||
ul.simple ul p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
ol.simple > li:not(:first-child) > p,
|
||||
ul.simple > li:not(:first-child) > p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
ol.simple p,
|
||||
ul.simple p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
aside.footnote > span,
|
||||
div.citation > span {
|
||||
float: left;
|
||||
}
|
||||
aside.footnote > span:last-of-type,
|
||||
div.citation > span:last-of-type {
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
aside.footnote > p {
|
||||
margin-left: 2em;
|
||||
}
|
||||
div.citation > p {
|
||||
margin-left: 4em;
|
||||
}
|
||||
aside.footnote > p:last-of-type,
|
||||
div.citation > p:last-of-type {
|
||||
margin-bottom: 0em;
|
||||
}
|
||||
aside.footnote > p:last-of-type:after,
|
||||
div.citation > p:last-of-type:after {
|
||||
content: "";
|
||||
clear: both;
|
||||
}
|
||||
|
||||
dl.field-list {
|
||||
display: grid;
|
||||
grid-template-columns: fit-content(30%) auto;
|
||||
}
|
||||
|
||||
dl.field-list > dt {
|
||||
font-weight: bold;
|
||||
word-break: break-word;
|
||||
padding-left: 0.5em;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
dl.field-list > dd {
|
||||
padding-left: 0.5em;
|
||||
margin-top: 0em;
|
||||
margin-left: 0em;
|
||||
margin-bottom: 0em;
|
||||
}
|
||||
|
||||
dl {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
dd > :first-child {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
dd ul, dd table {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-top: 3px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
dl > dd:last-child,
|
||||
dl > dd:last-child > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dt:target, span.highlighted {
|
||||
background-color: #fbe54e;
|
||||
}
|
||||
|
||||
rect.highlighted {
|
||||
fill: #fbe54e;
|
||||
}
|
||||
|
||||
dl.glossary dt {
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.versionmodified {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.system-message {
|
||||
background-color: #fda;
|
||||
padding: 5px;
|
||||
border: 3px solid red;
|
||||
}
|
||||
|
||||
.footnote:target {
|
||||
background-color: #ffa;
|
||||
}
|
||||
|
||||
.line-block {
|
||||
display: block;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.line-block .line-block {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
margin-left: 1.5em;
|
||||
}
|
||||
|
||||
.guilabel, .menuselection {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
.accelerator {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.classifier {
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
.classifier:before {
|
||||
font-style: normal;
|
||||
margin: 0 0.5em;
|
||||
content: ":";
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
abbr, acronym {
|
||||
border-bottom: dotted 1px;
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
/* -- code displays --------------------------------------------------------- */
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
overflow-y: hidden; /* fixes display issues on Chrome browsers */
|
||||
}
|
||||
|
||||
pre, div[class*="highlight-"] {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
span.pre {
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
-webkit-hyphens: none;
|
||||
hyphens: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div[class*="highlight-"] {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
td.linenos pre {
|
||||
border: 0;
|
||||
background-color: transparent;
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
table.highlighttable {
|
||||
display: block;
|
||||
}
|
||||
|
||||
table.highlighttable tbody {
|
||||
display: block;
|
||||
}
|
||||
|
||||
table.highlighttable tr {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
table.highlighttable td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.highlighttable td.linenos {
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
|
||||
table.highlighttable td.code {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.highlight .hll {
|
||||
display: block;
|
||||
}
|
||||
|
||||
div.highlight pre,
|
||||
table.highlighttable pre {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.code-block-caption + div {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
div.code-block-caption {
|
||||
margin-top: 1em;
|
||||
padding: 2px 5px;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
div.code-block-caption code {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
table.highlighttable td.linenos,
|
||||
span.linenos,
|
||||
div.highlight span.gp { /* gp: Generic.Prompt */
|
||||
user-select: none;
|
||||
-webkit-user-select: text; /* Safari fallback only */
|
||||
-webkit-user-select: none; /* Chrome/Safari */
|
||||
-moz-user-select: none; /* Firefox */
|
||||
-ms-user-select: none; /* IE10+ */
|
||||
}
|
||||
|
||||
div.code-block-caption span.caption-number {
|
||||
padding: 0.1em 0.3em;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.code-block-caption span.caption-text {
|
||||
}
|
||||
|
||||
div.literal-block-wrapper {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
code.xref, a code {
|
||||
background-color: transparent;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.viewcode-link {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.viewcode-back {
|
||||
float: right;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
div.viewcode-block:target {
|
||||
margin: -1px -10px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
/* -- math display ---------------------------------------------------------- */
|
||||
|
||||
img.math {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.body div.math p {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
span.eqno {
|
||||
float: right;
|
||||
}
|
||||
|
||||
span.eqno a.headerlink {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
div.math:hover a.headerlink {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* -- printout stylesheet --------------------------------------------------- */
|
||||
|
||||
@media print {
|
||||
div.document,
|
||||
div.documentwrapper,
|
||||
div.bodywrapper {
|
||||
margin: 0 !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.sphinxsidebar,
|
||||
div.related,
|
||||
div.footer,
|
||||
#top-link {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
1
docs/_build/html/_static/custom.css
vendored
Normal file
1
docs/_build/html/_static/custom.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/* This file intentionally left blank. */
|
||||
156
docs/_build/html/_static/doctools.js
vendored
Normal file
156
docs/_build/html/_static/doctools.js
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* doctools.js
|
||||
* ~~~~~~~~~~~
|
||||
*
|
||||
* Base JavaScript utilities for all Sphinx HTML documentation.
|
||||
*
|
||||
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
|
||||
"TEXTAREA",
|
||||
"INPUT",
|
||||
"SELECT",
|
||||
"BUTTON",
|
||||
]);
|
||||
|
||||
const _ready = (callback) => {
|
||||
if (document.readyState !== "loading") {
|
||||
callback();
|
||||
} else {
|
||||
document.addEventListener("DOMContentLoaded", callback);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Small JavaScript module for the documentation.
|
||||
*/
|
||||
const Documentation = {
|
||||
init: () => {
|
||||
Documentation.initDomainIndexTable();
|
||||
Documentation.initOnKeyListeners();
|
||||
},
|
||||
|
||||
/**
|
||||
* i18n support
|
||||
*/
|
||||
TRANSLATIONS: {},
|
||||
PLURAL_EXPR: (n) => (n === 1 ? 0 : 1),
|
||||
LOCALE: "unknown",
|
||||
|
||||
// gettext and ngettext don't access this so that the functions
|
||||
// can safely bound to a different name (_ = Documentation.gettext)
|
||||
gettext: (string) => {
|
||||
const translated = Documentation.TRANSLATIONS[string];
|
||||
switch (typeof translated) {
|
||||
case "undefined":
|
||||
return string; // no translation
|
||||
case "string":
|
||||
return translated; // translation exists
|
||||
default:
|
||||
return translated[0]; // (singular, plural) translation tuple exists
|
||||
}
|
||||
},
|
||||
|
||||
ngettext: (singular, plural, n) => {
|
||||
const translated = Documentation.TRANSLATIONS[singular];
|
||||
if (typeof translated !== "undefined")
|
||||
return translated[Documentation.PLURAL_EXPR(n)];
|
||||
return n === 1 ? singular : plural;
|
||||
},
|
||||
|
||||
addTranslations: (catalog) => {
|
||||
Object.assign(Documentation.TRANSLATIONS, catalog.messages);
|
||||
Documentation.PLURAL_EXPR = new Function(
|
||||
"n",
|
||||
`return (${catalog.plural_expr})`
|
||||
);
|
||||
Documentation.LOCALE = catalog.locale;
|
||||
},
|
||||
|
||||
/**
|
||||
* helper function to focus on search bar
|
||||
*/
|
||||
focusSearchBar: () => {
|
||||
document.querySelectorAll("input[name=q]")[0]?.focus();
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialise the domain index toggle buttons
|
||||
*/
|
||||
initDomainIndexTable: () => {
|
||||
const toggler = (el) => {
|
||||
const idNumber = el.id.substr(7);
|
||||
const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`);
|
||||
if (el.src.substr(-9) === "minus.png") {
|
||||
el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`;
|
||||
toggledRows.forEach((el) => (el.style.display = "none"));
|
||||
} else {
|
||||
el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`;
|
||||
toggledRows.forEach((el) => (el.style.display = ""));
|
||||
}
|
||||
};
|
||||
|
||||
const togglerElements = document.querySelectorAll("img.toggler");
|
||||
togglerElements.forEach((el) =>
|
||||
el.addEventListener("click", (event) => toggler(event.currentTarget))
|
||||
);
|
||||
togglerElements.forEach((el) => (el.style.display = ""));
|
||||
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler);
|
||||
},
|
||||
|
||||
initOnKeyListeners: () => {
|
||||
// only install a listener if it is really needed
|
||||
if (
|
||||
!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS &&
|
||||
!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS
|
||||
)
|
||||
return;
|
||||
|
||||
document.addEventListener("keydown", (event) => {
|
||||
// bail for input elements
|
||||
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||
// bail with special keys
|
||||
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
||||
|
||||
if (!event.shiftKey) {
|
||||
switch (event.key) {
|
||||
case "ArrowLeft":
|
||||
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
|
||||
|
||||
const prevLink = document.querySelector('link[rel="prev"]');
|
||||
if (prevLink && prevLink.href) {
|
||||
window.location.href = prevLink.href;
|
||||
event.preventDefault();
|
||||
}
|
||||
break;
|
||||
case "ArrowRight":
|
||||
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
|
||||
|
||||
const nextLink = document.querySelector('link[rel="next"]');
|
||||
if (nextLink && nextLink.href) {
|
||||
window.location.href = nextLink.href;
|
||||
event.preventDefault();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// some keyboard layouts may need Shift to get /
|
||||
switch (event.key) {
|
||||
case "/":
|
||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
|
||||
Documentation.focusSearchBar();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
// quick alias for translations
|
||||
const _ = Documentation.gettext;
|
||||
|
||||
_ready(Documentation.init);
|
||||
14
docs/_build/html/_static/documentation_options.js
vendored
Normal file
14
docs/_build/html/_static/documentation_options.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
|
||||
VERSION: '0.0.post1.dev53+g9be81e9.d20230129',
|
||||
LANGUAGE: 'en',
|
||||
COLLAPSE_INDEX: false,
|
||||
BUILDER: 'html',
|
||||
FILE_SUFFIX: '.html',
|
||||
LINK_SUFFIX: '.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt',
|
||||
NAVIGATION_WITH_KEYS: false,
|
||||
SHOW_SEARCH_SUMMARY: true,
|
||||
ENABLE_SEARCH_SHORTCUTS: true,
|
||||
};
|
||||
BIN
docs/_build/html/_static/file.png
vendored
Normal file
BIN
docs/_build/html/_static/file.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 286 B |
199
docs/_build/html/_static/language_data.js
vendored
Normal file
199
docs/_build/html/_static/language_data.js
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* language_data.js
|
||||
* ~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* This script contains the language-specific data used by searchtools.js,
|
||||
* namely the list of stopwords, stemmer, scorer and splitter.
|
||||
*
|
||||
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
||||
var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];
|
||||
|
||||
|
||||
/* Non-minified version is copied as a separate JS file, is available */
|
||||
|
||||
/**
|
||||
* Porter Stemmer
|
||||
*/
|
||||
var Stemmer = function() {
|
||||
|
||||
var step2list = {
|
||||
ational: 'ate',
|
||||
tional: 'tion',
|
||||
enci: 'ence',
|
||||
anci: 'ance',
|
||||
izer: 'ize',
|
||||
bli: 'ble',
|
||||
alli: 'al',
|
||||
entli: 'ent',
|
||||
eli: 'e',
|
||||
ousli: 'ous',
|
||||
ization: 'ize',
|
||||
ation: 'ate',
|
||||
ator: 'ate',
|
||||
alism: 'al',
|
||||
iveness: 'ive',
|
||||
fulness: 'ful',
|
||||
ousness: 'ous',
|
||||
aliti: 'al',
|
||||
iviti: 'ive',
|
||||
biliti: 'ble',
|
||||
logi: 'log'
|
||||
};
|
||||
|
||||
var step3list = {
|
||||
icate: 'ic',
|
||||
ative: '',
|
||||
alize: 'al',
|
||||
iciti: 'ic',
|
||||
ical: 'ic',
|
||||
ful: '',
|
||||
ness: ''
|
||||
};
|
||||
|
||||
var c = "[^aeiou]"; // consonant
|
||||
var v = "[aeiouy]"; // vowel
|
||||
var C = c + "[^aeiouy]*"; // consonant sequence
|
||||
var V = v + "[aeiou]*"; // vowel sequence
|
||||
|
||||
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
|
||||
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
|
||||
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
|
||||
var s_v = "^(" + C + ")?" + v; // vowel in stem
|
||||
|
||||
this.stemWord = function (w) {
|
||||
var stem;
|
||||
var suffix;
|
||||
var firstch;
|
||||
var origword = w;
|
||||
|
||||
if (w.length < 3)
|
||||
return w;
|
||||
|
||||
var re;
|
||||
var re2;
|
||||
var re3;
|
||||
var re4;
|
||||
|
||||
firstch = w.substr(0,1);
|
||||
if (firstch == "y")
|
||||
w = firstch.toUpperCase() + w.substr(1);
|
||||
|
||||
// Step 1a
|
||||
re = /^(.+?)(ss|i)es$/;
|
||||
re2 = /^(.+?)([^s])s$/;
|
||||
|
||||
if (re.test(w))
|
||||
w = w.replace(re,"$1$2");
|
||||
else if (re2.test(w))
|
||||
w = w.replace(re2,"$1$2");
|
||||
|
||||
// Step 1b
|
||||
re = /^(.+?)eed$/;
|
||||
re2 = /^(.+?)(ed|ing)$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
re = new RegExp(mgr0);
|
||||
if (re.test(fp[1])) {
|
||||
re = /.$/;
|
||||
w = w.replace(re,"");
|
||||
}
|
||||
}
|
||||
else if (re2.test(w)) {
|
||||
var fp = re2.exec(w);
|
||||
stem = fp[1];
|
||||
re2 = new RegExp(s_v);
|
||||
if (re2.test(stem)) {
|
||||
w = stem;
|
||||
re2 = /(at|bl|iz)$/;
|
||||
re3 = new RegExp("([^aeiouylsz])\\1$");
|
||||
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
|
||||
if (re2.test(w))
|
||||
w = w + "e";
|
||||
else if (re3.test(w)) {
|
||||
re = /.$/;
|
||||
w = w.replace(re,"");
|
||||
}
|
||||
else if (re4.test(w))
|
||||
w = w + "e";
|
||||
}
|
||||
}
|
||||
|
||||
// Step 1c
|
||||
re = /^(.+?)y$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
stem = fp[1];
|
||||
re = new RegExp(s_v);
|
||||
if (re.test(stem))
|
||||
w = stem + "i";
|
||||
}
|
||||
|
||||
// Step 2
|
||||
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
stem = fp[1];
|
||||
suffix = fp[2];
|
||||
re = new RegExp(mgr0);
|
||||
if (re.test(stem))
|
||||
w = stem + step2list[suffix];
|
||||
}
|
||||
|
||||
// Step 3
|
||||
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
stem = fp[1];
|
||||
suffix = fp[2];
|
||||
re = new RegExp(mgr0);
|
||||
if (re.test(stem))
|
||||
w = stem + step3list[suffix];
|
||||
}
|
||||
|
||||
// Step 4
|
||||
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
|
||||
re2 = /^(.+?)(s|t)(ion)$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
stem = fp[1];
|
||||
re = new RegExp(mgr1);
|
||||
if (re.test(stem))
|
||||
w = stem;
|
||||
}
|
||||
else if (re2.test(w)) {
|
||||
var fp = re2.exec(w);
|
||||
stem = fp[1] + fp[2];
|
||||
re2 = new RegExp(mgr1);
|
||||
if (re2.test(stem))
|
||||
w = stem;
|
||||
}
|
||||
|
||||
// Step 5
|
||||
re = /^(.+?)e$/;
|
||||
if (re.test(w)) {
|
||||
var fp = re.exec(w);
|
||||
stem = fp[1];
|
||||
re = new RegExp(mgr1);
|
||||
re2 = new RegExp(meq1);
|
||||
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
|
||||
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
|
||||
w = stem;
|
||||
}
|
||||
re = /ll$/;
|
||||
re2 = new RegExp(mgr1);
|
||||
if (re.test(w) && re2.test(w)) {
|
||||
re = /.$/;
|
||||
w = w.replace(re,"");
|
||||
}
|
||||
|
||||
// and turn initial Y back to y
|
||||
if (firstch == "y")
|
||||
w = firstch.toLowerCase() + w.substr(1);
|
||||
return w;
|
||||
}
|
||||
}
|
||||
|
||||
BIN
docs/_build/html/_static/minus.png
vendored
Normal file
BIN
docs/_build/html/_static/minus.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 B |
BIN
docs/_build/html/_static/plus.png
vendored
Normal file
BIN
docs/_build/html/_static/plus.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 B |
74
docs/_build/html/_static/pygments.css
vendored
Normal file
74
docs/_build/html/_static/pygments.css
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
pre { line-height: 125%; }
|
||||
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||
.highlight .hll { background-color: #ffffcc }
|
||||
.highlight { background: #eeffcc; }
|
||||
.highlight .c { color: #408090; font-style: italic } /* Comment */
|
||||
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
||||
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
||||
.highlight .o { color: #666666 } /* Operator */
|
||||
.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */
|
||||
.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
|
||||
.highlight .cp { color: #007020 } /* Comment.Preproc */
|
||||
.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */
|
||||
.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
|
||||
.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
|
||||
.highlight .gd { color: #A00000 } /* Generic.Deleted */
|
||||
.highlight .ge { font-style: italic } /* Generic.Emph */
|
||||
.highlight .gr { color: #FF0000 } /* Generic.Error */
|
||||
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
||||
.highlight .gi { color: #00A000 } /* Generic.Inserted */
|
||||
.highlight .go { color: #333333 } /* Generic.Output */
|
||||
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
|
||||
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
||||
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
||||
.highlight .gt { color: #0044DD } /* Generic.Traceback */
|
||||
.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
|
||||
.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
|
||||
.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
|
||||
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
|
||||
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
|
||||
.highlight .kt { color: #902000 } /* Keyword.Type */
|
||||
.highlight .m { color: #208050 } /* Literal.Number */
|
||||
.highlight .s { color: #4070a0 } /* Literal.String */
|
||||
.highlight .na { color: #4070a0 } /* Name.Attribute */
|
||||
.highlight .nb { color: #007020 } /* Name.Builtin */
|
||||
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
|
||||
.highlight .no { color: #60add5 } /* Name.Constant */
|
||||
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
|
||||
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
|
||||
.highlight .ne { color: #007020 } /* Name.Exception */
|
||||
.highlight .nf { color: #06287e } /* Name.Function */
|
||||
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
|
||||
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
|
||||
.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
|
||||
.highlight .nv { color: #bb60d5 } /* Name.Variable */
|
||||
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
|
||||
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
|
||||
.highlight .mb { color: #208050 } /* Literal.Number.Bin */
|
||||
.highlight .mf { color: #208050 } /* Literal.Number.Float */
|
||||
.highlight .mh { color: #208050 } /* Literal.Number.Hex */
|
||||
.highlight .mi { color: #208050 } /* Literal.Number.Integer */
|
||||
.highlight .mo { color: #208050 } /* Literal.Number.Oct */
|
||||
.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
|
||||
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
|
||||
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
|
||||
.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
|
||||
.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
|
||||
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
|
||||
.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
|
||||
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
|
||||
.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
|
||||
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
|
||||
.highlight .sr { color: #235388 } /* Literal.String.Regex */
|
||||
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
|
||||
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
|
||||
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
|
||||
.highlight .fm { color: #06287e } /* Name.Function.Magic */
|
||||
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
|
||||
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
|
||||
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
|
||||
.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
|
||||
.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
|
||||
566
docs/_build/html/_static/searchtools.js
vendored
Normal file
566
docs/_build/html/_static/searchtools.js
vendored
Normal file
@@ -0,0 +1,566 @@
|
||||
/*
|
||||
* searchtools.js
|
||||
* ~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* Sphinx JavaScript utilities for the full-text search.
|
||||
*
|
||||
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Simple result scoring code.
|
||||
*/
|
||||
if (typeof Scorer === "undefined") {
|
||||
var Scorer = {
|
||||
// Implement the following function to further tweak the score for each result
|
||||
// The function takes a result array [docname, title, anchor, descr, score, filename]
|
||||
// and returns the new score.
|
||||
/*
|
||||
score: result => {
|
||||
const [docname, title, anchor, descr, score, filename] = result
|
||||
return score
|
||||
},
|
||||
*/
|
||||
|
||||
// query matches the full name of an object
|
||||
objNameMatch: 11,
|
||||
// or matches in the last dotted part of the object name
|
||||
objPartialMatch: 6,
|
||||
// Additive scores depending on the priority of the object
|
||||
objPrio: {
|
||||
0: 15, // used to be importantResults
|
||||
1: 5, // used to be objectResults
|
||||
2: -5, // used to be unimportantResults
|
||||
},
|
||||
// Used when the priority is not in the mapping.
|
||||
objPrioDefault: 0,
|
||||
|
||||
// query found in title
|
||||
title: 15,
|
||||
partialTitle: 7,
|
||||
// query found in terms
|
||||
term: 5,
|
||||
partialTerm: 2,
|
||||
};
|
||||
}
|
||||
|
||||
const _removeChildren = (element) => {
|
||||
while (element && element.lastChild) element.removeChild(element.lastChild);
|
||||
};
|
||||
|
||||
/**
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping
|
||||
*/
|
||||
const _escapeRegExp = (string) =>
|
||||
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
||||
|
||||
const _displayItem = (item, searchTerms) => {
|
||||
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
||||
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
||||
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
||||
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
||||
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
||||
|
||||
const [docName, title, anchor, descr, score, _filename] = item;
|
||||
|
||||
let listItem = document.createElement("li");
|
||||
let requestUrl;
|
||||
let linkUrl;
|
||||
if (docBuilder === "dirhtml") {
|
||||
// dirhtml builder
|
||||
let dirname = docName + "/";
|
||||
if (dirname.match(/\/index\/$/))
|
||||
dirname = dirname.substring(0, dirname.length - 6);
|
||||
else if (dirname === "index/") dirname = "";
|
||||
requestUrl = docUrlRoot + dirname;
|
||||
linkUrl = requestUrl;
|
||||
} else {
|
||||
// normal html builders
|
||||
requestUrl = docUrlRoot + docName + docFileSuffix;
|
||||
linkUrl = docName + docLinkSuffix;
|
||||
}
|
||||
let linkEl = listItem.appendChild(document.createElement("a"));
|
||||
linkEl.href = linkUrl + anchor;
|
||||
linkEl.dataset.score = score;
|
||||
linkEl.innerHTML = title;
|
||||
if (descr)
|
||||
listItem.appendChild(document.createElement("span")).innerHTML =
|
||||
" (" + descr + ")";
|
||||
else if (showSearchSummary)
|
||||
fetch(requestUrl)
|
||||
.then((responseData) => responseData.text())
|
||||
.then((data) => {
|
||||
if (data)
|
||||
listItem.appendChild(
|
||||
Search.makeSearchSummary(data, searchTerms)
|
||||
);
|
||||
});
|
||||
Search.output.appendChild(listItem);
|
||||
};
|
||||
const _finishSearch = (resultCount) => {
|
||||
Search.stopPulse();
|
||||
Search.title.innerText = _("Search Results");
|
||||
if (!resultCount)
|
||||
Search.status.innerText = Documentation.gettext(
|
||||
"Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories."
|
||||
);
|
||||
else
|
||||
Search.status.innerText = _(
|
||||
`Search finished, found ${resultCount} page(s) matching the search query.`
|
||||
);
|
||||
};
|
||||
const _displayNextItem = (
|
||||
results,
|
||||
resultCount,
|
||||
searchTerms
|
||||
) => {
|
||||
// results left, load the summary and display it
|
||||
// this is intended to be dynamic (don't sub resultsCount)
|
||||
if (results.length) {
|
||||
_displayItem(results.pop(), searchTerms);
|
||||
setTimeout(
|
||||
() => _displayNextItem(results, resultCount, searchTerms),
|
||||
5
|
||||
);
|
||||
}
|
||||
// search finished, update title and status message
|
||||
else _finishSearch(resultCount);
|
||||
};
|
||||
|
||||
/**
|
||||
* Default splitQuery function. Can be overridden in ``sphinx.search`` with a
|
||||
* custom function per language.
|
||||
*
|
||||
* The regular expression works by splitting the string on consecutive characters
|
||||
* that are not Unicode letters, numbers, underscores, or emoji characters.
|
||||
* This is the same as ``\W+`` in Python, preserving the surrogate pair area.
|
||||
*/
|
||||
if (typeof splitQuery === "undefined") {
|
||||
var splitQuery = (query) => query
|
||||
.split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu)
|
||||
.filter(term => term) // remove remaining empty strings
|
||||
}
|
||||
|
||||
/**
|
||||
* Search Module
|
||||
*/
|
||||
const Search = {
|
||||
_index: null,
|
||||
_queued_query: null,
|
||||
_pulse_status: -1,
|
||||
|
||||
htmlToText: (htmlString) => {
|
||||
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
|
||||
htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() });
|
||||
const docContent = htmlElement.querySelector('[role="main"]');
|
||||
if (docContent !== undefined) return docContent.textContent;
|
||||
console.warn(
|
||||
"Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template."
|
||||
);
|
||||
return "";
|
||||
},
|
||||
|
||||
init: () => {
|
||||
const query = new URLSearchParams(window.location.search).get("q");
|
||||
document
|
||||
.querySelectorAll('input[name="q"]')
|
||||
.forEach((el) => (el.value = query));
|
||||
if (query) Search.performSearch(query);
|
||||
},
|
||||
|
||||
loadIndex: (url) =>
|
||||
(document.body.appendChild(document.createElement("script")).src = url),
|
||||
|
||||
setIndex: (index) => {
|
||||
Search._index = index;
|
||||
if (Search._queued_query !== null) {
|
||||
const query = Search._queued_query;
|
||||
Search._queued_query = null;
|
||||
Search.query(query);
|
||||
}
|
||||
},
|
||||
|
||||
hasIndex: () => Search._index !== null,
|
||||
|
||||
deferQuery: (query) => (Search._queued_query = query),
|
||||
|
||||
stopPulse: () => (Search._pulse_status = -1),
|
||||
|
||||
startPulse: () => {
|
||||
if (Search._pulse_status >= 0) return;
|
||||
|
||||
const pulse = () => {
|
||||
Search._pulse_status = (Search._pulse_status + 1) % 4;
|
||||
Search.dots.innerText = ".".repeat(Search._pulse_status);
|
||||
if (Search._pulse_status >= 0) window.setTimeout(pulse, 500);
|
||||
};
|
||||
pulse();
|
||||
},
|
||||
|
||||
/**
|
||||
* perform a search for something (or wait until index is loaded)
|
||||
*/
|
||||
performSearch: (query) => {
|
||||
// create the required interface elements
|
||||
const searchText = document.createElement("h2");
|
||||
searchText.textContent = _("Searching");
|
||||
const searchSummary = document.createElement("p");
|
||||
searchSummary.classList.add("search-summary");
|
||||
searchSummary.innerText = "";
|
||||
const searchList = document.createElement("ul");
|
||||
searchList.classList.add("search");
|
||||
|
||||
const out = document.getElementById("search-results");
|
||||
Search.title = out.appendChild(searchText);
|
||||
Search.dots = Search.title.appendChild(document.createElement("span"));
|
||||
Search.status = out.appendChild(searchSummary);
|
||||
Search.output = out.appendChild(searchList);
|
||||
|
||||
const searchProgress = document.getElementById("search-progress");
|
||||
// Some themes don't use the search progress node
|
||||
if (searchProgress) {
|
||||
searchProgress.innerText = _("Preparing search...");
|
||||
}
|
||||
Search.startPulse();
|
||||
|
||||
// index already loaded, the browser was quick!
|
||||
if (Search.hasIndex()) Search.query(query);
|
||||
else Search.deferQuery(query);
|
||||
},
|
||||
|
||||
/**
|
||||
* execute search (requires search index to be loaded)
|
||||
*/
|
||||
query: (query) => {
|
||||
const filenames = Search._index.filenames;
|
||||
const docNames = Search._index.docnames;
|
||||
const titles = Search._index.titles;
|
||||
const allTitles = Search._index.alltitles;
|
||||
const indexEntries = Search._index.indexentries;
|
||||
|
||||
// stem the search terms and add them to the correct list
|
||||
const stemmer = new Stemmer();
|
||||
const searchTerms = new Set();
|
||||
const excludedTerms = new Set();
|
||||
const highlightTerms = new Set();
|
||||
const objectTerms = new Set(splitQuery(query.toLowerCase().trim()));
|
||||
splitQuery(query.trim()).forEach((queryTerm) => {
|
||||
const queryTermLower = queryTerm.toLowerCase();
|
||||
|
||||
// maybe skip this "word"
|
||||
// stopwords array is from language_data.js
|
||||
if (
|
||||
stopwords.indexOf(queryTermLower) !== -1 ||
|
||||
queryTerm.match(/^\d+$/)
|
||||
)
|
||||
return;
|
||||
|
||||
// stem the word
|
||||
let word = stemmer.stemWord(queryTermLower);
|
||||
// select the correct list
|
||||
if (word[0] === "-") excludedTerms.add(word.substr(1));
|
||||
else {
|
||||
searchTerms.add(word);
|
||||
highlightTerms.add(queryTermLower);
|
||||
}
|
||||
});
|
||||
|
||||
if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js
|
||||
localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" "))
|
||||
}
|
||||
|
||||
// console.debug("SEARCH: searching for:");
|
||||
// console.info("required: ", [...searchTerms]);
|
||||
// console.info("excluded: ", [...excludedTerms]);
|
||||
|
||||
// array of [docname, title, anchor, descr, score, filename]
|
||||
let results = [];
|
||||
_removeChildren(document.getElementById("search-progress"));
|
||||
|
||||
const queryLower = query.toLowerCase();
|
||||
for (const [title, foundTitles] of Object.entries(allTitles)) {
|
||||
if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) {
|
||||
for (const [file, id] of foundTitles) {
|
||||
let score = Math.round(100 * queryLower.length / title.length)
|
||||
results.push([
|
||||
docNames[file],
|
||||
titles[file] !== title ? `${titles[file]} > ${title}` : title,
|
||||
id !== null ? "#" + id : "",
|
||||
null,
|
||||
score,
|
||||
filenames[file],
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// search for explicit entries in index directives
|
||||
for (const [entry, foundEntries] of Object.entries(indexEntries)) {
|
||||
if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) {
|
||||
for (const [file, id] of foundEntries) {
|
||||
let score = Math.round(100 * queryLower.length / entry.length)
|
||||
results.push([
|
||||
docNames[file],
|
||||
titles[file],
|
||||
id ? "#" + id : "",
|
||||
null,
|
||||
score,
|
||||
filenames[file],
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// lookup as object
|
||||
objectTerms.forEach((term) =>
|
||||
results.push(...Search.performObjectSearch(term, objectTerms))
|
||||
);
|
||||
|
||||
// lookup as search terms in fulltext
|
||||
results.push(...Search.performTermsSearch(searchTerms, excludedTerms));
|
||||
|
||||
// let the scorer override scores with a custom scoring function
|
||||
if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item)));
|
||||
|
||||
// now sort the results by score (in opposite order of appearance, since the
|
||||
// display function below uses pop() to retrieve items) and then
|
||||
// alphabetically
|
||||
results.sort((a, b) => {
|
||||
const leftScore = a[4];
|
||||
const rightScore = b[4];
|
||||
if (leftScore === rightScore) {
|
||||
// same score: sort alphabetically
|
||||
const leftTitle = a[1].toLowerCase();
|
||||
const rightTitle = b[1].toLowerCase();
|
||||
if (leftTitle === rightTitle) return 0;
|
||||
return leftTitle > rightTitle ? -1 : 1; // inverted is intentional
|
||||
}
|
||||
return leftScore > rightScore ? 1 : -1;
|
||||
});
|
||||
|
||||
// remove duplicate search results
|
||||
// note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept
|
||||
let seen = new Set();
|
||||
results = results.reverse().reduce((acc, result) => {
|
||||
let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(',');
|
||||
if (!seen.has(resultStr)) {
|
||||
acc.push(result);
|
||||
seen.add(resultStr);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
results = results.reverse();
|
||||
|
||||
// for debugging
|
||||
//Search.lastresults = results.slice(); // a copy
|
||||
// console.info("search results:", Search.lastresults);
|
||||
|
||||
// print the results
|
||||
_displayNextItem(results, results.length, searchTerms);
|
||||
},
|
||||
|
||||
/**
|
||||
* search for object names
|
||||
*/
|
||||
performObjectSearch: (object, objectTerms) => {
|
||||
const filenames = Search._index.filenames;
|
||||
const docNames = Search._index.docnames;
|
||||
const objects = Search._index.objects;
|
||||
const objNames = Search._index.objnames;
|
||||
const titles = Search._index.titles;
|
||||
|
||||
const results = [];
|
||||
|
||||
const objectSearchCallback = (prefix, match) => {
|
||||
const name = match[4]
|
||||
const fullname = (prefix ? prefix + "." : "") + name;
|
||||
const fullnameLower = fullname.toLowerCase();
|
||||
if (fullnameLower.indexOf(object) < 0) return;
|
||||
|
||||
let score = 0;
|
||||
const parts = fullnameLower.split(".");
|
||||
|
||||
// check for different match types: exact matches of full name or
|
||||
// "last name" (i.e. last dotted part)
|
||||
if (fullnameLower === object || parts.slice(-1)[0] === object)
|
||||
score += Scorer.objNameMatch;
|
||||
else if (parts.slice(-1)[0].indexOf(object) > -1)
|
||||
score += Scorer.objPartialMatch; // matches in last name
|
||||
|
||||
const objName = objNames[match[1]][2];
|
||||
const title = titles[match[0]];
|
||||
|
||||
// If more than one term searched for, we require other words to be
|
||||
// found in the name/title/description
|
||||
const otherTerms = new Set(objectTerms);
|
||||
otherTerms.delete(object);
|
||||
if (otherTerms.size > 0) {
|
||||
const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase();
|
||||
if (
|
||||
[...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0)
|
||||
)
|
||||
return;
|
||||
}
|
||||
|
||||
let anchor = match[3];
|
||||
if (anchor === "") anchor = fullname;
|
||||
else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname;
|
||||
|
||||
const descr = objName + _(", in ") + title;
|
||||
|
||||
// add custom score for some objects according to scorer
|
||||
if (Scorer.objPrio.hasOwnProperty(match[2]))
|
||||
score += Scorer.objPrio[match[2]];
|
||||
else score += Scorer.objPrioDefault;
|
||||
|
||||
results.push([
|
||||
docNames[match[0]],
|
||||
fullname,
|
||||
"#" + anchor,
|
||||
descr,
|
||||
score,
|
||||
filenames[match[0]],
|
||||
]);
|
||||
};
|
||||
Object.keys(objects).forEach((prefix) =>
|
||||
objects[prefix].forEach((array) =>
|
||||
objectSearchCallback(prefix, array)
|
||||
)
|
||||
);
|
||||
return results;
|
||||
},
|
||||
|
||||
/**
|
||||
* search for full-text terms in the index
|
||||
*/
|
||||
performTermsSearch: (searchTerms, excludedTerms) => {
|
||||
// prepare search
|
||||
const terms = Search._index.terms;
|
||||
const titleTerms = Search._index.titleterms;
|
||||
const filenames = Search._index.filenames;
|
||||
const docNames = Search._index.docnames;
|
||||
const titles = Search._index.titles;
|
||||
|
||||
const scoreMap = new Map();
|
||||
const fileMap = new Map();
|
||||
|
||||
// perform the search on the required terms
|
||||
searchTerms.forEach((word) => {
|
||||
const files = [];
|
||||
const arr = [
|
||||
{ files: terms[word], score: Scorer.term },
|
||||
{ files: titleTerms[word], score: Scorer.title },
|
||||
];
|
||||
// add support for partial matches
|
||||
if (word.length > 2) {
|
||||
const escapedWord = _escapeRegExp(word);
|
||||
Object.keys(terms).forEach((term) => {
|
||||
if (term.match(escapedWord) && !terms[word])
|
||||
arr.push({ files: terms[term], score: Scorer.partialTerm });
|
||||
});
|
||||
Object.keys(titleTerms).forEach((term) => {
|
||||
if (term.match(escapedWord) && !titleTerms[word])
|
||||
arr.push({ files: titleTerms[word], score: Scorer.partialTitle });
|
||||
});
|
||||
}
|
||||
|
||||
// no match but word was a required one
|
||||
if (arr.every((record) => record.files === undefined)) return;
|
||||
|
||||
// found search word in contents
|
||||
arr.forEach((record) => {
|
||||
if (record.files === undefined) return;
|
||||
|
||||
let recordFiles = record.files;
|
||||
if (recordFiles.length === undefined) recordFiles = [recordFiles];
|
||||
files.push(...recordFiles);
|
||||
|
||||
// set score for the word in each file
|
||||
recordFiles.forEach((file) => {
|
||||
if (!scoreMap.has(file)) scoreMap.set(file, {});
|
||||
scoreMap.get(file)[word] = record.score;
|
||||
});
|
||||
});
|
||||
|
||||
// create the mapping
|
||||
files.forEach((file) => {
|
||||
if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1)
|
||||
fileMap.get(file).push(word);
|
||||
else fileMap.set(file, [word]);
|
||||
});
|
||||
});
|
||||
|
||||
// now check if the files don't contain excluded terms
|
||||
const results = [];
|
||||
for (const [file, wordList] of fileMap) {
|
||||
// check if all requirements are matched
|
||||
|
||||
// as search terms with length < 3 are discarded
|
||||
const filteredTermCount = [...searchTerms].filter(
|
||||
(term) => term.length > 2
|
||||
).length;
|
||||
if (
|
||||
wordList.length !== searchTerms.size &&
|
||||
wordList.length !== filteredTermCount
|
||||
)
|
||||
continue;
|
||||
|
||||
// ensure that none of the excluded terms is in the search result
|
||||
if (
|
||||
[...excludedTerms].some(
|
||||
(term) =>
|
||||
terms[term] === file ||
|
||||
titleTerms[term] === file ||
|
||||
(terms[term] || []).includes(file) ||
|
||||
(titleTerms[term] || []).includes(file)
|
||||
)
|
||||
)
|
||||
break;
|
||||
|
||||
// select one (max) score for the file.
|
||||
const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w]));
|
||||
// add result to the result list
|
||||
results.push([
|
||||
docNames[file],
|
||||
titles[file],
|
||||
"",
|
||||
null,
|
||||
score,
|
||||
filenames[file],
|
||||
]);
|
||||
}
|
||||
return results;
|
||||
},
|
||||
|
||||
/**
|
||||
* helper function to return a node containing the
|
||||
* search summary for a given text. keywords is a list
|
||||
* of stemmed words.
|
||||
*/
|
||||
makeSearchSummary: (htmlText, keywords) => {
|
||||
const text = Search.htmlToText(htmlText);
|
||||
if (text === "") return null;
|
||||
|
||||
const textLower = text.toLowerCase();
|
||||
const actualStartPosition = [...keywords]
|
||||
.map((k) => textLower.indexOf(k.toLowerCase()))
|
||||
.filter((i) => i > -1)
|
||||
.slice(-1)[0];
|
||||
const startWithContext = Math.max(actualStartPosition - 120, 0);
|
||||
|
||||
const top = startWithContext === 0 ? "" : "...";
|
||||
const tail = startWithContext + 240 < text.length ? "..." : "";
|
||||
|
||||
let summary = document.createElement("p");
|
||||
summary.classList.add("context");
|
||||
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
||||
|
||||
return summary;
|
||||
},
|
||||
};
|
||||
|
||||
_ready(Search.init);
|
||||
144
docs/_build/html/_static/sphinx_highlight.js
vendored
Normal file
144
docs/_build/html/_static/sphinx_highlight.js
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
/* Highlighting utilities for Sphinx HTML documentation. */
|
||||
"use strict";
|
||||
|
||||
const SPHINX_HIGHLIGHT_ENABLED = true
|
||||
|
||||
/**
|
||||
* highlight a given string on a node by wrapping it in
|
||||
* span elements with the given class name.
|
||||
*/
|
||||
const _highlight = (node, addItems, text, className) => {
|
||||
if (node.nodeType === Node.TEXT_NODE) {
|
||||
const val = node.nodeValue;
|
||||
const parent = node.parentNode;
|
||||
const pos = val.toLowerCase().indexOf(text);
|
||||
if (
|
||||
pos >= 0 &&
|
||||
!parent.classList.contains(className) &&
|
||||
!parent.classList.contains("nohighlight")
|
||||
) {
|
||||
let span;
|
||||
|
||||
const closestNode = parent.closest("body, svg, foreignObject");
|
||||
const isInSVG = closestNode && closestNode.matches("svg");
|
||||
if (isInSVG) {
|
||||
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
||||
} else {
|
||||
span = document.createElement("span");
|
||||
span.classList.add(className);
|
||||
}
|
||||
|
||||
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
||||
parent.insertBefore(
|
||||
span,
|
||||
parent.insertBefore(
|
||||
document.createTextNode(val.substr(pos + text.length)),
|
||||
node.nextSibling
|
||||
)
|
||||
);
|
||||
node.nodeValue = val.substr(0, pos);
|
||||
|
||||
if (isInSVG) {
|
||||
const rect = document.createElementNS(
|
||||
"http://www.w3.org/2000/svg",
|
||||
"rect"
|
||||
);
|
||||
const bbox = parent.getBBox();
|
||||
rect.x.baseVal.value = bbox.x;
|
||||
rect.y.baseVal.value = bbox.y;
|
||||
rect.width.baseVal.value = bbox.width;
|
||||
rect.height.baseVal.value = bbox.height;
|
||||
rect.setAttribute("class", className);
|
||||
addItems.push({ parent: parent, target: rect });
|
||||
}
|
||||
}
|
||||
} else if (node.matches && !node.matches("button, select, textarea")) {
|
||||
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
||||
}
|
||||
};
|
||||
const _highlightText = (thisNode, text, className) => {
|
||||
let addItems = [];
|
||||
_highlight(thisNode, addItems, text, className);
|
||||
addItems.forEach((obj) =>
|
||||
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Small JavaScript module for the documentation.
|
||||
*/
|
||||
const SphinxHighlight = {
|
||||
|
||||
/**
|
||||
* highlight the search words provided in localstorage in the text
|
||||
*/
|
||||
highlightSearchWords: () => {
|
||||
if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight
|
||||
|
||||
// get and clear terms from localstorage
|
||||
const url = new URL(window.location);
|
||||
const highlight =
|
||||
localStorage.getItem("sphinx_highlight_terms")
|
||||
|| url.searchParams.get("highlight")
|
||||
|| "";
|
||||
localStorage.removeItem("sphinx_highlight_terms")
|
||||
url.searchParams.delete("highlight");
|
||||
window.history.replaceState({}, "", url);
|
||||
|
||||
// get individual terms from highlight string
|
||||
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
||||
if (terms.length === 0) return; // nothing to do
|
||||
|
||||
// There should never be more than one element matching "div.body"
|
||||
const divBody = document.querySelectorAll("div.body");
|
||||
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
||||
window.setTimeout(() => {
|
||||
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
||||
}, 10);
|
||||
|
||||
const searchBox = document.getElementById("searchbox");
|
||||
if (searchBox === null) return;
|
||||
searchBox.appendChild(
|
||||
document
|
||||
.createRange()
|
||||
.createContextualFragment(
|
||||
'<p class="highlight-link">' +
|
||||
'<a href="javascript:SphinxHighlight.hideSearchWords()">' +
|
||||
_("Hide Search Matches") +
|
||||
"</a></p>"
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* helper function to hide the search marks again
|
||||
*/
|
||||
hideSearchWords: () => {
|
||||
document
|
||||
.querySelectorAll("#searchbox .highlight-link")
|
||||
.forEach((el) => el.remove());
|
||||
document
|
||||
.querySelectorAll("span.highlighted")
|
||||
.forEach((el) => el.classList.remove("highlighted"));
|
||||
localStorage.removeItem("sphinx_highlight_terms")
|
||||
},
|
||||
|
||||
initEscapeListener: () => {
|
||||
// only install a listener if it is really needed
|
||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return;
|
||||
|
||||
document.addEventListener("keydown", (event) => {
|
||||
// bail for input elements
|
||||
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||
// bail with special keys
|
||||
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
|
||||
if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) {
|
||||
SphinxHighlight.hideSearchWords();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
_ready(SphinxHighlight.highlightSearchWords);
|
||||
_ready(SphinxHighlight.initEscapeListener);
|
||||
539
docs/_build/html/api/cristallina.html
vendored
Normal file
539
docs/_build/html/api/cristallina.html
vendored
Normal file
File diff suppressed because one or more lines are too long
194
docs/_build/html/api/modules.html
vendored
Normal file
194
docs/_build/html/api/modules.html
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
|
||||
|
||||
<title>cristallina — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css" />
|
||||
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
<script src="../_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="cristallina package" href="cristallina.html" />
|
||||
<link rel="prev" title="Changelog" href="../changelog.html" />
|
||||
|
||||
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<section id="cristallina">
|
||||
<h1>cristallina<a class="headerlink" href="#cristallina" title="Permalink to this heading">¶</a></h1>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="cristallina.html">cristallina package</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="cristallina.html#submodules">Submodules</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="cristallina.html#module-cristallina.SEA_GraphClient">cristallina.SEA_GraphClient module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.SEA_GraphClient.GraphClient"><code class="docutils literal notranslate"><span class="pre">GraphClient</span></code></a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="cristallina.html#cristallina.SEA_GraphClient.GraphClient.close"><code class="docutils literal notranslate"><span class="pre">GraphClient.close()</span></code></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="cristallina.html#cristallina.SEA_GraphClient.GraphClient.get_curves"><code class="docutils literal notranslate"><span class="pre">GraphClient.get_curves()</span></code></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="cristallina.html#cristallina.SEA_GraphClient.GraphClient.get_names"><code class="docutils literal notranslate"><span class="pre">GraphClient.get_names()</span></code></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="cristallina.html#cristallina.SEA_GraphClient.GraphClient.get_raw"><code class="docutils literal notranslate"><span class="pre">GraphClient.get_raw()</span></code></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.SEA_GraphClient.expect_reply"><code class="docutils literal notranslate"><span class="pre">expect_reply()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.SEA_GraphClient.raw_sics_client"><code class="docutils literal notranslate"><span class="pre">raw_sics_client()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.SEA_GraphClient.sics_client"><code class="docutils literal notranslate"><span class="pre">sics_client()</span></code></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="cristallina.html#module-cristallina.analysis">cristallina.analysis module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.analysis.fit_2d_gaussian"><code class="docutils literal notranslate"><span class="pre">fit_2d_gaussian()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.analysis.get_contrast_images"><code class="docutils literal notranslate"><span class="pre">get_contrast_images()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.analysis.setup_cachedirs"><code class="docutils literal notranslate"><span class="pre">setup_cachedirs()</span></code></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="cristallina.html#module-cristallina.config">cristallina.config module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="cristallina.html#module-cristallina.plot">cristallina.plot module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.plot.axis_styling"><code class="docutils literal notranslate"><span class="pre">axis_styling()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.plot.ju_patch_less_verbose"><code class="docutils literal notranslate"><span class="pre">ju_patch_less_verbose()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.plot.plot_1d_channel"><code class="docutils literal notranslate"><span class="pre">plot_1d_channel()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.plot.plot_2d_channel"><code class="docutils literal notranslate"><span class="pre">plot_2d_channel()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.plot.plot_channel"><code class="docutils literal notranslate"><span class="pre">plot_channel()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.plot.plot_correlation"><code class="docutils literal notranslate"><span class="pre">plot_correlation()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.plot.plot_image_channel"><code class="docutils literal notranslate"><span class="pre">plot_image_channel()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.plot.plot_spectrum_channel"><code class="docutils literal notranslate"><span class="pre">plot_spectrum_channel()</span></code></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="cristallina.html#module-cristallina.skeleton">cristallina.skeleton module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.skeleton.fib"><code class="docutils literal notranslate"><span class="pre">fib()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.skeleton.main"><code class="docutils literal notranslate"><span class="pre">main()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.skeleton.parse_args"><code class="docutils literal notranslate"><span class="pre">parse_args()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.skeleton.run"><code class="docutils literal notranslate"><span class="pre">run()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.skeleton.setup_logging"><code class="docutils literal notranslate"><span class="pre">setup_logging()</span></code></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="cristallina.html#module-cristallina.utils">cristallina.utils module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.FWHM_to_sigma"><code class="docutils literal notranslate"><span class="pre">FWHM_to_sigma()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.ROI"><code class="docutils literal notranslate"><span class="pre">ROI</span></code></a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="cristallina.html#cristallina.utils.ROI.LeftRightBottomTop"><code class="docutils literal notranslate"><span class="pre">ROI.LeftRightBottomTop</span></code></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="cristallina.html#cristallina.utils.ROI.cols"><code class="docutils literal notranslate"><span class="pre">ROI.cols</span></code></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="cristallina.html#cristallina.utils.ROI.from_centers_widths"><code class="docutils literal notranslate"><span class="pre">ROI.from_centers_widths()</span></code></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="cristallina.html#cristallina.utils.ROI.height"><code class="docutils literal notranslate"><span class="pre">ROI.height</span></code></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="cristallina.html#cristallina.utils.ROI.rows"><code class="docutils literal notranslate"><span class="pre">ROI.rows</span></code></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="cristallina.html#cristallina.utils.ROI.width"><code class="docutils literal notranslate"><span class="pre">ROI.width</span></code></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.channel_names"><code class="docutils literal notranslate"><span class="pre">channel_names()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.eV_to_joules"><code class="docutils literal notranslate"><span class="pre">eV_to_joules()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.find_nearest"><code class="docutils literal notranslate"><span class="pre">find_nearest()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.find_two_nearest"><code class="docutils literal notranslate"><span class="pre">find_two_nearest()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.gauss"><code class="docutils literal notranslate"><span class="pre">gauss()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.gauss_fit"><code class="docutils literal notranslate"><span class="pre">gauss_fit()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.heuristic_extract_base_path"><code class="docutils literal notranslate"><span class="pre">heuristic_extract_base_path()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.heuristic_extract_pgroup"><code class="docutils literal notranslate"><span class="pre">heuristic_extract_pgroup()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.heuristic_extract_smalldata_path"><code class="docutils literal notranslate"><span class="pre">heuristic_extract_smalldata_path()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.joules_to_eV"><code class="docutils literal notranslate"><span class="pre">joules_to_eV()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.photon_energy_from_wavelength"><code class="docutils literal notranslate"><span class="pre">photon_energy_from_wavelength()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.print_run_info"><code class="docutils literal notranslate"><span class="pre">print_run_info()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.process_run"><code class="docutils literal notranslate"><span class="pre">process_run()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.scan_info"><code class="docutils literal notranslate"><span class="pre">scan_info()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.sigma_to_FWHM"><code class="docutils literal notranslate"><span class="pre">sigma_to_FWHM()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.wavelength_from_photon_energy"><code class="docutils literal notranslate"><span class="pre">wavelength_from_photon_energy()</span></code></a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="cristallina.html#cristallina.utils.xray_transmission"><code class="docutils literal notranslate"><span class="pre">xray_transmission()</span></code></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="cristallina.html#module-cristallina">Module contents</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="../index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="../readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Module Reference</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="cristallina.html">cristallina package</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="../index.html">Documentation overview</a><ul>
|
||||
<li>Previous: <a href="../changelog.html" title="previous chapter">Changelog</a></li>
|
||||
<li>Next: <a href="cristallina.html" title="next chapter">cristallina package</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
|
|
||||
<a href="../_sources/api/modules.rst.txt"
|
||||
rel="nofollow">Page source</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
116
docs/_build/html/authors.html
vendored
Normal file
116
docs/_build/html/authors.html
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
|
||||
|
||||
<title>Contributors — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="Changelog" href="changelog.html" />
|
||||
<link rel="prev" title="License" href="license.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<section id="contributors">
|
||||
<span id="authors"></span><h1>Contributors<a class="headerlink" href="#contributors" title="Permalink to this heading">¶</a></h1>
|
||||
<ul class="simple">
|
||||
<li><p>Alexander Steppke <<a class="reference external" href="mailto:alexander.steppke%40psi.ch">alexander<span>.</span>steppke<span>@</span>psi<span>.</span>ch</a>></p></li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="index.html">Documentation overview</a><ul>
|
||||
<li>Previous: <a href="license.html" title="previous chapter">License</a></li>
|
||||
<li>Next: <a href="changelog.html" title="next chapter">Changelog</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
|
|
||||
<a href="_sources/authors.rst.txt"
|
||||
rel="nofollow">Page source</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
123
docs/_build/html/changelog.html
vendored
Normal file
123
docs/_build/html/changelog.html
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
|
||||
|
||||
<title>Changelog — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="cristallina" href="api/modules.html" />
|
||||
<link rel="prev" title="Contributors" href="authors.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<section id="changelog">
|
||||
<span id="changes"></span><h1>Changelog<a class="headerlink" href="#changelog" title="Permalink to this heading">¶</a></h1>
|
||||
<section id="version-0-1">
|
||||
<h2>Version 0.1<a class="headerlink" href="#version-0-1" title="Permalink to this heading">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p>Some basic functionality is implemented.</p></li>
|
||||
<li><p>Requires some example notebooks and documentation.</p></li>
|
||||
</ul>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Changelog</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#version-0-1">Version 0.1</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="index.html">Documentation overview</a><ul>
|
||||
<li>Previous: <a href="authors.html" title="previous chapter">Contributors</a></li>
|
||||
<li>Next: <a href="api/modules.html" title="next chapter">cristallina</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
|
|
||||
<a href="_sources/changelog.rst.txt"
|
||||
rel="nofollow">Page source</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
357
docs/_build/html/contributing.html
vendored
Normal file
357
docs/_build/html/contributing.html
vendored
Normal file
@@ -0,0 +1,357 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
|
||||
|
||||
<title>TODO — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="License" href="license.html" />
|
||||
<link rel="prev" title="cristallina" href="readme.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<section id="todo">
|
||||
<h1>TODO<a class="headerlink" href="#todo" title="Permalink to this heading">¶</a></h1>
|
||||
<p>This is a general guide to contribute to python based projects and does not yet contain any <code class="docutils literal notranslate"><span class="pre">cristallina</span></code> specific information.</p>
|
||||
</section>
|
||||
<section id="contributing">
|
||||
<h1>Contributing<a class="headerlink" href="#contributing" title="Permalink to this heading">¶</a></h1>
|
||||
<p>Welcome to <code class="docutils literal notranslate"><span class="pre">cristallina</span></code> contributor’s guide.</p>
|
||||
<p>This document focuses on getting any potential contributor familiarized
|
||||
with the development processes, but <a class="reference external" href="https://opensource.guide/how-to-contribute">other kinds of contributions</a> are also
|
||||
appreciated.</p>
|
||||
<p>If you are new to using <a class="reference external" href="https://git-scm.com">git</a> or have never collaborated in a project previously,
|
||||
please have a look at <a class="reference external" href="https://www.contribution-guide.org/">contribution-guide.org</a>. Other resources are also
|
||||
listed in the excellent <a class="reference external" href="https://github.com/FreeCodeCamp/how-to-contribute-to-open-source">guide created by FreeCodeCamp</a> <a class="footnote-reference brackets" href="#contrib1" id="id4" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>.</p>
|
||||
<p>Please notice, all users and contributors are expected to be <strong>open,
|
||||
considerate, reasonable, and respectful</strong>. When in doubt, <a class="reference external" href="https://www.python.org/psf/conduct/">Python Software
|
||||
Foundation’s Code of Conduct</a> is a good reference in terms of behavior
|
||||
guidelines.</p>
|
||||
<section id="issue-reports">
|
||||
<h2>Issue Reports<a class="headerlink" href="#issue-reports" title="Permalink to this heading">¶</a></h2>
|
||||
<p>If you experience bugs or general issues with <code class="docutils literal notranslate"><span class="pre">cristallina</span></code>, please have a look
|
||||
on the <a class="reference external" href="https://github.com/<USERNAME>/cristallina/issues">issue tracker</a>. If you don’t see anything useful there, please feel
|
||||
free to fire an issue report.</p>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Tip</p>
|
||||
<p>Please don’t forget to include the closed issues in your search.
|
||||
Sometimes a solution was already reported, and the problem is considered
|
||||
<strong>solved</strong>.</p>
|
||||
</div>
|
||||
<p>New issue reports should include information about your programming environment
|
||||
(e.g., operating system, Python version) and steps to reproduce the problem.
|
||||
Please try also to simplify the reproduction steps to a very minimal example
|
||||
that still illustrates the problem you are facing. By removing other factors,
|
||||
you help us to identify the root cause of the issue.</p>
|
||||
</section>
|
||||
<section id="documentation-improvements">
|
||||
<h2>Documentation Improvements<a class="headerlink" href="#documentation-improvements" title="Permalink to this heading">¶</a></h2>
|
||||
<p>You can help improve <code class="docutils literal notranslate"><span class="pre">cristallina</span></code> docs by making them more readable and coherent, or
|
||||
by adding missing information and correcting mistakes.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">cristallina</span></code> documentation uses <a class="reference external" href="https://www.sphinx-doc.org/en/master/">Sphinx</a> as its main documentation compiler.
|
||||
This means that the docs are kept in the same repository as the project code, and
|
||||
that any documentation update is done in the same way was a code contribution.</p>
|
||||
<p>When working on documentation changes in your local machine, you can
|
||||
compile them using <a class="reference external" href="https://tox.wiki/en/stable/"><code class="docutils literal notranslate"><span class="pre">tox</span></code></a>:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tox</span> <span class="o">-</span><span class="n">e</span> <span class="n">docs</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>and use Python’s built-in web server for a preview in your web browser
|
||||
(<code class="docutils literal notranslate"><span class="pre">http://localhost:8000</span></code>):</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python3</span> <span class="o">-</span><span class="n">m</span> <span class="n">http</span><span class="o">.</span><span class="n">server</span> <span class="o">--</span><span class="n">directory</span> <span class="s1">'docs/_build/html'</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="code-contributions">
|
||||
<h2>Code Contributions<a class="headerlink" href="#code-contributions" title="Permalink to this heading">¶</a></h2>
|
||||
<section id="submit-an-issue">
|
||||
<h3>Submit an issue<a class="headerlink" href="#submit-an-issue" title="Permalink to this heading">¶</a></h3>
|
||||
<p>Before you work on any non-trivial code contribution it’s best to first create
|
||||
a report in the <a class="reference external" href="https://github.com/<USERNAME>/cristallina/issues">issue tracker</a> to start a discussion on the subject.
|
||||
This often provides additional considerations and avoids unnecessary work.</p>
|
||||
</section>
|
||||
<section id="create-an-environment">
|
||||
<h3>Create an environment<a class="headerlink" href="#create-an-environment" title="Permalink to this heading">¶</a></h3>
|
||||
<p>Before you start coding, we recommend creating an isolated <a class="reference external" href="https://realpython.com/python-virtual-environments-a-primer/">virtual
|
||||
environment</a> to avoid any problems with your installed Python packages.
|
||||
This can easily be done via either <a class="reference external" href="https://virtualenv.pypa.io/en/stable/"><code class="docutils literal notranslate"><span class="pre">virtualenv</span></code></a>:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">virtualenv</span> <span class="o"><</span><span class="n">PATH</span> <span class="n">TO</span> <span class="n">VENV</span><span class="o">></span>
|
||||
<span class="n">source</span> <span class="o"><</span><span class="n">PATH</span> <span class="n">TO</span> <span class="n">VENV</span><span class="o">>/</span><span class="nb">bin</span><span class="o">/</span><span class="n">activate</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>or <a class="reference external" href="https://docs.conda.io/en/latest/miniconda.html">Miniconda</a>:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">create</span> <span class="o">-</span><span class="n">n</span> <span class="n">cristallina</span> <span class="n">python</span><span class="o">=</span><span class="mi">3</span> <span class="n">six</span> <span class="n">virtualenv</span> <span class="n">pytest</span> <span class="n">pytest</span><span class="o">-</span><span class="n">cov</span>
|
||||
<span class="n">conda</span> <span class="n">activate</span> <span class="n">cristallina</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="clone-the-repository">
|
||||
<h3>Clone the repository<a class="headerlink" href="#clone-the-repository" title="Permalink to this heading">¶</a></h3>
|
||||
<ol class="arabic">
|
||||
<li><p>Create an user account on GitHub if you do not already have one.</p></li>
|
||||
<li><p>Fork the project <a class="reference external" href="https://github.com/<USERNAME>/cristallina">repository</a>: click on the <em>Fork</em> button near the top of the
|
||||
page. This creates a copy of the code under your account on GitHub.</p></li>
|
||||
<li><p>Clone this copy to your local disk:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">git</span><span class="nd">@github</span><span class="o">.</span><span class="n">com</span><span class="p">:</span><span class="n">YourLogin</span><span class="o">/</span><span class="n">cristallina</span><span class="o">.</span><span class="n">git</span>
|
||||
<span class="n">cd</span> <span class="n">cristallina</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><p>You should run:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">U</span> <span class="n">pip</span> <span class="n">setuptools</span> <span class="o">-</span><span class="n">e</span> <span class="o">.</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>to be able to import the package under development in the Python REPL.</p>
|
||||
</li>
|
||||
<li><p>Install <a class="reference external" href="https://pre-commit.com/"><code class="docutils literal notranslate"><span class="pre">pre-commit</span></code></a>:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">pre</span><span class="o">-</span><span class="n">commit</span>
|
||||
<span class="n">pre</span><span class="o">-</span><span class="n">commit</span> <span class="n">install</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">cristallina</span></code> comes with a lot of hooks configured to automatically help the
|
||||
developer to check the code being written.</p>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
<section id="implement-your-changes">
|
||||
<h3>Implement your changes<a class="headerlink" href="#implement-your-changes" title="Permalink to this heading">¶</a></h3>
|
||||
<ol class="arabic">
|
||||
<li><p>Create a branch to hold your changes:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">checkout</span> <span class="o">-</span><span class="n">b</span> <span class="n">my</span><span class="o">-</span><span class="n">feature</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>and start making changes. Never work on the main branch!</p>
|
||||
</li>
|
||||
<li><p>Start your work on this branch. Don’t forget to add <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html">docstrings</a> to new
|
||||
functions, modules and classes, especially if they are part of public APIs.</p></li>
|
||||
<li><p>Add yourself to the list of contributors in <code class="docutils literal notranslate"><span class="pre">AUTHORS.rst</span></code>.</p></li>
|
||||
<li><p>When you’re done editing, do:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">add</span> <span class="o"><</span><span class="n">MODIFIED</span> <span class="n">FILES</span><span class="o">></span>
|
||||
<span class="n">git</span> <span class="n">commit</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>to record your changes in <a class="reference external" href="https://git-scm.com">git</a>.</p>
|
||||
<p>Please make sure to see the validation messages from <a class="reference external" href="https://pre-commit.com/"><code class="docutils literal notranslate"><span class="pre">pre-commit</span></code></a> and fix
|
||||
any eventual issues.
|
||||
This should automatically use <a class="reference external" href="https://flake8.pycqa.org/en/stable/">flake8</a>/<a class="reference external" href="https://pypi.org/project/black/">black</a> to check/fix the code style
|
||||
in a way that is compatible with the project.</p>
|
||||
<div class="admonition important">
|
||||
<p class="admonition-title">Important</p>
|
||||
<p>Don’t forget to add unit tests and documentation in case your
|
||||
contribution adds an additional feature and is not just a bugfix.</p>
|
||||
<p>Moreover, writing a <a class="reference external" href="https://chris.beams.io/posts/git-commit">descriptive commit message</a> is highly recommended.
|
||||
In case of doubt, you can check the commit history with:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">log</span> <span class="o">--</span><span class="n">graph</span> <span class="o">--</span><span class="n">decorate</span> <span class="o">--</span><span class="n">pretty</span><span class="o">=</span><span class="n">oneline</span> <span class="o">--</span><span class="n">abbrev</span><span class="o">-</span><span class="n">commit</span> <span class="o">--</span><span class="nb">all</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>to look for recurring communication patterns.</p>
|
||||
</div>
|
||||
</li>
|
||||
<li><p>Please check that your changes don’t break any unit tests with:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tox</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>(after having installed <a class="reference external" href="https://tox.wiki/en/stable/"><code class="docutils literal notranslate"><span class="pre">tox</span></code></a> with <code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">tox</span></code> or <code class="docutils literal notranslate"><span class="pre">pipx</span></code>).</p>
|
||||
<p>You can also use <a class="reference external" href="https://tox.wiki/en/stable/"><code class="docutils literal notranslate"><span class="pre">tox</span></code></a> to run several other pre-configured tasks in the
|
||||
repository. Try <code class="docutils literal notranslate"><span class="pre">tox</span> <span class="pre">-av</span></code> to see a list of the available checks.</p>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
<section id="submit-your-contribution">
|
||||
<h3>Submit your contribution<a class="headerlink" href="#submit-your-contribution" title="Permalink to this heading">¶</a></h3>
|
||||
<ol class="arabic">
|
||||
<li><p>If everything works fine, push your local branch to GitHub with:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">push</span> <span class="o">-</span><span class="n">u</span> <span class="n">origin</span> <span class="n">my</span><span class="o">-</span><span class="n">feature</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><p>Go to the web page of your fork and click “Create pull request”
|
||||
to send your changes for review.</p>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
<section id="troubleshooting">
|
||||
<h3>Troubleshooting<a class="headerlink" href="#troubleshooting" title="Permalink to this heading">¶</a></h3>
|
||||
<p>The following tips can be used when facing problems to build or test the
|
||||
package:</p>
|
||||
<ol class="arabic">
|
||||
<li><p>Make sure to fetch all the tags from the upstream <a class="reference external" href="https://github.com/<USERNAME>/cristallina">repository</a>.
|
||||
The command <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">describe</span> <span class="pre">--abbrev=0</span> <span class="pre">--tags</span></code> should return the version you
|
||||
are expecting. If you are trying to run CI scripts in a fork repository,
|
||||
make sure to push all the tags.
|
||||
You can also try to remove all the egg files or the complete egg folder, i.e.,
|
||||
<code class="docutils literal notranslate"><span class="pre">.eggs</span></code>, as well as the <code class="docutils literal notranslate"><span class="pre">*.egg-info</span></code> folders in the <code class="docutils literal notranslate"><span class="pre">src</span></code> folder or
|
||||
potentially in the root of your project.</p></li>
|
||||
<li><p>Sometimes <a class="reference external" href="https://tox.wiki/en/stable/"><code class="docutils literal notranslate"><span class="pre">tox</span></code></a> misses out when new dependencies are added, especially to
|
||||
<code class="docutils literal notranslate"><span class="pre">setup.cfg</span></code> and <code class="docutils literal notranslate"><span class="pre">docs/requirements.txt</span></code>. If you find any problems with
|
||||
missing dependencies when running a command with <a class="reference external" href="https://tox.wiki/en/stable/"><code class="docutils literal notranslate"><span class="pre">tox</span></code></a>, try to recreate the
|
||||
<code class="docutils literal notranslate"><span class="pre">tox</span></code> environment using the <code class="docutils literal notranslate"><span class="pre">-r</span></code> flag. For example, instead of:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tox</span> <span class="o">-</span><span class="n">e</span> <span class="n">docs</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Try running:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tox</span> <span class="o">-</span><span class="n">r</span> <span class="o">-</span><span class="n">e</span> <span class="n">docs</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><p>Make sure to have a reliable <a class="reference external" href="https://tox.wiki/en/stable/"><code class="docutils literal notranslate"><span class="pre">tox</span></code></a> installation that uses the correct
|
||||
Python version (e.g., 3.7+). When in doubt you can run:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tox</span> <span class="o">--</span><span class="n">version</span>
|
||||
<span class="c1"># OR</span>
|
||||
<span class="n">which</span> <span class="n">tox</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>If you have trouble and are seeing weird errors upon running <a class="reference external" href="https://tox.wiki/en/stable/"><code class="docutils literal notranslate"><span class="pre">tox</span></code></a>, you can
|
||||
also try to create a dedicated <a class="reference external" href="https://realpython.com/python-virtual-environments-a-primer/">virtual environment</a> with a <a class="reference external" href="https://tox.wiki/en/stable/"><code class="docutils literal notranslate"><span class="pre">tox</span></code></a> binary
|
||||
freshly installed. For example:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">virtualenv</span> <span class="o">.</span><span class="n">venv</span>
|
||||
<span class="n">source</span> <span class="o">.</span><span class="n">venv</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">activate</span>
|
||||
<span class="o">.</span><span class="n">venv</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">pip</span> <span class="n">install</span> <span class="n">tox</span>
|
||||
<span class="o">.</span><span class="n">venv</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">tox</span> <span class="o">-</span><span class="n">e</span> <span class="nb">all</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><p><a class="reference external" href="https://docs.pytest.org/en/stable/how-to/failures.html#using-python-library-pdb-with-pytest">Pytest can drop you</a> in an interactive session in the case an error occurs.
|
||||
In order to do that you need to pass a <code class="docutils literal notranslate"><span class="pre">--pdb</span></code> option (for example by
|
||||
running <code class="docutils literal notranslate"><span class="pre">tox</span> <span class="pre">--</span> <span class="pre">-k</span> <span class="pre"><NAME</span> <span class="pre">OF</span> <span class="pre">THE</span> <span class="pre">FALLING</span> <span class="pre">TEST></span> <span class="pre">--pdb</span></code>).
|
||||
You can also setup breakpoints manually instead of using the <code class="docutils literal notranslate"><span class="pre">--pdb</span></code> option.</p></li>
|
||||
</ol>
|
||||
</section>
|
||||
</section>
|
||||
<section id="maintainer-tasks">
|
||||
<h2>Maintainer tasks<a class="headerlink" href="#maintainer-tasks" title="Permalink to this heading">¶</a></h2>
|
||||
<section id="releases">
|
||||
<h3>Releases<a class="headerlink" href="#releases" title="Permalink to this heading">¶</a></h3>
|
||||
<p>If you are part of the group of maintainers and have correct user permissions
|
||||
on <a class="reference external" href="https://pypi.org/">PyPI</a>, the following steps can be used to release a new version for
|
||||
<code class="docutils literal notranslate"><span class="pre">cristallina</span></code>:</p>
|
||||
<ol class="arabic simple">
|
||||
<li><p>Make sure all unit tests are successful.</p></li>
|
||||
<li><p>Tag the current commit on the main branch with a release tag, e.g., <code class="docutils literal notranslate"><span class="pre">v1.2.3</span></code>.</p></li>
|
||||
<li><p>Push the new tag to the upstream <a class="reference external" href="https://github.com/<USERNAME>/cristallina">repository</a>, e.g., <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">push</span> <span class="pre">upstream</span> <span class="pre">v1.2.3</span></code></p></li>
|
||||
<li><p>Clean up the <code class="docutils literal notranslate"><span class="pre">dist</span></code> and <code class="docutils literal notranslate"><span class="pre">build</span></code> folders with <code class="docutils literal notranslate"><span class="pre">tox</span> <span class="pre">-e</span> <span class="pre">clean</span></code>
|
||||
(or <code class="docutils literal notranslate"><span class="pre">rm</span> <span class="pre">-rf</span> <span class="pre">dist</span> <span class="pre">build</span></code>)
|
||||
to avoid confusion with old builds and Sphinx docs.</p></li>
|
||||
<li><p>Run <code class="docutils literal notranslate"><span class="pre">tox</span> <span class="pre">-e</span> <span class="pre">build</span></code> and check that the files in <code class="docutils literal notranslate"><span class="pre">dist</span></code> have
|
||||
the correct version (no <code class="docutils literal notranslate"><span class="pre">.dirty</span></code> or <a class="reference external" href="https://git-scm.com">git</a> hash) according to the <a class="reference external" href="https://git-scm.com">git</a> tag.
|
||||
Also check the sizes of the distributions, if they are too big (e.g., >
|
||||
500KB), unwanted clutter may have been accidentally included.</p></li>
|
||||
<li><p>Run <code class="docutils literal notranslate"><span class="pre">tox</span> <span class="pre">-e</span> <span class="pre">publish</span> <span class="pre">--</span> <span class="pre">--repository</span> <span class="pre">pypi</span></code> and check that everything was
|
||||
uploaded to <a class="reference external" href="https://pypi.org/">PyPI</a> correctly.</p></li>
|
||||
</ol>
|
||||
<aside class="footnote-list brackets">
|
||||
<aside class="footnote brackets" id="contrib1" role="note">
|
||||
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id4">1</a><span class="fn-bracket">]</span></span>
|
||||
<p>Even though, these resources focus on open source projects and
|
||||
communities, the general ideas behind collaborating with other developers
|
||||
to collectively create software are general and can be applied to all sorts
|
||||
of environments, including private companies and proprietary code bases.</p>
|
||||
</aside>
|
||||
</aside>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="readme.html">Overview</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="#contributing">Contributing</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#issue-reports">Issue Reports</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#documentation-improvements">Documentation Improvements</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#code-contributions">Code Contributions</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#maintainer-tasks">Maintainer tasks</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="index.html">Documentation overview</a><ul>
|
||||
<li>Previous: <a href="readme.html" title="previous chapter">cristallina</a></li>
|
||||
<li>Next: <a href="license.html" title="next chapter">License</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
|
|
||||
<a href="_sources/contributing.rst.txt"
|
||||
rel="nofollow">Page source</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
392
docs/_build/html/genindex.html
vendored
Normal file
392
docs/_build/html/genindex.html
vendored
Normal file
@@ -0,0 +1,392 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Index — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="#" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
|
||||
<h1 id="index">Index</h1>
|
||||
|
||||
<div class="genindex-jumpbox">
|
||||
<a href="#A"><strong>A</strong></a>
|
||||
| <a href="#C"><strong>C</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="#H"><strong>H</strong></a>
|
||||
| <a href="#J"><strong>J</strong></a>
|
||||
| <a href="#L"><strong>L</strong></a>
|
||||
| <a href="#M"><strong>M</strong></a>
|
||||
| <a href="#P"><strong>P</strong></a>
|
||||
| <a href="#R"><strong>R</strong></a>
|
||||
| <a href="#S"><strong>S</strong></a>
|
||||
| <a href="#W"><strong>W</strong></a>
|
||||
| <a href="#X"><strong>X</strong></a>
|
||||
|
||||
</div>
|
||||
<h2 id="A">A</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.plot.axis_styling">axis_styling() (in module cristallina.plot)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="C">C</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.channel_names">channel_names() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.SEA_GraphClient.GraphClient.close">close() (cristallina.SEA_GraphClient.GraphClient method)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.ROI.cols">cols (cristallina.utils.ROI property)</a>
|
||||
</li>
|
||||
<li>
|
||||
cristallina
|
||||
|
||||
<ul>
|
||||
<li><a href="api/cristallina.html#module-cristallina">module</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li>
|
||||
cristallina.analysis
|
||||
|
||||
<ul>
|
||||
<li><a href="api/cristallina.html#module-cristallina.analysis">module</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li>
|
||||
cristallina.config
|
||||
|
||||
<ul>
|
||||
<li><a href="api/cristallina.html#module-cristallina.config">module</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li>
|
||||
cristallina.plot
|
||||
|
||||
<ul>
|
||||
<li><a href="api/cristallina.html#module-cristallina.plot">module</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li>
|
||||
cristallina.SEA_GraphClient
|
||||
|
||||
<ul>
|
||||
<li><a href="api/cristallina.html#module-cristallina.SEA_GraphClient">module</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li>
|
||||
cristallina.skeleton
|
||||
|
||||
<ul>
|
||||
<li><a href="api/cristallina.html#module-cristallina.skeleton">module</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li>
|
||||
cristallina.utils
|
||||
|
||||
<ul>
|
||||
<li><a href="api/cristallina.html#module-cristallina.utils">module</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="E">E</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.eV_to_joules">eV_to_joules() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.SEA_GraphClient.expect_reply">expect_reply() (in module cristallina.SEA_GraphClient)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="F">F</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.skeleton.fib">fib() (in module cristallina.skeleton)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.find_nearest">find_nearest() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.find_two_nearest">find_two_nearest() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.analysis.fit_2d_gaussian">fit_2d_gaussian() (in module cristallina.analysis)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.ROI.from_centers_widths">from_centers_widths() (cristallina.utils.ROI method)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.FWHM_to_sigma">FWHM_to_sigma() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="G">G</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.gauss">gauss() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.gauss_fit">gauss_fit() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.analysis.get_contrast_images">get_contrast_images() (in module cristallina.analysis)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.SEA_GraphClient.GraphClient.get_curves">get_curves() (cristallina.SEA_GraphClient.GraphClient method)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.SEA_GraphClient.GraphClient.get_names">get_names() (cristallina.SEA_GraphClient.GraphClient method)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.SEA_GraphClient.GraphClient.get_raw">get_raw() (cristallina.SEA_GraphClient.GraphClient method)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.SEA_GraphClient.GraphClient">GraphClient (class in cristallina.SEA_GraphClient)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="H">H</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.ROI.height">height (cristallina.utils.ROI property)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.heuristic_extract_base_path">heuristic_extract_base_path() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.heuristic_extract_pgroup">heuristic_extract_pgroup() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.heuristic_extract_smalldata_path">heuristic_extract_smalldata_path() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="J">J</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.joules_to_eV">joules_to_eV() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.plot.ju_patch_less_verbose">ju_patch_less_verbose() (in module cristallina.plot)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="L">L</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.ROI.LeftRightBottomTop">LeftRightBottomTop (cristallina.utils.ROI property)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="M">M</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.skeleton.main">main() (in module cristallina.skeleton)</a>
|
||||
</li>
|
||||
<li>
|
||||
module
|
||||
|
||||
<ul>
|
||||
<li><a href="api/cristallina.html#module-cristallina">cristallina</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#module-cristallina.analysis">cristallina.analysis</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#module-cristallina.config">cristallina.config</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#module-cristallina.plot">cristallina.plot</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#module-cristallina.SEA_GraphClient">cristallina.SEA_GraphClient</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#module-cristallina.skeleton">cristallina.skeleton</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#module-cristallina.utils">cristallina.utils</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="P">P</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.skeleton.parse_args">parse_args() (in module cristallina.skeleton)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.photon_energy_from_wavelength">photon_energy_from_wavelength() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.plot.plot_1d_channel">plot_1d_channel() (in module cristallina.plot)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.plot.plot_2d_channel">plot_2d_channel() (in module cristallina.plot)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.plot.plot_channel">plot_channel() (in module cristallina.plot)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.plot.plot_correlation">plot_correlation() (in module cristallina.plot)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.plot.plot_image_channel">plot_image_channel() (in module cristallina.plot)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.plot.plot_spectrum_channel">plot_spectrum_channel() (in module cristallina.plot)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.print_run_info">print_run_info() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.process_run">process_run() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="R">R</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.SEA_GraphClient.raw_sics_client">raw_sics_client() (in module cristallina.SEA_GraphClient)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.ROI">ROI (class in cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.ROI.rows">rows (cristallina.utils.ROI property)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.skeleton.run">run() (in module cristallina.skeleton)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="S">S</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.scan_info">scan_info() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.analysis.setup_cachedirs">setup_cachedirs() (in module cristallina.analysis)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.skeleton.setup_logging">setup_logging() (in module cristallina.skeleton)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.SEA_GraphClient.sics_client">sics_client() (in module cristallina.SEA_GraphClient)</a>
|
||||
</li>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.sigma_to_FWHM">sigma_to_FWHM() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="W">W</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.wavelength_from_photon_energy">wavelength_from_photon_energy() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.ROI.width">width (cristallina.utils.ROI property)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="X">X</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/cristallina.html#cristallina.utils.xray_transmission">xray_transmission() (in module cristallina.utils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="index.html">Documentation overview</a><ul>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
162
docs/_build/html/index.html
vendored
Normal file
162
docs/_build/html/index.html
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
|
||||
|
||||
<title>cristallina — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="cristallina" href="readme.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<section id="cristallina">
|
||||
<h1>cristallina<a class="headerlink" href="#cristallina" title="Permalink to this heading">¶</a></h1>
|
||||
<p>This is the documentation of <strong>cristallina</strong>.</p>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<p>This is the main page of your project’s <a class="reference external" href="https://www.sphinx-doc.org/">Sphinx</a> documentation.
|
||||
It is formatted in <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html">reStructuredText</a>. Add additional pages
|
||||
by creating rst-files in <code class="docutils literal notranslate"><span class="pre">docs</span></code> and adding them to the <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html">toctree</a> below.
|
||||
Use then <a class="reference external" href="https://www.sphinx-doc.org/en/stable/markup/inline.html">references</a> in order to link them from this page, e.g.
|
||||
<a class="reference internal" href="authors.html#authors"><span class="std std-ref">Contributors</span></a> and <a class="reference internal" href="changelog.html#changes"><span class="std std-ref">Changelog</span></a>.</p>
|
||||
<p>It is also possible to refer to the documentation of other Python packages
|
||||
with the <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-python-domain">Python domain syntax</a>. By default you can reference the
|
||||
documentation of <a class="reference external" href="https://www.sphinx-doc.org/">Sphinx</a>, <a class="reference external" href="https://docs.python.org/">Python</a>, <a class="reference external" href="https://numpy.org/doc/stable">NumPy</a>, <a class="reference external" href="https://docs.scipy.org/doc/scipy/reference/">SciPy</a>, <a class="reference external" href="https://matplotlib.org/contents.html#">matplotlib</a>,
|
||||
<a class="reference external" href="https://pandas.pydata.org/pandas-docs/stable">Pandas</a>, <a class="reference external" href="https://scikit-learn.org/stable">Scikit-Learn</a>. You can add more by extending the
|
||||
<code class="docutils literal notranslate"><span class="pre">intersphinx_mapping</span></code> in your Sphinx’s <code class="docutils literal notranslate"><span class="pre">conf.py</span></code>.</p>
|
||||
<p>The pretty useful extension <a class="reference external" href="https://www.sphinx-doc.org/en/master/ext/autodoc.html">autodoc</a> is activated by default and lets
|
||||
you include documentation from docstrings. Docstrings can be written in
|
||||
<a class="reference external" href="https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings">Google style</a> (recommended!), <a class="reference external" href="https://numpydoc.readthedocs.io/en/latest/format.html">NumPy style</a> and <a class="reference external" href="https://www.sphinx-doc.org/en/master/domains.html#info-field-lists">classical style</a>.</p>
|
||||
</div>
|
||||
<section id="contents">
|
||||
<h2>Contents<a class="headerlink" href="#contents" title="Permalink to this heading">¶</a></h2>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html#contributing">Contributing</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="contributing.html#issue-reports">Issue Reports</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="contributing.html#documentation-improvements">Documentation Improvements</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="contributing.html#code-contributions">Code Contributions</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="contributing.html#maintainer-tasks">Maintainer tasks</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="changelog.html#version-0-1">Version 0.1</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">Module Reference</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/cristallina.html">cristallina package</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
<section id="indices-and-tables">
|
||||
<h2>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this heading">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
|
||||
<li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
|
||||
<li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li>
|
||||
</ul>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="#">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="#">Documentation overview</a><ul>
|
||||
<li>Next: <a href="readme.html" title="next chapter">cristallina</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
|
|
||||
<a href="_sources/index.rst.txt"
|
||||
rel="nofollow">Page source</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
114
docs/_build/html/license.html
vendored
Normal file
114
docs/_build/html/license.html
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
|
||||
|
||||
<title>License — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="Contributors" href="authors.html" />
|
||||
<link rel="prev" title="TODO" href="contributing.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<section id="license">
|
||||
<span id="id1"></span><h1>License<a class="headerlink" href="#license" title="Permalink to this heading">¶</a></h1>
|
||||
<p>No explicit LICENSE given, all code belongs to the respective authors.</p>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="index.html">Documentation overview</a><ul>
|
||||
<li>Previous: <a href="contributing.html" title="previous chapter">TODO</a></li>
|
||||
<li>Next: <a href="authors.html" title="next chapter">Contributors</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
|
|
||||
<a href="_sources/license.rst.txt"
|
||||
rel="nofollow">Page source</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/_build/html/objects.inv
vendored
Normal file
BIN
docs/_build/html/objects.inv
vendored
Normal file
Binary file not shown.
153
docs/_build/html/py-modindex.html
vendored
Normal file
153
docs/_build/html/py-modindex.html
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Python Module Index — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
|
||||
<h1>Python Module Index</h1>
|
||||
|
||||
<div class="modindex-jumpbox">
|
||||
<a href="#cap-c"><strong>c</strong></a>
|
||||
</div>
|
||||
|
||||
<table class="indextable modindextable">
|
||||
<tr class="pcap"><td></td><td> </td><td></td></tr>
|
||||
<tr class="cap" id="cap-c"><td></td><td>
|
||||
<strong>c</strong></td><td></td></tr>
|
||||
<tr>
|
||||
<td><img src="_static/minus.png" class="toggler"
|
||||
id="toggle-1" style="display: none" alt="-" /></td>
|
||||
<td>
|
||||
<a href="api/cristallina.html#module-cristallina"><code class="xref">cristallina</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="api/cristallina.html#module-cristallina.analysis"><code class="xref">cristallina.analysis</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="api/cristallina.html#module-cristallina.config"><code class="xref">cristallina.config</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="api/cristallina.html#module-cristallina.plot"><code class="xref">cristallina.plot</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="api/cristallina.html#module-cristallina.SEA_GraphClient"><code class="xref">cristallina.SEA_GraphClient</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="api/cristallina.html#module-cristallina.skeleton"><code class="xref">cristallina.skeleton</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="api/cristallina.html#module-cristallina.utils"><code class="xref">cristallina.utils</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="index.html">Documentation overview</a><ul>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
123
docs/_build/html/readme.html
vendored
Normal file
123
docs/_build/html/readme.html
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
|
||||
|
||||
<title>cristallina — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/sphinx_highlight.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="TODO" href="contributing.html" />
|
||||
<link rel="prev" title="cristallina" href="index.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<span class="target" id="readme"></span><a class="reference external image-reference" href="https://pyscaffold.org/"><img alt="Project generated with PyScaffold" src="https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold" /></a>
|
||||
<div class="line-block">
|
||||
<div class="line"><br /></div>
|
||||
</div>
|
||||
<section id="cristallina">
|
||||
<h1>cristallina<a class="headerlink" href="#cristallina" title="Permalink to this heading">¶</a></h1>
|
||||
<blockquote>
|
||||
<div><p>Cristallina data analysis modules and plotting utilities.</p>
|
||||
</div></blockquote>
|
||||
<p>Here we collect modules for data analysis, plotting and utility functions for the Cristallina endstation.</p>
|
||||
<p>The data analysis is based on the common SwissFEL data architecture, with convienent access provided by <a class="reference external" href="https://github.com/paulscherrerinstitute/sf_datafiles">sf_datafiles</a>.</p>
|
||||
<p>The test suite (based on pytest) requires access to some data only available on either the cristallina consoles or the RA cluster.</p>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="index.html">Documentation overview</a><ul>
|
||||
<li>Previous: <a href="index.html" title="previous chapter">cristallina</a></li>
|
||||
<li>Next: <a href="contributing.html" title="next chapter">TODO</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
|
|
||||
<a href="_sources/readme.rst.txt"
|
||||
rel="nofollow">Page source</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
127
docs/_build/html/search.html
vendored
Normal file
127
docs/_build/html/search.html
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Search — cristallina 0.0.post1.dev53+g9be81e9.d20230129 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
||||
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/sphinx_highlight.js"></script>
|
||||
<script src="_static/searchtools.js"></script>
|
||||
<script src="_static/language_data.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="#" />
|
||||
<script src="searchindex.js" defer></script>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
|
||||
</head><body>
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1 id="search-documentation">Search</h1>
|
||||
|
||||
<noscript>
|
||||
<div class="admonition warning">
|
||||
<p>
|
||||
Please activate JavaScript to enable the search
|
||||
functionality.
|
||||
</p>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
|
||||
<p>
|
||||
Searching for multiple words only shows matches that contain
|
||||
all words.
|
||||
</p>
|
||||
|
||||
|
||||
<form action="" method="get">
|
||||
<input type="text" name="q" aria-labelledby="search-documentation" value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="search" />
|
||||
<span id="search-progress" style="padding-left: 10px"></span>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<div id="search-results">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h1 class="logo"><a href="index.html">cristallina</a></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="readme.html">Overview</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html">TODO</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="contributing.html#contributing">Contributing</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">Module Reference</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="relations">
|
||||
<h3>Related Topics</h3>
|
||||
<ul>
|
||||
<li><a href="index.html">Documentation overview</a><ul>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
©2023, Alexander Steppke.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1
docs/_build/html/searchindex.js
vendored
Normal file
1
docs/_build/html/searchindex.js
vendored
Normal file
File diff suppressed because one or more lines are too long
61
docs/api/cristallina.rst
Normal file
61
docs/api/cristallina.rst
Normal file
@@ -0,0 +1,61 @@
|
||||
cristallina package
|
||||
===================
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
cristallina.SEA\_GraphClient module
|
||||
-----------------------------------
|
||||
|
||||
.. automodule:: cristallina.SEA_GraphClient
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
cristallina.analysis module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: cristallina.analysis
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
cristallina.config module
|
||||
-------------------------
|
||||
|
||||
.. automodule:: cristallina.config
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
cristallina.plot module
|
||||
-----------------------
|
||||
|
||||
.. automodule:: cristallina.plot
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
cristallina.skeleton module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: cristallina.skeleton
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
cristallina.utils module
|
||||
------------------------
|
||||
|
||||
.. automodule:: cristallina.utils
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: cristallina
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
7
docs/api/modules.rst
Normal file
7
docs/api/modules.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
cristallina
|
||||
===========
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
|
||||
cristallina
|
||||
Reference in New Issue
Block a user