Skip to content

Commit a373fb5

Browse files
Ken KundertKen Kundert
authored andcommitted
nit
1 parent 79aefa4 commit a373fb5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/user.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,25 +2041,26 @@ want different preferences:
20412041
25C 1.00021MHz
20422042
75C 1.00178MHz
20432043
2044-
In this example, a subclass is created that is intended to report in
2044+
In the following example, a subclass is created that is intended to report in
20452045
concentrations.
20462046

20472047
.. code-block:: python
20482048
20492049
>>> class Concentration(Quantity):
20502050
... pass
2051+
20512052
>>> Concentration.set_prefs(
20522053
... map_sf = dict(u=' PPM', n= ' PPB', p=' PPT'),
20532054
... show_label = True,
20542055
... )
20552056
2056-
>>> pollutants = dict(CO=5, SO2=20, NO2=0.10)
2057+
>>> pollutants = {'CO': 5, 'SO₂': 20, 'NO₂': 0.10}
20572058
>>> concentrations = [Concentration(v, scale=1e-6, name=k) for k, v in pollutants.items()]
20582059
>>> for each in concentrations:
20592060
... print(each)
20602061
CO = 5 PPM
2061-
SO2 = 20 PPM
2062-
NO2 = 100 PPB
2062+
SO = 20 PPM
2063+
NO = 100 PPB
20632064
20642065
Alternately, you can simply set the preferences as attributes when creating the
20652066
sublclasses. For example:

0 commit comments

Comments
 (0)