Skip to content

Commit 9f2a3c3

Browse files
committed
More indentation fixes.
1 parent 75d4b8c commit 9f2a3c3

File tree

2 files changed

+185
-185
lines changed

2 files changed

+185
-185
lines changed

docs/development/design-principles.rst

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Epochs must be Time objects
1919
---------------------------
2020

2121
* Any kind of epoch or point in time must be of type `~astropy.time.Time`; time scales must be properly set and propagated through all functions.
22-
22+
2323

2424
Use sbpy ``DataClass`` objects
2525
------------------------------
@@ -30,49 +30,49 @@ Use sbpy ``DataClass`` objects
3030

3131
* The classes enable easy parameter passing from online sources. Compare the following:
3232

33-
.. code-block:: python
34-
35-
eph = Ephem.from_horizons('2P')
36-
# rh, delta required, phase angle is optional:
37-
Afrho(wave, fluxd, aper, eph['rh'], eph['delta'], phase=eph['phase'])
38-
# more to the point:
39-
Afrho(wave, fluxd, aper, eph)
33+
.. code-block:: python
4034
41-
Carefully document which fields are used by your function or method.
35+
eph = Ephem.from_horizons('2P')
36+
# rh, delta required, phase angle is optional:
37+
Afrho(wave, fluxd, aper, eph['rh'], eph['delta'], phase=eph['phase'])
38+
# more to the point:
39+
Afrho(wave, fluxd, aper, eph)
40+
41+
Carefully document which fields are used by your function or method.
4242

4343
* Dictionary-like objects may be allowed for user input, but should be internally converted to a ``DataClass`` object with the `~sbpy.data.dataclass_input` decorator:
4444

45-
.. code-block:: python
46-
47-
@dataclass_input(eph=Ephem)
48-
def H11(eph):
49-
...
45+
.. code-block:: python
5046
51-
The same, but using function annotations:
52-
53-
.. code-block:: python
54-
55-
@dataclass_input
56-
def H11(eph: Ephem):
57-
...
47+
@dataclass_input(eph=Ephem)
48+
def H11(eph):
49+
...
50+
51+
The same, but using function annotations:
52+
53+
.. code-block:: python
54+
55+
@dataclass_input
56+
def H11(eph: Ephem):
57+
...
5858
5959
* Exceptions are allowed when only one parameter is needed, e.g., ``phase_func(phase)``. But instead consider using the relevant ``DataClass`` object, and decorating the function with `~sbpy.data.quantity_to_dataclass`:
6060

61-
.. code-block:: python
61+
.. code-block:: python
6262
63-
@quantity_to_dataclass(eph=(Ephem, 'phase'))
64-
def phase_func(eph):
65-
...
63+
@quantity_to_dataclass(eph=(Ephem, 'phase'))
64+
def phase_func(eph):
65+
...
6666
67-
The decorator may be stacked with ``dataclass_input`` for maximum
68-
flexibility:
67+
The decorator may be stacked with ``dataclass_input`` for maximum
68+
flexibility:
6969

70-
.. code-block:: python
70+
.. code-block:: python
7171
72-
@dataclass_input
73-
@quantity_to_dataclass(eph=(Ephem, 'phase'))
74-
def phase_func(eph):
75-
...
72+
@dataclass_input
73+
@quantity_to_dataclass(eph=(Ephem, 'phase'))
74+
def phase_func(eph):
75+
...
7676
7777
7878
Append fields to ``DataClass`` at the user's request
@@ -94,11 +94,11 @@ Cite relevant works
9494

9595
* Citations may be executed internally with :func:`sbpy.bib.register`, or via the `~sbpy.bib.cite` decorator:
9696

97-
.. code-block:: python
97+
.. code-block:: python
9898
99-
@cite({'method': '1687pnpm.book.....N'})
100-
def force(mass, acceleration):
101-
return mass * acceleration
99+
@cite({'method': '1687pnpm.book.....N'})
100+
def force(mass, acceleration):
101+
return mass * acceleration
102102
103103
* Labels describing references (``'method'`` in the above example) are
104104
required to start with the following strings: ``'method'`` (for

0 commit comments

Comments
 (0)