Coverage for astrocalc/docstring_test.py : 25%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2*Testing the rendering of docstings - feel free to remove this module*
4Check the API output here: file:///Users/Dave/git_repos/_templates_/python-package-template/astrocalc/docs/build/html/_api/astrocalc.docstring_test.html
5"""
7def docsting_test(self):
8 """
9 *the database object for sherlock, setting up ssh tunnels and various database connections*
11 The returned dictionary of database connections contain the following databases:
13 - ``transients`` -- the database hosting the transient source data
14 - ``catalogues`` -- connection to the database hosting the contextual catalogues the transients are to be crossmatched against
15 - ``marshall`` -- connection to the PESSTO Marshall database
17 **Key Arguments**
19 - ``log`` -- logger
20 - ``settings`` -- the settings dictionary
23 **Return**
25 - ``dbConns`` -- a dictionary of the database connections required by sherlock
28 **Usage**
30 To setup the sherlock database connections, run the following:
32 ```python
33 # SETUP ALL DATABASE CONNECTIONS
34 from sherlock import database
35 db = database(
36 log=log,
37 settings=settings
38 )
39 dbConns, dbVersions = db.connect()
40 transientsDbConn = dbConns["transients"]
41 cataloguesDbConn = dbConns["catalogues"]
42 pmDbConn = dbConns["marshall"]
43 ```
46 .. todo ::
48 - update key arguments values and definitions with defaults
49 - update return values and definitions
50 - update usage examples and text
51 - update docstring text
52 - check sublime snippet exists
53 - clip any useful text to docs mindmap
54 - regenerate the docs and check redendering of this docstring
56 **Embed reStructuredText**
58 ```eval_rst
59 .. todo::
61 - nice!
62 ```
64 **Code and Syntax Highlighting**
66 Inline `code` has `back-ticks around` it.
68 ```javascript
69 var s = "JavaScript syntax highlighting";
70 alert(s);
71 ```
73 ```python
74 s = "Python syntax highlighting"
75 print(s)
76 myString = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
77 ```
79 ```
80 No language indicated, so no syntax highlighting.
81 But let's throw in a <b>tag</b>.
82 ```
84 **Mermaid**
86 ```mermaid
87 gantt
88 dateFormat YYYY-MM-DD
89 title Adding GANTT diagram functionality to mermaid
90 section A section
91 Completed task :done, des1, 2014-01-06,2014-01-08
92 Active task :active, des2, 2014-01-09, 3d
93 Future task : des3, after des2, 5d
94 Future task2 : des4, after des3, 5d
95 section Critical tasks
96 Completed task in the critical line :crit, done, 2014-01-06,24h
97 Implement parser and jison :crit, done, after des1, 2d
98 Create tests for parser :crit, active, 3d
99 Future task in critical line :crit, 5d
100 Create tests for renderer :2d
101 Add to mermaid :1d
102 ```
104 **Flowchart**
106 ```flow
107 s=>start: start
108 e=>end: end
109 o=>operation: operation
110 sr=>subroutine: subroutine
111 c=>condition: condition
112 i=>inputoutput: inputoutput
113 p=>parallel: parallel
115 s->o->c
116 c(yes)->i->e
117 c(no)->p
118 p(path1, bottom)->sr(right)->o
119 p(path2, top)->o
120 ```
122 **Tables**
124 Colons can be used to align columns.
126 | Tables | Are | Cool |
127 | ------------- |:-------------:| -----:|
128 | col 3 is | right-aligned | $1600 |
129 | col 2 is | centered | $12 |
130 | zebra stripes | are neat | $1 |
132 **Definitions**
134 term
135 : definition
137 what
138 Definition lists associate a term with a definition.
140 **Math**
142 A formula, ${e}^{i\pi }+1=0$, inside a paragraph.
144 $${e}^{i\pi }+1=0$$
146 **Super/Sub Scripts**
148 m^2
150 x^2,y^
152 x~z
154 C~6~H~12~O~6
156 **Citations**
158 Cite a source.[p. 42][#source]
160 [#source]: John Doe. *A Totally Fake Book*. Vanity Press, 2006.
162 Black (2015)[#Black:2015tz]
164 [#Black:2015tz]: A Bryden Black 2015, *The Lion, the Dove, & the Lamb*, Wipf and Stock Publishers
166 **Task Lists**
168 - [x] Completed task item
169 - [ ] Unfinished task item
171 **Footnote**
173 Here's a sentence with a footnote[^1] in the middle of it!
175 [^1]: This is the footnote.
177 **Emphasis**
179 Emphasis, aka italics, with *asterisks*
181 Strong emphasis, aka bold, with **asterisks**.
183 Strikethrough ~~deleted~~.
185 **Lists**
187 1. First ordered list item
188 2. Another item
189 * Unordered sub-list.
190 1. Actual numbers don't matter, just that it's a number
191 1. Ordered sub-list
192 4. And another item.
194 You can have properly indented paragraphs within list items.
196 and unordered lists:
198 * Unordered list can use asterisks
199 - Or minuses
200 + Or pluses
202 **Links**
204 [I'm an inline-style link](https://www.google.com)
206 **Images**
208 Here's our logo (hover to see the title text):
210 Inline-style:
211 
213 Reference-style:
214 ![alt text][logo]
216 [logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2"
218 **Blockquotes**
220 > Blockquotes are very handy in email to emulate reply text.
221 > This line is part of the same quote.
223 Quote break.
225 > This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
227 **Abbreviations**
229 The HTML specification is maintained by the W3C.
231 *[HTML]: Hyper Text Markup Language
232 *[W3C]: World Wide Web Consortium
234 **Horizontal Rule**
236 Three or more...
238 ---
240 Hyphens
241 """
242 import os
243 rootPath = os.path.dirname(__file__)
245 return rootPath