Skip to content

Commit

Permalink
Edit optional needs tags explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Oct 13, 2024
1 parent 627b9f1 commit d7db870
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/doc/en/developer/coding_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
General Conventions
===================


There are many ways to contribute to Sage, including sharing scripts
and Jupyter notebooks that implement new functionality using Sage,
improving to the Sage library, or to working on the many underlying
Expand Down Expand Up @@ -1256,13 +1255,15 @@ framework. Here is a comprehensive list:
Neither of this applies to files or directories which are explicitly given
as command line arguments: those are always tested.

- **optional/needs:** A line tagged with ``optional - FEATURE``
or ``needs FEATURE`` is not tested unless the ``--optional=KEYWORD`` flag
is passed to ``sage -t`` (see :ref:`section-optional-doctest-flag`).

If ``FEATURE`` starts with an exclamation point ``!``, then the condition is
- **optional** or **needs:** A line tagged with ``optional - FEATURE`` or
``needs FEATURE`` is tested if the feature is available in Sage. If
``FEATURE`` starts with an exclamation point ``!``, then the condition is
negated, that is, the doctest runs only if the feature is not available.

If the feature is included in the ``--optional=KEYWORD`` flag passed to
``sage -t`` (see :ref:`section-optional-doctest-flag`), then the line is
tested regardless of the feature availability.

The main applications are:

- **optional packages:** When a line requires an optional package to be
Expand All @@ -1274,7 +1275,7 @@ framework. Here is a comprehensive list:
sage: C.solve() # optional - !rubiks (GAP is used)
'L*R'

- **optional database:** When a line requires a database to be present::
- **features:** When a line requires a feature to be present::

sage: SloaneEncyclopedia[60843] # optional - sloane_database
[1, 6, 21, 107, 47176870]
Expand All @@ -1285,7 +1286,7 @@ framework. Here is a comprehensive list:
OSError: The Sloane Encyclopedia database must be installed. Use e.g.
'SloaneEncyclopedia.install()' to download and install it.

- **internet:** For lines that require an internet connection::
For lines that require an internet connection::

sage: oeis(60843) # optional - internet
A060843: Busy Beaver problem: a(n) = maximal number of steps that an
Expand Down

0 comments on commit d7db870

Please sign in to comment.