Work with both DASCore branches without importing removed classes - #52
Merged
Conversation
DASCore's development branch collapses MemorySpool, DirectorySpool, and FileSpool into one Spool and deletes dascore.clients, so importing DirectorySpool broke every widget entry point at discovery time. Four other couplings sat behind that first ImportError: get_contents() renamed `path` to `source_path`; Spool.select now validates names, so the `distance_min` entries the select dropdowns offered raise; slope_filter dropped the long-deprecated `notch` alias for `invert`; and the waterfall default color levels called a private dascore.viz helper. Every question DerZug asked by isinstance is now asked through a public accessor in derzug.utils.dascore_compat -- a spool's indexer, its spool_path, and which of its contents columns name something selectable. Nothing branches on a DASCore version, and the module is the one place to delete when support for the older layout is dropped. Two user-visible consequences: the Spool and Select widgets offer each coordinate by name (including auxiliary ones like latitude, which were never offered before) rather than the flattened `<dim>_min` columns, and a workflow saved with an older key keeps filtering on it. Verified against dascore dev, master, and the released 0.1.16.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
DASCore's development branch collapses
MemorySpool/DirectorySpool/FileSpoolinto a singledc.Spooland deletes thedascore.clientspackage, sofrom dascore.clients.dirspool import DirectorySpoolfails at import. That takes down widget discovery entirely — every DerZug entry point fails to load:Four more couplings were hiding behind that first
ImportError. This PR fixes all five by reaching for public APIs instead of version-specific classes and private helpers, with no branching on a DASCore version anywhere in the code.dascore.clients.dirspool/filespoolimports — package deletedderzug/utils/dascore_compat.pyanswers spool-kind questions from public accessors (indexer,spool_path)get_contents()renamedpath→source_path; row ordering and identity tokens read it by namecontents_path_column()resolves whichever name is presentSpool.selectnow validates names against a spool's attrs/coords, so the widgets'distance_mindropdown entries raiseselectable_contents_keys()offers the coordinate itself (distance) plus real attributesslope_filter(notch=...)removed — it was a deprecated alias forinvertinvert=dascore.viz.waterfall._get_scale— private, and imports matplotlib eagerlydascore.utils.misc.tukey_fence, which is exactly what that call path computedAlso swapped
dascore.core.coords.get_coordfor the top-leveldc.get_coord.derzug.utils.dascore_compatis deliberately the single place that knows about the two layouts, so it is the one file to delete when support for the older one is dropped.User-visible changes
distance_min/time_maxcolumns or source-file bookkeeping columns; select on the coordinate itself (distancewith a(1000, None)range). Auxiliary coordinates such aslatitudeare now offered, which they never were before. Workflows saved with an older key keep filtering on it.notch=Trueforcedinvert— but collapsing them is a UI change I kept out of a compatibility PR. Happy to fold it in if wanted.Verification
The suite was run against three DASCore versions:
dev@dddf0f73(0.1.21.dev146)master@64f0c8edThe 0.1.16 environment cannot run the Qt suite (unrelated broken
chardet/Orange install), so it was exercised with a direct script over the Qt-free compat surface and the node-layer spool functions.All 26 widget entry points load against
dev, which is what the original traceback was about.Checklist
I have (if applicable):
prek run --all-filesandpytest tests.python scripts/bench_compare.py --baseline main, pasted the table below, and added thebenchmarklabel. See benchmarking.Note on
prek run --all-files: it also reformatstests/test_views/test_orange_qt.py, which it does on a cleanmaintoo — the pinned ruff (v0.4.8) is older than whatever last formatted that file. Left untouched here; it wants its own fix.Benchmarks
python scripts/bench_compare.py --baseline main --repeat 2(control -5.8%, within tolerance):Nothing regresses past the 20% threshold; the largest slowdown is +3.4% on a benchmark this change does not touch. The one double-digit row (
test_import_workflow, -19.5%) is an improvement and flagged noisy (baseline rel stdev 31%).