Phase 2: Use register_dataset for all datasets including built-ins#51
Merged
Phase 2: Use register_dataset for all datasets including built-ins#51
Conversation
- Change cf_ids expand default to TRUE - Add 'expanded' attribute to cidlist objects to track resolution state - Add check_expanded() to verify IDs have been resolved before use - cf_partners and cf_meta now check for expanded IDs instead of calling expand_ids - c.cidlist checks inputs are expanded and propagates the attribute - Remove redundant fanc_ids()/banc_ids() calls from .fanc_partners() and .banc_partners() This ensures all query resolution happens in cf_ids, making it the single entry point for ID resolution. Downstream functions receive only resolved numeric IDs, preparing for Phase 3 local cache support.
- Create separate files for each dataset (flywire.R, hemibrain.R, etc.) - Add R/zzz.R with .onLoad() to register all built-in datasets - Simplify get_id_fun(), get_meta_fun() to use registered functions - Simplify cf_partners() dispatch to use registered partnerfun - Use registered shortnames in abbreviate_datasets() Bug fixes: - Fix fafbseg::.flywire_ids -> fafbseg::flywire_ids (exported function) - Fix malevnc::.manc_ids -> malevnc::manc_ids (exported function) - Fix fancorbanc_ids/meta function references in banc.R - Fix fanc_meta/banc_meta -> .fanc_meta/.banc_meta in fancorbanc_ids - Restore neuprint.chunksize parameter for neuprint-based datasets
- Add test helper register_rhubarb() with idfun for expanded ID tests - Update test expectations for new expand=TRUE default - Suppress expected warnings in tests to reduce CI noise - Install malecns in R CMD check workflow
05f4ae5 to
72ff404
Compare
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.
Summary
Depends on: #50 (Phase 1)
This PR establishes a uniform registration mechanism for all datasets (builtin and external) using
coconat::register_dataset.New files for dataset-specific functions:
R/zzz.R:.onLoad()to register all built-in datasetsR/flywire.R:.flywire_ids,.flywire_meta,.flywire_partnersR/hemibrain.R:.hemibrain_ids,.hemibrain_meta,.hemibrain_partnersR/opticlobe.R:.opticlobe_ids,.opticlobe_meta,.opticlobe_partnersR/malecns.R:.malecns_ids,.malecns_meta,.malecns_partnersR/manc.R:.manc_ids,.manc_meta,.manc_partnersR/banc.R:.banc_ids,.banc_meta,banc_error,.banc_partners,banc_versionR/yakubavnc.R:.yakubavnc_ids,.yakubavnc_meta,.yakubavnc_partnersUpdated R/fanc.R:
.fanc_ids,.fanc_metafanc_versionand.fanc_partnersSimplified dispatch functions:
get_id_fun: now uses only registered functionsget_meta_fun: now uses only registered functionscf_partners: uses registeredpartnerfuninstead of if-else chainabbreviate_datasets: uses only registered shortnameslengthen_datasets: uses only registered shortnamesCleaned up:
R/meta.R: removed functions moved to dataset-specific filesR/partners.R: removed functions moved to dataset-specific filesAll dataset-specific functions now use private naming convention (
.prefix) for consistency.Test plan
cf_datasets('builtin')returns all 8 datasetsabbreviate_datasets(cf_datasets('builtin'))workscf_ids(hemibrain=12345)workscoconat:::dataset_details()cf_metaandcf_partnerswork with all datasets