Commit af4ab84
Release Manager
gh-35314: `sage.schemes`: Reformat doctests, add `# optional` annotations
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes #1234" use "Introduce new method to
calculate 1+1"
-->
### 📚 Description
<!-- Describe your changes here in detail -->
Adding doctest tags `# optional - sage.rings.finite_rings`,
`...number_field`, `...padics`.
While going through the doctests line by line, I also made the following
changes:
- some coding style fixes in the doctests (such as adding spaces around
some operators and after commas, following PEP 8) - improved the
readability of them in the HTML format by breaking long lines to avoid
having to scroll horizontally
- improved indentation of input and output, in particular when morphisms
are displayed
- made better use of the horizontal space in the doctests of some
modules in `sage.schemes.toric`, which were formatted for a very narrow
layout
- improved the sphinx markup of some docstrings.
<!-- Why is this change required? What problem does it solve? -->
The doctest tags are preparation for being able to test parts of
`sage.schemes` in a modularized setting, in which not all rings are
available. See https://doc.sagemath.org/html/en/developer/packaging_sage
_library.html#doctest-only-dependencies
<!-- If it resolves an open issue, please link to the issue here. For
example "Closes #1337" -->
Part of:
- #29705
### 📝 Checklist
<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
- [x] I have made sure that the title is self-explanatory and the
description concisely explains the PR.
- [x] I have linked an issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.
### ⌛ Dependencies
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->
- Depends on #35230 (not merged here) for the definition of the feature
`sage.rings.finite_rings`.
The mass edits adding `# optional` tags were made using the following
Emacs macro.
```elisp
(defun sage-copy-optional-annotation ()
"In a 'sage: ' line of a docstring, copy '# optional' from a previous
line and
advance to the end of the next 'sage: ' line or to the end of the
current docstring.
If invoked elsewhere, just advance to the end of the next 'sage: '
line."
(interactive)
(if (save-excursion (beginning-of-line)
(looking-at " *sage:"))
(let ((tab-stop-list
(list (save-excursion
(previous-line)
(end-of-line)
(re-search-backward "# *optional.*$")
(- (match-beginning 0)
(save-excursion
(beginning-of-line) (point)))))))
(end-of-line)
(just-one-space)
(tab-to-tab-stop)
(insert (match-string-no-properties 0))
(re-search-forward "sage: \\|\"\"\"")
(end-of-line))
(re-search-forward "sage:")
(end-of-line)))
(with-eval-after-load "python-mode"
(define-key python-mode-map (kbd "C-M-;") 'sage-copy-optional-
annotation))
```
URL: #35314
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
File tree
112 files changed
+12645
-11482
lines changed- src/sage/schemes
- affine
- berkovich
- curves
- cyclic_covers
- elliptic_curves
- generic
- hyperelliptic_curves
- jacobians
- plane_conics
- plane_quartics
- product_projective
- projective
- riemann_surfaces
- toric
- sheaf
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
112 files changed
+12645
-11482
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
| 213 | + | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
248 | 250 | | |
249 | | - | |
| 251 | + | |
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
256 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
| |||
388 | 392 | | |
389 | 393 | | |
390 | 394 | | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
395 | 399 | | |
396 | 400 | | |
397 | 401 | | |
398 | | - | |
| 402 | + | |
399 | 403 | | |
400 | 404 | | |
401 | 405 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
364 | 364 | | |
365 | | - | |
366 | | - | |
| 365 | + | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
420 | | - | |
| 419 | + | |
| 420 | + | |
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
426 | | - | |
427 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
433 | | - | |
| 432 | + | |
| 433 | + | |
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
439 | | - | |
| 438 | + | |
| 439 | + | |
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
| 186 | + | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | 204 | | |
208 | | - | |
209 | | - | |
210 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | 252 | | |
255 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
256 | 257 | | |
257 | | - | |
258 | | - | |
| 258 | + | |
| 259 | + | |
259 | 260 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | | - | |
272 | | - | |
273 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
274 | 275 | | |
275 | | - | |
| 276 | + | |
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
| |||
0 commit comments