compiler: precompute interp pos/weights - #3000
Conversation
cda0311 to
f120563
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3000 +/- ##
==========================================
- Coverage 83.54% 82.99% -0.56%
==========================================
Files 257 257
Lines 53922 54018 +96
Branches 4613 4619 +6
==========================================
- Hits 45050 44832 -218
- Misses 8074 8374 +300
- Partials 798 812 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e823fb0 to
6f9e7c6
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
da8dee9 to
e4977c2
Compare
| ``coords`` handed in by ``SparseFunction._arg_defaults``. Mirrors | ||
| sinc's `_arg_defaults`: regenerates the tables from the persisted | ||
| shift set, so a pickled/rebuilt interpolator (decoupled workers) | ||
| still emits data for every table the operator was compiled with.""" |
There was a problem hiding this comment.
some blank spaces and comments here would help
| tag = _shift_tag(shifts) | ||
| sfname = self.sfunction.name | ||
| sfdim = self.sfunction._sparse_dim | ||
| gp_name = f'{sfname}_gp{tag}' |
There was a problem hiding this comment.
maybe some blank lines and comments would help in this function
| else: | ||
| symbols.append(Symbol(name=f'p{d}', dtype=dtype)) | ||
| return DimensionTuple(*symbols, getters=self.grid.dimensions) | ||
| def _tables_for(self, key): |
There was a problem hiding this comment.
I'd change the name to emphasize that something is being created, such as _tabulate
| `(gridpoints, coeffs_per_dim)` for that shift set; mirrors sinc's | ||
| `interpolation_coeffs` cached_property but keyed on `shifts`.""" | ||
| self._shifts_used.add(key) | ||
| shifts = list(key) if key else None |
| values = super()._arg_values(estimate_memory=estimate_memory, **kwargs) | ||
| if estimate_memory: | ||
| return values | ||
| onames = [o.name for o in self.grid.origin_symbols] |
| values.update(self.interpolator._arg_defaults( | ||
| coords=coords, sfunc=self, origin=origin | ||
| )) | ||
| return values |
| shifts = list(key) if key else None | ||
| gp, coeffs = self._tables_for(key) | ||
| args[gp.name] = _cell_indices(coords, grid, shifts, spacing, origin) | ||
| for i, w in enumerate(coeffs): |
There was a problem hiding this comment.
can probably do with a comprehension but not sure if it actually gets harder to read
b8bd51c to
90a9144
Compare
90a9144 to
200302c
Compare
No description provided.