A loose federation of distributed, typed datasets
1<!DOCTYPE html>
2<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
3
4<meta charset="utf-8">
5<meta name="generator" content="quarto-1.7.34">
6
7<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
8
9
10<title>atmosphereindex – atdata</title>
11<style>
12code{white-space: pre-wrap;}
13span.smallcaps{font-variant: small-caps;}
14div.columns{display: flex; gap: min(4vw, 1.5em);}
15div.column{flex: auto; overflow-x: auto;}
16div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
17ul.task-list{list-style: none;}
18ul.task-list li input[type="checkbox"] {
19 width: 0.8em;
20 margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
21 vertical-align: middle;
22}
23/* CSS for syntax highlighting */
24html { -webkit-text-size-adjust: 100%; }
25pre > code.sourceCode { white-space: pre; position: relative; }
26pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
27pre > code.sourceCode > span:empty { height: 1.2em; }
28.sourceCode { overflow: visible; }
29code.sourceCode > span { color: inherit; text-decoration: inherit; }
30div.sourceCode { margin: 1em 0; }
31pre.sourceCode { margin: 0; }
32@media screen {
33div.sourceCode { overflow: auto; }
34}
35@media print {
36pre > code.sourceCode { white-space: pre-wrap; }
37pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
38}
39pre.numberSource code
40 { counter-reset: source-line 0; }
41pre.numberSource code > span
42 { position: relative; left: -4em; counter-increment: source-line; }
43pre.numberSource code > span > a:first-child::before
44 { content: counter(source-line);
45 position: relative; left: -1em; text-align: right; vertical-align: baseline;
46 border: none; display: inline-block;
47 -webkit-touch-callout: none; -webkit-user-select: none;
48 -khtml-user-select: none; -moz-user-select: none;
49 -ms-user-select: none; user-select: none;
50 padding: 0 4px; width: 4em;
51 }
52pre.numberSource { margin-left: 3em; padding-left: 4px; }
53div.sourceCode
54 { }
55@media screen {
56pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
57}
58</style>
59
60
61<script src="../site_libs/quarto-nav/quarto-nav.js"></script>
62<script src="../site_libs/quarto-nav/headroom.min.js"></script>
63<script src="../site_libs/clipboard/clipboard.min.js"></script>
64<script src="../site_libs/quarto-search/autocomplete.umd.js"></script>
65<script src="../site_libs/quarto-search/fuse.min.js"></script>
66<script src="../site_libs/quarto-search/quarto-search.js"></script>
67<meta name="quarto:offset" content="../">
68<script src="../site_libs/quarto-html/quarto.js" type="module"></script>
69<script src="../site_libs/quarto-html/tabsets/tabsets.js" type="module"></script>
70<script src="../site_libs/quarto-html/popper.min.js"></script>
71<script src="../site_libs/quarto-html/tippy.umd.min.js"></script>
72<script src="../site_libs/quarto-html/anchor.min.js"></script>
73<link href="../site_libs/quarto-html/tippy.css" rel="stylesheet">
74<link href="../site_libs/quarto-html/quarto-syntax-highlighting-9582434199d49cc9e91654cdeeb4866b.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
75<link href="../site_libs/quarto-html/quarto-syntax-highlighting-dark-8dcd8563ea6803ab7cbb3d71ca5772e1.css" rel="stylesheet" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
76<link href="../site_libs/quarto-html/quarto-syntax-highlighting-9582434199d49cc9e91654cdeeb4866b.css" rel="stylesheet" class="quarto-color-scheme-extra" id="quarto-text-highlighting-styles">
77<script src="../site_libs/bootstrap/bootstrap.min.js"></script>
78<link href="../site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
79<link href="../site_libs/bootstrap/bootstrap-62bce24ca844314e7bb1a34dbdfe05cc.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
80<link href="../site_libs/bootstrap/bootstrap-dark-7964ffd8887b0991fe8d71c6c8bc75d6.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
81<link href="../site_libs/bootstrap/bootstrap-62bce24ca844314e7bb1a34dbdfe05cc.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme-extra" id="quarto-bootstrap" data-mode="light">
82<script id="quarto-search-options" type="application/json">{
83 "location": "navbar",
84 "copy-button": false,
85 "collapse-after": 3,
86 "panel-placement": "end",
87 "type": "overlay",
88 "limit": 50,
89 "keyboard-shortcut": [
90 "f",
91 "/",
92 "s"
93 ],
94 "show-item-context": false,
95 "language": {
96 "search-no-results-text": "No results",
97 "search-matching-documents-text": "matching documents",
98 "search-copy-link-title": "Copy link to search",
99 "search-hide-matches-text": "Hide additional matches",
100 "search-more-match-text": "more match in this document",
101 "search-more-matches-text": "more matches in this document",
102 "search-clear-button-title": "Clear",
103 "search-text-placeholder": "",
104 "search-detached-cancel-button-title": "Cancel",
105 "search-submit-button-title": "Submit",
106 "search-label": "Search"
107 }
108}</script>
109
110
111<link rel="stylesheet" href="../assets/styles.css">
112</head>
113
114<body class="nav-fixed quarto-light"><script id="quarto-html-before-body" type="application/javascript">
115 const toggleBodyColorMode = (bsSheetEl) => {
116 const mode = bsSheetEl.getAttribute("data-mode");
117 const bodyEl = window.document.querySelector("body");
118 if (mode === "dark") {
119 bodyEl.classList.add("quarto-dark");
120 bodyEl.classList.remove("quarto-light");
121 } else {
122 bodyEl.classList.add("quarto-light");
123 bodyEl.classList.remove("quarto-dark");
124 }
125 }
126 const toggleBodyColorPrimary = () => {
127 const bsSheetEl = window.document.querySelector("link#quarto-bootstrap:not([rel=disabled-stylesheet])");
128 if (bsSheetEl) {
129 toggleBodyColorMode(bsSheetEl);
130 }
131 }
132 const setColorSchemeToggle = (alternate) => {
133 const toggles = window.document.querySelectorAll('.quarto-color-scheme-toggle');
134 for (let i=0; i < toggles.length; i++) {
135 const toggle = toggles[i];
136 if (toggle) {
137 if (alternate) {
138 toggle.classList.add("alternate");
139 } else {
140 toggle.classList.remove("alternate");
141 }
142 }
143 }
144 };
145 const toggleColorMode = (alternate) => {
146 // Switch the stylesheets
147 const primaryStylesheets = window.document.querySelectorAll('link.quarto-color-scheme:not(.quarto-color-alternate)');
148 const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate');
149 manageTransitions('#quarto-margin-sidebar .nav-link', false);
150 if (alternate) {
151 // note: dark is layered on light, we don't disable primary!
152 enableStylesheet(alternateStylesheets);
153 for (const sheetNode of alternateStylesheets) {
154 if (sheetNode.id === "quarto-bootstrap") {
155 toggleBodyColorMode(sheetNode);
156 }
157 }
158 } else {
159 disableStylesheet(alternateStylesheets);
160 enableStylesheet(primaryStylesheets)
161 toggleBodyColorPrimary();
162 }
163 manageTransitions('#quarto-margin-sidebar .nav-link', true);
164 // Switch the toggles
165 setColorSchemeToggle(alternate)
166 // Hack to workaround the fact that safari doesn't
167 // properly recolor the scrollbar when toggling (#1455)
168 if (navigator.userAgent.indexOf('Safari') > 0 && navigator.userAgent.indexOf('Chrome') == -1) {
169 manageTransitions("body", false);
170 window.scrollTo(0, 1);
171 setTimeout(() => {
172 window.scrollTo(0, 0);
173 manageTransitions("body", true);
174 }, 40);
175 }
176 }
177 const disableStylesheet = (stylesheets) => {
178 for (let i=0; i < stylesheets.length; i++) {
179 const stylesheet = stylesheets[i];
180 stylesheet.rel = 'disabled-stylesheet';
181 }
182 }
183 const enableStylesheet = (stylesheets) => {
184 for (let i=0; i < stylesheets.length; i++) {
185 const stylesheet = stylesheets[i];
186 if(stylesheet.rel !== 'stylesheet') { // for Chrome, which will still FOUC without this check
187 stylesheet.rel = 'stylesheet';
188 }
189 }
190 }
191 const manageTransitions = (selector, allowTransitions) => {
192 const els = window.document.querySelectorAll(selector);
193 for (let i=0; i < els.length; i++) {
194 const el = els[i];
195 if (allowTransitions) {
196 el.classList.remove('notransition');
197 } else {
198 el.classList.add('notransition');
199 }
200 }
201 }
202 const isFileUrl = () => {
203 return window.location.protocol === 'file:';
204 }
205 const hasAlternateSentinel = () => {
206 let styleSentinel = getColorSchemeSentinel();
207 if (styleSentinel !== null) {
208 return styleSentinel === "alternate";
209 } else {
210 return false;
211 }
212 }
213 const setStyleSentinel = (alternate) => {
214 const value = alternate ? "alternate" : "default";
215 if (!isFileUrl()) {
216 window.localStorage.setItem("quarto-color-scheme", value);
217 } else {
218 localAlternateSentinel = value;
219 }
220 }
221 const getColorSchemeSentinel = () => {
222 if (!isFileUrl()) {
223 const storageValue = window.localStorage.getItem("quarto-color-scheme");
224 return storageValue != null ? storageValue : localAlternateSentinel;
225 } else {
226 return localAlternateSentinel;
227 }
228 }
229 const toggleGiscusIfUsed = (isAlternate, darkModeDefault) => {
230 const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light';
231 const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark';
232 let newTheme = '';
233 if(authorPrefersDark) {
234 newTheme = isAlternate ? baseTheme : alternateTheme;
235 } else {
236 newTheme = isAlternate ? alternateTheme : baseTheme;
237 }
238 const changeGiscusTheme = () => {
239 // From: https://github.com/giscus/giscus/issues/336
240 const sendMessage = (message) => {
241 const iframe = document.querySelector('iframe.giscus-frame');
242 if (!iframe) return;
243 iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
244 }
245 sendMessage({
246 setConfig: {
247 theme: newTheme
248 }
249 });
250 }
251 const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null;
252 if (isGiscussLoaded) {
253 changeGiscusTheme();
254 }
255 };
256 const authorPrefersDark = false;
257 const darkModeDefault = authorPrefersDark;
258 document.querySelector('link#quarto-text-highlighting-styles.quarto-color-scheme-extra').rel = 'disabled-stylesheet';
259 document.querySelector('link#quarto-bootstrap.quarto-color-scheme-extra').rel = 'disabled-stylesheet';
260 let localAlternateSentinel = darkModeDefault ? 'alternate' : 'default';
261 // Dark / light mode switch
262 window.quartoToggleColorScheme = () => {
263 // Read the current dark / light value
264 let toAlternate = !hasAlternateSentinel();
265 toggleColorMode(toAlternate);
266 setStyleSentinel(toAlternate);
267 toggleGiscusIfUsed(toAlternate, darkModeDefault);
268 window.dispatchEvent(new Event('resize'));
269 };
270 // Switch to dark mode if need be
271 if (hasAlternateSentinel()) {
272 toggleColorMode(true);
273 } else {
274 toggleColorMode(false);
275 }
276 </script>
277
278<div id="quarto-search-results"></div>
279 <header id="quarto-header" class="headroom fixed-top">
280 <nav class="navbar navbar-expand-lg " data-bs-theme="dark">
281 <div class="navbar-container container-fluid">
282 <div class="navbar-brand-container mx-auto">
283 <a class="navbar-brand" href="../index.html">
284 <span class="navbar-title">atdata</span>
285 </a>
286 </div>
287 <div id="quarto-search" class="" title="Search"></div>
288 <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" role="menu" aria-expanded="false" aria-label="Toggle navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
289 <span class="navbar-toggler-icon"></span>
290</button>
291 <div class="collapse navbar-collapse" id="navbarCollapse">
292 <ul class="navbar-nav navbar-nav-scroll me-auto">
293 <li class="nav-item">
294 <a class="nav-link" href="../index.html">
295<span class="menu-text">Guide</span></a>
296 </li>
297 <li class="nav-item dropdown ">
298 <a class="nav-link dropdown-toggle" href="#" id="nav-menu-tutorials" role="link" data-bs-toggle="dropdown" aria-expanded="false">
299 <span class="menu-text">Tutorials</span>
300 </a>
301 <ul class="dropdown-menu" aria-labelledby="nav-menu-tutorials">
302 <li>
303 <a class="dropdown-item" href="../tutorials/quickstart.html">
304 <span class="dropdown-text">Quick Start</span></a>
305 </li>
306 <li>
307 <a class="dropdown-item" href="../tutorials/local-workflow.html">
308 <span class="dropdown-text">Local Workflow</span></a>
309 </li>
310 <li>
311 <a class="dropdown-item" href="../tutorials/atmosphere.html">
312 <span class="dropdown-text">Atmosphere Publishing</span></a>
313 </li>
314 <li>
315 <a class="dropdown-item" href="../tutorials/promotion.html">
316 <span class="dropdown-text">Promotion Workflow</span></a>
317 </li>
318 </ul>
319 </li>
320 <li class="nav-item dropdown ">
321 <a class="nav-link dropdown-toggle" href="#" id="nav-menu-reference" role="link" data-bs-toggle="dropdown" aria-expanded="false">
322 <span class="menu-text">Reference</span>
323 </a>
324 <ul class="dropdown-menu" aria-labelledby="nav-menu-reference">
325 <li>
326 <a class="dropdown-item" href="../reference/architecture.html">
327 <span class="dropdown-text">Architecture Overview</span></a>
328 </li>
329 <li>
330 <a class="dropdown-item" href="../reference/packable-samples.html">
331 <span class="dropdown-text">Packable Samples</span></a>
332 </li>
333 <li>
334 <a class="dropdown-item" href="../reference/datasets.html">
335 <span class="dropdown-text">Datasets</span></a>
336 </li>
337 <li>
338 <a class="dropdown-item" href="../reference/lenses.html">
339 <span class="dropdown-text">Lenses</span></a>
340 </li>
341 <li>
342 <a class="dropdown-item" href="../reference/local-storage.html">
343 <span class="dropdown-text">Local Storage</span></a>
344 </li>
345 <li>
346 <a class="dropdown-item" href="../reference/atmosphere.html">
347 <span class="dropdown-text">Atmosphere</span></a>
348 </li>
349 <li>
350 <a class="dropdown-item" href="../reference/promotion.html">
351 <span class="dropdown-text">Promotion</span></a>
352 </li>
353 <li>
354 <a class="dropdown-item" href="../reference/load-dataset.html">
355 <span class="dropdown-text">load_dataset API</span></a>
356 </li>
357 <li>
358 <a class="dropdown-item" href="../reference/protocols.html">
359 <span class="dropdown-text">Protocols</span></a>
360 </li>
361 <li>
362 <a class="dropdown-item" href="../reference/uri-spec.html">
363 <span class="dropdown-text">URI Specification</span></a>
364 </li>
365 <li>
366 <a class="dropdown-item" href="../reference/troubleshooting.html">
367 <span class="dropdown-text">Troubleshooting & FAQ</span></a>
368 </li>
369 <li>
370 <a class="dropdown-item" href="../reference/deployment.html">
371 <span class="dropdown-text">Deployment Guide</span></a>
372 </li>
373 </ul>
374 </li>
375 <li class="nav-item">
376 <a class="nav-link" href="../api/index.html">
377<span class="menu-text">API</span></a>
378 </li>
379</ul>
380 <ul class="navbar-nav navbar-nav-scroll ms-auto">
381 <li class="nav-item compact">
382 <a class="nav-link" href="https://github.com/your-org/atdata"> <i class="bi bi-github" role="img">
383</i>
384<span class="menu-text"></span></a>
385 </li>
386</ul>
387 </div> <!-- /navcollapse -->
388 <div class="quarto-navbar-tools">
389 <a href="" class="quarto-color-scheme-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleColorScheme(); return false;" title="Toggle dark mode"><i class="bi"></i></a>
390</div>
391 </div> <!-- /container-fluid -->
392 </nav>
393</header>
394<!-- content -->
395<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article page-navbar">
396<!-- sidebar -->
397<!-- margin-sidebar -->
398 <div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
399 <nav id="TOC" role="doc-toc" class="toc-active">
400 <h2 id="toc-title">On this page</h2>
401
402 <ul>
403 <li><a href="#atdata.atmosphere.AtmosphereIndex" id="toc-atdata.atmosphere.AtmosphereIndex" class="nav-link active" data-scroll-target="#atdata.atmosphere.AtmosphereIndex">AtmosphereIndex</a>
404 <ul class="collapse">
405 <li><a href="#examples" id="toc-examples" class="nav-link" data-scroll-target="#examples">Examples</a></li>
406 <li><a href="#attributes" id="toc-attributes" class="nav-link" data-scroll-target="#attributes">Attributes</a></li>
407 <li><a href="#methods" id="toc-methods" class="nav-link" data-scroll-target="#methods">Methods</a>
408 <ul class="collapse">
409 <li><a href="#atdata.atmosphere.AtmosphereIndex.decode_schema" id="toc-atdata.atmosphere.AtmosphereIndex.decode_schema" class="nav-link" data-scroll-target="#atdata.atmosphere.AtmosphereIndex.decode_schema">decode_schema</a></li>
410 <li><a href="#atdata.atmosphere.AtmosphereIndex.get_dataset" id="toc-atdata.atmosphere.AtmosphereIndex.get_dataset" class="nav-link" data-scroll-target="#atdata.atmosphere.AtmosphereIndex.get_dataset">get_dataset</a></li>
411 <li><a href="#atdata.atmosphere.AtmosphereIndex.get_schema" id="toc-atdata.atmosphere.AtmosphereIndex.get_schema" class="nav-link" data-scroll-target="#atdata.atmosphere.AtmosphereIndex.get_schema">get_schema</a></li>
412 <li><a href="#atdata.atmosphere.AtmosphereIndex.insert_dataset" id="toc-atdata.atmosphere.AtmosphereIndex.insert_dataset" class="nav-link" data-scroll-target="#atdata.atmosphere.AtmosphereIndex.insert_dataset">insert_dataset</a></li>
413 <li><a href="#atdata.atmosphere.AtmosphereIndex.list_datasets" id="toc-atdata.atmosphere.AtmosphereIndex.list_datasets" class="nav-link" data-scroll-target="#atdata.atmosphere.AtmosphereIndex.list_datasets">list_datasets</a></li>
414 <li><a href="#atdata.atmosphere.AtmosphereIndex.list_schemas" id="toc-atdata.atmosphere.AtmosphereIndex.list_schemas" class="nav-link" data-scroll-target="#atdata.atmosphere.AtmosphereIndex.list_schemas">list_schemas</a></li>
415 <li><a href="#atdata.atmosphere.AtmosphereIndex.publish_schema" id="toc-atdata.atmosphere.AtmosphereIndex.publish_schema" class="nav-link" data-scroll-target="#atdata.atmosphere.AtmosphereIndex.publish_schema">publish_schema</a></li>
416 </ul></li>
417 </ul></li>
418 </ul>
419<div class="toc-actions"><ul><li><a href="https://github.com/your-org/atdata/edit/main/api/AtmosphereIndex.qmd" class="toc-action"><i class="bi bi-github"></i>Edit this page</a></li><li><a href="https://github.com/your-org/atdata/issues/new" class="toc-action"><i class="bi empty"></i>Report an issue</a></li></ul></div></nav>
420 </div>
421<!-- main -->
422<main class="content" id="quarto-document-content"><header id="title-block-header" class="quarto-title-block"></header>
423
424
425
426
427
428<section id="atdata.atmosphere.AtmosphereIndex" class="level1">
429<h1>AtmosphereIndex</h1>
430<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>atmosphere.AtmosphereIndex(client, <span class="op">*</span>, data_store<span class="op">=</span><span class="va">None</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
431<p>ATProto index implementing AbstractIndex protocol.</p>
432<p>Wraps SchemaPublisher/Loader and DatasetPublisher/Loader to provide a unified interface compatible with LocalIndex.</p>
433<p>Optionally accepts a <code>PDSBlobStore</code> for writing dataset shards as ATProto blobs, enabling fully decentralized dataset storage.</p>
434<section id="examples" class="level2 doc-section doc-section-examples">
435<h2 class="doc-section doc-section-examples anchored" data-anchor-id="examples">Examples</h2>
436<div class="sourceCode" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="op">>>></span> client <span class="op">=</span> AtmosphereClient()</span>
437<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="op">>>></span> client.login(<span class="st">"handle.bsky.social"</span>, <span class="st">"app-password"</span>)</span>
438<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="op">>>></span></span>
439<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="op">>>></span> <span class="co"># Without blob storage (external URLs only)</span></span>
440<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="op">>>></span> index <span class="op">=</span> AtmosphereIndex(client)</span>
441<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a><span class="op">>>></span></span>
442<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="op">>>></span> <span class="co"># With PDS blob storage</span></span>
443<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a><span class="op">>>></span> store <span class="op">=</span> PDSBlobStore(client)</span>
444<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a><span class="op">>>></span> index <span class="op">=</span> AtmosphereIndex(client, data_store<span class="op">=</span>store)</span>
445<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a><span class="op">>>></span> entry <span class="op">=</span> index.insert_dataset(dataset, name<span class="op">=</span><span class="st">"my-data"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
446</section>
447<section id="attributes" class="level2">
448<h2 class="anchored" data-anchor-id="attributes">Attributes</h2>
449<table class="caption-top table">
450<thead>
451<tr class="header">
452<th>Name</th>
453<th>Description</th>
454</tr>
455</thead>
456<tbody>
457<tr class="odd">
458<td><a href="#atdata.atmosphere.AtmosphereIndex.data_store">data_store</a></td>
459<td>The PDS blob store for writing shards, or None if not configured.</td>
460</tr>
461<tr class="even">
462<td><a href="#atdata.atmosphere.AtmosphereIndex.datasets">datasets</a></td>
463<td>Lazily iterate over all dataset entries (AbstractIndex protocol).</td>
464</tr>
465<tr class="odd">
466<td><a href="#atdata.atmosphere.AtmosphereIndex.schemas">schemas</a></td>
467<td>Lazily iterate over all schema records (AbstractIndex protocol).</td>
468</tr>
469</tbody>
470</table>
471</section>
472<section id="methods" class="level2">
473<h2 class="anchored" data-anchor-id="methods">Methods</h2>
474<table class="caption-top table">
475<thead>
476<tr class="header">
477<th>Name</th>
478<th>Description</th>
479</tr>
480</thead>
481<tbody>
482<tr class="odd">
483<td><a href="#atdata.atmosphere.AtmosphereIndex.decode_schema">decode_schema</a></td>
484<td>Reconstruct a Python type from a schema record.</td>
485</tr>
486<tr class="even">
487<td><a href="#atdata.atmosphere.AtmosphereIndex.get_dataset">get_dataset</a></td>
488<td>Get a dataset by AT URI.</td>
489</tr>
490<tr class="odd">
491<td><a href="#atdata.atmosphere.AtmosphereIndex.get_schema">get_schema</a></td>
492<td>Get a schema record by AT URI.</td>
493</tr>
494<tr class="even">
495<td><a href="#atdata.atmosphere.AtmosphereIndex.insert_dataset">insert_dataset</a></td>
496<td>Insert a dataset into ATProto.</td>
497</tr>
498<tr class="odd">
499<td><a href="#atdata.atmosphere.AtmosphereIndex.list_datasets">list_datasets</a></td>
500<td>Get all dataset entries as a materialized list (AbstractIndex protocol).</td>
501</tr>
502<tr class="even">
503<td><a href="#atdata.atmosphere.AtmosphereIndex.list_schemas">list_schemas</a></td>
504<td>Get all schema records as a materialized list (AbstractIndex protocol).</td>
505</tr>
506<tr class="odd">
507<td><a href="#atdata.atmosphere.AtmosphereIndex.publish_schema">publish_schema</a></td>
508<td>Publish a schema to ATProto.</td>
509</tr>
510</tbody>
511</table>
512<section id="atdata.atmosphere.AtmosphereIndex.decode_schema" class="level3">
513<h3 class="anchored" data-anchor-id="atdata.atmosphere.AtmosphereIndex.decode_schema">decode_schema</h3>
514<div class="sourceCode" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>atmosphere.AtmosphereIndex.decode_schema(ref)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
515<p>Reconstruct a Python type from a schema record.</p>
516<section id="parameters" class="level4 doc-section doc-section-parameters">
517<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters">Parameters</h4>
518<table class="caption-top table">
519<thead>
520<tr class="header">
521<th>Name</th>
522<th>Type</th>
523<th>Description</th>
524<th>Default</th>
525</tr>
526</thead>
527<tbody>
528<tr class="odd">
529<td>ref</td>
530<td><a href="`str`">str</a></td>
531<td>AT URI of the schema record.</td>
532<td><em>required</em></td>
533</tr>
534</tbody>
535</table>
536</section>
537<section id="returns" class="level4 doc-section doc-section-returns">
538<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns">Returns</h4>
539<table class="caption-top table">
540<thead>
541<tr class="header">
542<th>Name</th>
543<th>Type</th>
544<th>Description</th>
545</tr>
546</thead>
547<tbody>
548<tr class="odd">
549<td></td>
550<td><a href="`typing.Type`">Type</a>[<a href="`atdata._protocols.Packable`">Packable</a>]</td>
551<td>Dynamically generated Packable type.</td>
552</tr>
553</tbody>
554</table>
555</section>
556<section id="raises" class="level4 doc-section doc-section-raises">
557<h4 class="doc-section doc-section-raises anchored" data-anchor-id="raises">Raises</h4>
558<table class="caption-top table">
559<thead>
560<tr class="header">
561<th>Name</th>
562<th>Type</th>
563<th>Description</th>
564</tr>
565</thead>
566<tbody>
567<tr class="odd">
568<td></td>
569<td><a href="`ValueError`">ValueError</a></td>
570<td>If schema cannot be decoded.</td>
571</tr>
572</tbody>
573</table>
574</section>
575</section>
576<section id="atdata.atmosphere.AtmosphereIndex.get_dataset" class="level3">
577<h3 class="anchored" data-anchor-id="atdata.atmosphere.AtmosphereIndex.get_dataset">get_dataset</h3>
578<div class="sourceCode" id="cb4"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>atmosphere.AtmosphereIndex.get_dataset(ref)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
579<p>Get a dataset by AT URI.</p>
580<section id="parameters-1" class="level4 doc-section doc-section-parameters">
581<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-1">Parameters</h4>
582<table class="caption-top table">
583<thead>
584<tr class="header">
585<th>Name</th>
586<th>Type</th>
587<th>Description</th>
588<th>Default</th>
589</tr>
590</thead>
591<tbody>
592<tr class="odd">
593<td>ref</td>
594<td><a href="`str`">str</a></td>
595<td>AT URI of the dataset record.</td>
596<td><em>required</em></td>
597</tr>
598</tbody>
599</table>
600</section>
601<section id="returns-1" class="level4 doc-section doc-section-returns">
602<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-1">Returns</h4>
603<table class="caption-top table">
604<thead>
605<tr class="header">
606<th>Name</th>
607<th>Type</th>
608<th>Description</th>
609</tr>
610</thead>
611<tbody>
612<tr class="odd">
613<td></td>
614<td><a href="`atdata.atmosphere.AtmosphereIndexEntry`">AtmosphereIndexEntry</a></td>
615<td>AtmosphereIndexEntry for the dataset.</td>
616</tr>
617</tbody>
618</table>
619</section>
620<section id="raises-1" class="level4 doc-section doc-section-raises">
621<h4 class="doc-section doc-section-raises anchored" data-anchor-id="raises-1">Raises</h4>
622<table class="caption-top table">
623<thead>
624<tr class="header">
625<th>Name</th>
626<th>Type</th>
627<th>Description</th>
628</tr>
629</thead>
630<tbody>
631<tr class="odd">
632<td></td>
633<td><a href="`ValueError`">ValueError</a></td>
634<td>If record is not a dataset.</td>
635</tr>
636</tbody>
637</table>
638</section>
639</section>
640<section id="atdata.atmosphere.AtmosphereIndex.get_schema" class="level3">
641<h3 class="anchored" data-anchor-id="atdata.atmosphere.AtmosphereIndex.get_schema">get_schema</h3>
642<div class="sourceCode" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>atmosphere.AtmosphereIndex.get_schema(ref)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
643<p>Get a schema record by AT URI.</p>
644<section id="parameters-2" class="level4 doc-section doc-section-parameters">
645<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-2">Parameters</h4>
646<table class="caption-top table">
647<thead>
648<tr class="header">
649<th>Name</th>
650<th>Type</th>
651<th>Description</th>
652<th>Default</th>
653</tr>
654</thead>
655<tbody>
656<tr class="odd">
657<td>ref</td>
658<td><a href="`str`">str</a></td>
659<td>AT URI of the schema record.</td>
660<td><em>required</em></td>
661</tr>
662</tbody>
663</table>
664</section>
665<section id="returns-2" class="level4 doc-section doc-section-returns">
666<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-2">Returns</h4>
667<table class="caption-top table">
668<thead>
669<tr class="header">
670<th>Name</th>
671<th>Type</th>
672<th>Description</th>
673</tr>
674</thead>
675<tbody>
676<tr class="odd">
677<td></td>
678<td><a href="`dict`">dict</a></td>
679<td>Schema record dictionary.</td>
680</tr>
681</tbody>
682</table>
683</section>
684<section id="raises-2" class="level4 doc-section doc-section-raises">
685<h4 class="doc-section doc-section-raises anchored" data-anchor-id="raises-2">Raises</h4>
686<table class="caption-top table">
687<thead>
688<tr class="header">
689<th>Name</th>
690<th>Type</th>
691<th>Description</th>
692</tr>
693</thead>
694<tbody>
695<tr class="odd">
696<td></td>
697<td><a href="`ValueError`">ValueError</a></td>
698<td>If record is not a schema.</td>
699</tr>
700</tbody>
701</table>
702</section>
703</section>
704<section id="atdata.atmosphere.AtmosphereIndex.insert_dataset" class="level3">
705<h3 class="anchored" data-anchor-id="atdata.atmosphere.AtmosphereIndex.insert_dataset">insert_dataset</h3>
706<div class="sourceCode" id="cb6"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>atmosphere.AtmosphereIndex.insert_dataset(</span>
707<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> ds,</span>
708<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="op">*</span>,</span>
709<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> name,</span>
710<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> schema_ref<span class="op">=</span><span class="va">None</span>,</span>
711<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a> <span class="op">**</span>kwargs,</span>
712<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
713<p>Insert a dataset into ATProto.</p>
714<section id="parameters-3" class="level4 doc-section doc-section-parameters">
715<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-3">Parameters</h4>
716<table class="caption-top table">
717<thead>
718<tr class="header">
719<th>Name</th>
720<th>Type</th>
721<th>Description</th>
722<th>Default</th>
723</tr>
724</thead>
725<tbody>
726<tr class="odd">
727<td>ds</td>
728<td><a href="`atdata.dataset.Dataset`">Dataset</a></td>
729<td>The Dataset to publish.</td>
730<td><em>required</em></td>
731</tr>
732<tr class="even">
733<td>name</td>
734<td><a href="`str`">str</a></td>
735<td>Human-readable name.</td>
736<td><em>required</em></td>
737</tr>
738<tr class="odd">
739<td>schema_ref</td>
740<td><a href="`typing.Optional`">Optional</a>[<a href="`str`">str</a>]</td>
741<td>Optional schema AT URI. If None, auto-publishes schema.</td>
742<td><code>None</code></td>
743</tr>
744<tr class="even">
745<td>**kwargs</td>
746<td></td>
747<td>Additional options (description, tags, license).</td>
748<td><code>{}</code></td>
749</tr>
750</tbody>
751</table>
752</section>
753<section id="returns-3" class="level4 doc-section doc-section-returns">
754<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-3">Returns</h4>
755<table class="caption-top table">
756<thead>
757<tr class="header">
758<th>Name</th>
759<th>Type</th>
760<th>Description</th>
761</tr>
762</thead>
763<tbody>
764<tr class="odd">
765<td></td>
766<td><a href="`atdata.atmosphere.AtmosphereIndexEntry`">AtmosphereIndexEntry</a></td>
767<td>AtmosphereIndexEntry for the inserted dataset.</td>
768</tr>
769</tbody>
770</table>
771</section>
772</section>
773<section id="atdata.atmosphere.AtmosphereIndex.list_datasets" class="level3">
774<h3 class="anchored" data-anchor-id="atdata.atmosphere.AtmosphereIndex.list_datasets">list_datasets</h3>
775<div class="sourceCode" id="cb7"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>atmosphere.AtmosphereIndex.list_datasets(repo<span class="op">=</span><span class="va">None</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
776<p>Get all dataset entries as a materialized list (AbstractIndex protocol).</p>
777<section id="parameters-4" class="level4 doc-section doc-section-parameters">
778<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-4">Parameters</h4>
779<table class="caption-top table">
780<thead>
781<tr class="header">
782<th>Name</th>
783<th>Type</th>
784<th>Description</th>
785<th>Default</th>
786</tr>
787</thead>
788<tbody>
789<tr class="odd">
790<td>repo</td>
791<td><a href="`typing.Optional`">Optional</a>[<a href="`str`">str</a>]</td>
792<td>DID of repository. Defaults to authenticated user.</td>
793<td><code>None</code></td>
794</tr>
795</tbody>
796</table>
797</section>
798<section id="returns-4" class="level4 doc-section doc-section-returns">
799<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-4">Returns</h4>
800<table class="caption-top table">
801<thead>
802<tr class="header">
803<th>Name</th>
804<th>Type</th>
805<th>Description</th>
806</tr>
807</thead>
808<tbody>
809<tr class="odd">
810<td></td>
811<td><a href="`list`">list</a>[<a href="`atdata.atmosphere.AtmosphereIndexEntry`">AtmosphereIndexEntry</a>]</td>
812<td>List of AtmosphereIndexEntry for each dataset.</td>
813</tr>
814</tbody>
815</table>
816</section>
817</section>
818<section id="atdata.atmosphere.AtmosphereIndex.list_schemas" class="level3">
819<h3 class="anchored" data-anchor-id="atdata.atmosphere.AtmosphereIndex.list_schemas">list_schemas</h3>
820<div class="sourceCode" id="cb8"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>atmosphere.AtmosphereIndex.list_schemas(repo<span class="op">=</span><span class="va">None</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
821<p>Get all schema records as a materialized list (AbstractIndex protocol).</p>
822<section id="parameters-5" class="level4 doc-section doc-section-parameters">
823<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-5">Parameters</h4>
824<table class="caption-top table">
825<thead>
826<tr class="header">
827<th>Name</th>
828<th>Type</th>
829<th>Description</th>
830<th>Default</th>
831</tr>
832</thead>
833<tbody>
834<tr class="odd">
835<td>repo</td>
836<td><a href="`typing.Optional`">Optional</a>[<a href="`str`">str</a>]</td>
837<td>DID of repository. Defaults to authenticated user.</td>
838<td><code>None</code></td>
839</tr>
840</tbody>
841</table>
842</section>
843<section id="returns-5" class="level4 doc-section doc-section-returns">
844<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-5">Returns</h4>
845<table class="caption-top table">
846<thead>
847<tr class="header">
848<th>Name</th>
849<th>Type</th>
850<th>Description</th>
851</tr>
852</thead>
853<tbody>
854<tr class="odd">
855<td></td>
856<td><a href="`list`">list</a>[<a href="`dict`">dict</a>]</td>
857<td>List of schema records as dictionaries.</td>
858</tr>
859</tbody>
860</table>
861</section>
862</section>
863<section id="atdata.atmosphere.AtmosphereIndex.publish_schema" class="level3">
864<h3 class="anchored" data-anchor-id="atdata.atmosphere.AtmosphereIndex.publish_schema">publish_schema</h3>
865<div class="sourceCode" id="cb9"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>atmosphere.AtmosphereIndex.publish_schema(</span>
866<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> sample_type,</span>
867<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a> <span class="op">*</span>,</span>
868<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a> version<span class="op">=</span><span class="st">'1.0.0'</span>,</span>
869<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a> <span class="op">**</span>kwargs,</span>
870<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
871<p>Publish a schema to ATProto.</p>
872<section id="parameters-6" class="level4 doc-section doc-section-parameters">
873<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-6">Parameters</h4>
874<table class="caption-top table">
875<thead>
876<tr class="header">
877<th>Name</th>
878<th>Type</th>
879<th>Description</th>
880<th>Default</th>
881</tr>
882</thead>
883<tbody>
884<tr class="odd">
885<td>sample_type</td>
886<td><a href="`typing.Type`">Type</a>[<a href="`atdata._protocols.Packable`">Packable</a>]</td>
887<td>A Packable type (PackableSample subclass or <span class="citation" data-cites="packable-decorated">@packable-decorated</span>).</td>
888<td><em>required</em></td>
889</tr>
890<tr class="even">
891<td>version</td>
892<td><a href="`str`">str</a></td>
893<td>Semantic version string.</td>
894<td><code>'1.0.0'</code></td>
895</tr>
896<tr class="odd">
897<td>**kwargs</td>
898<td></td>
899<td>Additional options (description, metadata).</td>
900<td><code>{}</code></td>
901</tr>
902</tbody>
903</table>
904</section>
905<section id="returns-6" class="level4 doc-section doc-section-returns">
906<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-6">Returns</h4>
907<table class="caption-top table">
908<thead>
909<tr class="header">
910<th>Name</th>
911<th>Type</th>
912<th>Description</th>
913</tr>
914</thead>
915<tbody>
916<tr class="odd">
917<td></td>
918<td><a href="`str`">str</a></td>
919<td>AT URI of the schema record.</td>
920</tr>
921</tbody>
922</table>
923
924
925</section>
926</section>
927</section>
928</section>
929
930</main> <!-- /main -->
931<script id="quarto-html-after-body" type="application/javascript">
932 window.document.addEventListener("DOMContentLoaded", function (event) {
933 // Ensure there is a toggle, if there isn't float one in the top right
934 if (window.document.querySelector('.quarto-color-scheme-toggle') === null) {
935 const a = window.document.createElement('a');
936 a.classList.add('top-right');
937 a.classList.add('quarto-color-scheme-toggle');
938 a.href = "";
939 a.onclick = function() { try { window.quartoToggleColorScheme(); } catch {} return false; };
940 const i = window.document.createElement("i");
941 i.classList.add('bi');
942 a.appendChild(i);
943 window.document.body.appendChild(a);
944 }
945 setColorSchemeToggle(hasAlternateSentinel())
946 const icon = "";
947 const anchorJS = new window.AnchorJS();
948 anchorJS.options = {
949 placement: 'right',
950 icon: icon
951 };
952 anchorJS.add('.anchored');
953 const isCodeAnnotation = (el) => {
954 for (const clz of el.classList) {
955 if (clz.startsWith('code-annotation-')) {
956 return true;
957 }
958 }
959 return false;
960 }
961 const onCopySuccess = function(e) {
962 // button target
963 const button = e.trigger;
964 // don't keep focus
965 button.blur();
966 // flash "checked"
967 button.classList.add('code-copy-button-checked');
968 var currentTitle = button.getAttribute("title");
969 button.setAttribute("title", "Copied!");
970 let tooltip;
971 if (window.bootstrap) {
972 button.setAttribute("data-bs-toggle", "tooltip");
973 button.setAttribute("data-bs-placement", "left");
974 button.setAttribute("data-bs-title", "Copied!");
975 tooltip = new bootstrap.Tooltip(button,
976 { trigger: "manual",
977 customClass: "code-copy-button-tooltip",
978 offset: [0, -8]});
979 tooltip.show();
980 }
981 setTimeout(function() {
982 if (tooltip) {
983 tooltip.hide();
984 button.removeAttribute("data-bs-title");
985 button.removeAttribute("data-bs-toggle");
986 button.removeAttribute("data-bs-placement");
987 }
988 button.setAttribute("title", currentTitle);
989 button.classList.remove('code-copy-button-checked');
990 }, 1000);
991 // clear code selection
992 e.clearSelection();
993 }
994 const getTextToCopy = function(trigger) {
995 const codeEl = trigger.previousElementSibling.cloneNode(true);
996 for (const childEl of codeEl.children) {
997 if (isCodeAnnotation(childEl)) {
998 childEl.remove();
999 }
1000 }
1001 return codeEl.innerText;
1002 }
1003 const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
1004 text: getTextToCopy
1005 });
1006 clipboard.on('success', onCopySuccess);
1007 if (window.document.getElementById('quarto-embedded-source-code-modal')) {
1008 const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
1009 text: getTextToCopy,
1010 container: window.document.getElementById('quarto-embedded-source-code-modal')
1011 });
1012 clipboardModal.on('success', onCopySuccess);
1013 }
1014 var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
1015 var mailtoRegex = new RegExp(/^mailto:/);
1016 var filterRegex = new RegExp("https:\/\/github\.com\/your-org\/atdata");
1017 var isInternal = (href) => {
1018 return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
1019 }
1020 // Inspect non-navigation links and adorn them if external
1021 var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
1022 for (var i=0; i<links.length; i++) {
1023 const link = links[i];
1024 if (!isInternal(link.href)) {
1025 // undo the damage that might have been done by quarto-nav.js in the case of
1026 // links that we want to consider external
1027 if (link.dataset.originalHref !== undefined) {
1028 link.href = link.dataset.originalHref;
1029 }
1030 }
1031 }
1032 function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
1033 const config = {
1034 allowHTML: true,
1035 maxWidth: 500,
1036 delay: 100,
1037 arrow: false,
1038 appendTo: function(el) {
1039 return el.parentElement;
1040 },
1041 interactive: true,
1042 interactiveBorder: 10,
1043 theme: 'quarto',
1044 placement: 'bottom-start',
1045 };
1046 if (contentFn) {
1047 config.content = contentFn;
1048 }
1049 if (onTriggerFn) {
1050 config.onTrigger = onTriggerFn;
1051 }
1052 if (onUntriggerFn) {
1053 config.onUntrigger = onUntriggerFn;
1054 }
1055 window.tippy(el, config);
1056 }
1057 const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
1058 for (var i=0; i<noterefs.length; i++) {
1059 const ref = noterefs[i];
1060 tippyHover(ref, function() {
1061 // use id or data attribute instead here
1062 let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
1063 try { href = new URL(href).hash; } catch {}
1064 const id = href.replace(/^#\/?/, "");
1065 const note = window.document.getElementById(id);
1066 if (note) {
1067 return note.innerHTML;
1068 } else {
1069 return "";
1070 }
1071 });
1072 }
1073 const xrefs = window.document.querySelectorAll('a.quarto-xref');
1074 const processXRef = (id, note) => {
1075 // Strip column container classes
1076 const stripColumnClz = (el) => {
1077 el.classList.remove("page-full", "page-columns");
1078 if (el.children) {
1079 for (const child of el.children) {
1080 stripColumnClz(child);
1081 }
1082 }
1083 }
1084 stripColumnClz(note)
1085 if (id === null || id.startsWith('sec-')) {
1086 // Special case sections, only their first couple elements
1087 const container = document.createElement("div");
1088 if (note.children && note.children.length > 2) {
1089 container.appendChild(note.children[0].cloneNode(true));
1090 for (let i = 1; i < note.children.length; i++) {
1091 const child = note.children[i];
1092 if (child.tagName === "P" && child.innerText === "") {
1093 continue;
1094 } else {
1095 container.appendChild(child.cloneNode(true));
1096 break;
1097 }
1098 }
1099 if (window.Quarto?.typesetMath) {
1100 window.Quarto.typesetMath(container);
1101 }
1102 return container.innerHTML
1103 } else {
1104 if (window.Quarto?.typesetMath) {
1105 window.Quarto.typesetMath(note);
1106 }
1107 return note.innerHTML;
1108 }
1109 } else {
1110 // Remove any anchor links if they are present
1111 const anchorLink = note.querySelector('a.anchorjs-link');
1112 if (anchorLink) {
1113 anchorLink.remove();
1114 }
1115 if (window.Quarto?.typesetMath) {
1116 window.Quarto.typesetMath(note);
1117 }
1118 if (note.classList.contains("callout")) {
1119 return note.outerHTML;
1120 } else {
1121 return note.innerHTML;
1122 }
1123 }
1124 }
1125 for (var i=0; i<xrefs.length; i++) {
1126 const xref = xrefs[i];
1127 tippyHover(xref, undefined, function(instance) {
1128 instance.disable();
1129 let url = xref.getAttribute('href');
1130 let hash = undefined;
1131 if (url.startsWith('#')) {
1132 hash = url;
1133 } else {
1134 try { hash = new URL(url).hash; } catch {}
1135 }
1136 if (hash) {
1137 const id = hash.replace(/^#\/?/, "");
1138 const note = window.document.getElementById(id);
1139 if (note !== null) {
1140 try {
1141 const html = processXRef(id, note.cloneNode(true));
1142 instance.setContent(html);
1143 } finally {
1144 instance.enable();
1145 instance.show();
1146 }
1147 } else {
1148 // See if we can fetch this
1149 fetch(url.split('#')[0])
1150 .then(res => res.text())
1151 .then(html => {
1152 const parser = new DOMParser();
1153 const htmlDoc = parser.parseFromString(html, "text/html");
1154 const note = htmlDoc.getElementById(id);
1155 if (note !== null) {
1156 const html = processXRef(id, note);
1157 instance.setContent(html);
1158 }
1159 }).finally(() => {
1160 instance.enable();
1161 instance.show();
1162 });
1163 }
1164 } else {
1165 // See if we can fetch a full url (with no hash to target)
1166 // This is a special case and we should probably do some content thinning / targeting
1167 fetch(url)
1168 .then(res => res.text())
1169 .then(html => {
1170 const parser = new DOMParser();
1171 const htmlDoc = parser.parseFromString(html, "text/html");
1172 const note = htmlDoc.querySelector('main.content');
1173 if (note !== null) {
1174 // This should only happen for chapter cross references
1175 // (since there is no id in the URL)
1176 // remove the first header
1177 if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
1178 note.children[0].remove();
1179 }
1180 const html = processXRef(null, note);
1181 instance.setContent(html);
1182 }
1183 }).finally(() => {
1184 instance.enable();
1185 instance.show();
1186 });
1187 }
1188 }, function(instance) {
1189 });
1190 }
1191 let selectedAnnoteEl;
1192 const selectorForAnnotation = ( cell, annotation) => {
1193 let cellAttr = 'data-code-cell="' + cell + '"';
1194 let lineAttr = 'data-code-annotation="' + annotation + '"';
1195 const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
1196 return selector;
1197 }
1198 const selectCodeLines = (annoteEl) => {
1199 const doc = window.document;
1200 const targetCell = annoteEl.getAttribute("data-target-cell");
1201 const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
1202 const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
1203 const lines = annoteSpan.getAttribute("data-code-lines").split(",");
1204 const lineIds = lines.map((line) => {
1205 return targetCell + "-" + line;
1206 })
1207 let top = null;
1208 let height = null;
1209 let parent = null;
1210 if (lineIds.length > 0) {
1211 //compute the position of the single el (top and bottom and make a div)
1212 const el = window.document.getElementById(lineIds[0]);
1213 top = el.offsetTop;
1214 height = el.offsetHeight;
1215 parent = el.parentElement.parentElement;
1216 if (lineIds.length > 1) {
1217 const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
1218 const bottom = lastEl.offsetTop + lastEl.offsetHeight;
1219 height = bottom - top;
1220 }
1221 if (top !== null && height !== null && parent !== null) {
1222 // cook up a div (if necessary) and position it
1223 let div = window.document.getElementById("code-annotation-line-highlight");
1224 if (div === null) {
1225 div = window.document.createElement("div");
1226 div.setAttribute("id", "code-annotation-line-highlight");
1227 div.style.position = 'absolute';
1228 parent.appendChild(div);
1229 }
1230 div.style.top = top - 2 + "px";
1231 div.style.height = height + 4 + "px";
1232 div.style.left = 0;
1233 let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
1234 if (gutterDiv === null) {
1235 gutterDiv = window.document.createElement("div");
1236 gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
1237 gutterDiv.style.position = 'absolute';
1238 const codeCell = window.document.getElementById(targetCell);
1239 const gutter = codeCell.querySelector('.code-annotation-gutter');
1240 gutter.appendChild(gutterDiv);
1241 }
1242 gutterDiv.style.top = top - 2 + "px";
1243 gutterDiv.style.height = height + 4 + "px";
1244 }
1245 selectedAnnoteEl = annoteEl;
1246 }
1247 };
1248 const unselectCodeLines = () => {
1249 const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
1250 elementsIds.forEach((elId) => {
1251 const div = window.document.getElementById(elId);
1252 if (div) {
1253 div.remove();
1254 }
1255 });
1256 selectedAnnoteEl = undefined;
1257 };
1258 // Handle positioning of the toggle
1259 window.addEventListener(
1260 "resize",
1261 throttle(() => {
1262 elRect = undefined;
1263 if (selectedAnnoteEl) {
1264 selectCodeLines(selectedAnnoteEl);
1265 }
1266 }, 10)
1267 );
1268 function throttle(fn, ms) {
1269 let throttle = false;
1270 let timer;
1271 return (...args) => {
1272 if(!throttle) { // first call gets through
1273 fn.apply(this, args);
1274 throttle = true;
1275 } else { // all the others get throttled
1276 if(timer) clearTimeout(timer); // cancel #2
1277 timer = setTimeout(() => {
1278 fn.apply(this, args);
1279 timer = throttle = false;
1280 }, ms);
1281 }
1282 };
1283 }
1284 // Attach click handler to the DT
1285 const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
1286 for (const annoteDlNode of annoteDls) {
1287 annoteDlNode.addEventListener('click', (event) => {
1288 const clickedEl = event.target;
1289 if (clickedEl !== selectedAnnoteEl) {
1290 unselectCodeLines();
1291 const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
1292 if (activeEl) {
1293 activeEl.classList.remove('code-annotation-active');
1294 }
1295 selectCodeLines(clickedEl);
1296 clickedEl.classList.add('code-annotation-active');
1297 } else {
1298 // Unselect the line
1299 unselectCodeLines();
1300 clickedEl.classList.remove('code-annotation-active');
1301 }
1302 });
1303 }
1304 const findCites = (el) => {
1305 const parentEl = el.parentElement;
1306 if (parentEl) {
1307 const cites = parentEl.dataset.cites;
1308 if (cites) {
1309 return {
1310 el,
1311 cites: cites.split(' ')
1312 };
1313 } else {
1314 return findCites(el.parentElement)
1315 }
1316 } else {
1317 return undefined;
1318 }
1319 };
1320 var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
1321 for (var i=0; i<bibliorefs.length; i++) {
1322 const ref = bibliorefs[i];
1323 const citeInfo = findCites(ref);
1324 if (citeInfo) {
1325 tippyHover(citeInfo.el, function() {
1326 var popup = window.document.createElement('div');
1327 citeInfo.cites.forEach(function(cite) {
1328 var citeDiv = window.document.createElement('div');
1329 citeDiv.classList.add('hanging-indent');
1330 citeDiv.classList.add('csl-entry');
1331 var biblioDiv = window.document.getElementById('ref-' + cite);
1332 if (biblioDiv) {
1333 citeDiv.innerHTML = biblioDiv.innerHTML;
1334 }
1335 popup.appendChild(citeDiv);
1336 });
1337 return popup.innerHTML;
1338 });
1339 }
1340 }
1341 });
1342 </script>
1343</div> <!-- /content -->
1344<footer class="footer">
1345 <div class="nav-footer">
1346 <div class="nav-footer-left">
1347<p>Built with <a href="https://quarto.org/">Quarto</a></p>
1348</div>
1349 <div class="nav-footer-center">
1350
1351 <div class="toc-actions d-sm-block d-md-none"><ul><li><a href="https://github.com/your-org/atdata/edit/main/api/AtmosphereIndex.qmd" class="toc-action"><i class="bi bi-github"></i>Edit this page</a></li><li><a href="https://github.com/your-org/atdata/issues/new" class="toc-action"><i class="bi empty"></i>Report an issue</a></li></ul></div></div>
1352 <div class="nav-footer-right">
1353<p>MIT License</p>
1354</div>
1355 </div>
1356</footer>
1357
1358
1359
1360
1361</body></html>