Skip to content

Commit f171c96

Browse files
authored
CLN/DOC: Remove sphinx referencing the wiki (#47853)
1 parent 8a71e83 commit f171c96

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

doc/source/conf.py

-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@
453453
# extlinks alias
454454
extlinks = {
455455
"issue": ("https://github.com/pandas-dev/pandas/issues/%s", "GH"),
456-
"wiki": ("https://github.com/pandas-dev/pandas/wiki/%s", "wiki "),
457456
}
458457

459458

web/pandas/about/roadmap.md

+46-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,52 @@ uses label-based, rather than position-based, indexing. We propose that
103103
it should only work with positional indexing, and the translation of
104104
keys to positions should be entirely done at a higher level.
105105

106-
Indexing is a complicated API with many subtleties. This refactor will
107-
require care and attention. More details are discussed at
108-
<https://github.com/pandas-dev/pandas/wiki/(Tentative)-rules-for-restructuring-indexing-code>
106+
Indexing is a complicated API with many subtleties. This refactor will require care
107+
and attention. The following principles should inspire refactoring of indexing code and
108+
should result on cleaner, simpler, and more performant code.
109+
110+
1. Label indexing must never involve looking in an axis twice for the same label(s).
111+
This implies that any validation step must either:
112+
113+
* limit validation to general features (e.g. dtype/structure of the key/index), or
114+
* reuse the result for the actual indexing.
115+
116+
2. Indexers must never rely on an explicit call to other indexers.
117+
For instance, it is OK to have some internal method of `.loc` call some
118+
internal method of `__getitem__` (or of their common base class),
119+
but never in the code flow of `.loc` should `the_obj[something]` appear.
120+
121+
3. Execution of positional indexing must never involve labels (as currently, sadly, happens).
122+
That is, the code flow of a getter call (or a setter call in which the right hand side is non-indexed)
123+
to `.iloc` should never involve the axes of the object in any way.
124+
125+
4. Indexing must never involve accessing/modifying values (i.e., act on `._data` or `.values`) more than once.
126+
The following steps must hence be clearly decoupled:
127+
128+
* find positions we need to access/modify on each axis
129+
* (if we are accessing) derive the type of object we need to return (dimensionality)
130+
* actually access/modify the values
131+
* (if we are accessing) construct the return object
132+
133+
5. As a corollary to the decoupling between 4.i and 4.iii, any code which deals on how data is stored
134+
(including any combination of handling multiple dtypes, and sparse storage, categoricals, third-party types)
135+
must be independent from code that deals with identifying affected rows/columns,
136+
and take place only once step 4.i is completed.
137+
138+
* In particular, such code should most probably not live in `pandas/core/indexing.py`
139+
* ... and must not depend in any way on the type(s) of axes (e.g. no `MultiIndex` special cases)
140+
141+
6. As a corollary to point 1.i, `Index` (sub)classes must provide separate methods for any desired validity check of label(s) which does not involve actual lookup,
142+
on the one side, and for any required conversion/adaptation/lookup of label(s), on the other.
143+
144+
7. Use of trial and error should be limited, and anyway restricted to catch only exceptions
145+
which are actually expected (typically `KeyError`).
146+
147+
* In particular, code should never (intentionally) raise new exceptions in the `except` portion of a `try... exception`
148+
149+
8. Any code portion which is not specific to setters and getters must be shared,
150+
and when small differences in behavior are expected (e.g. getting with `.loc` raises for
151+
missing labels, setting still doesn't), they can be managed with a specific parameter.
109152

110153
## Numba-accelerated operations
111154

0 commit comments

Comments
 (0)