Helper which stores mapping info in forward/inverse dicts.
(self, mapping)
| 1011 | (self.dtype, x.dtype)) |
| 1012 | |
| 1013 | def _cache(self, mapping): |
| 1014 | """Helper which stores mapping info in forward/inverse dicts.""" |
| 1015 | # Merging from lookup is an added check that we're not overwriting anything |
| 1016 | # which is not None. |
| 1017 | mapping = mapping.merge(mapping=self._lookup( |
| 1018 | mapping.x, mapping.y, mapping.kwargs)) |
| 1019 | if mapping.x is None and mapping.y is None: |
| 1020 | raise ValueError("Caching expects at least one of (x,y) to be known, " |
| 1021 | "i.e., not None.") |
| 1022 | self._from_x[mapping.x_key] = mapping |
| 1023 | self._from_y[mapping.y_key] = mapping |
| 1024 | |
| 1025 | def _lookup(self, x=None, y=None, kwargs=None): |
| 1026 | """Helper which retrieves mapping info from forward/inverse dicts.""" |
no test coverage detected