Changelog
Source:NEWS.md
dafrjulia (development version)
New Features (DataAxesFormats 0.3.0 catch-up)
- New storage backends:
zarr_daf(),zip_daf(), and read-onlyhttp_daf(). -
packed = TRUEfor chunked+compressed storage onfiles_daf(),h5df(),zarr_daf(),zip_daf(),open_daf(), andcomplete_daf(). -
open_daf()now delegates to the Julia dispatch, routing.daf.zarr,.daf.zip,http(s)://, and.h5dfpaths to the correct backend (it previously opened.daf.zarr/.daf.zipas plain files repositories). - Format conversion:
files_to_zarr()andzarr_to_files(). - Axis reordering:
reorder_axes()andreset_reorder_axes(). - Configuration:
daf_packed_options()andenforce_contracts().
dafrjulia 0.1.1
Tracks DataAxesFormats.jl 0.3.0. DataAxesFormats 0.3.0 requires Julia 1.12 and changed the empty-buffer builder protocol in writers.jl, which broke the wrapper’s filled_empty_sparse_vector / filled_empty_sparse_matrix (they hit MethodErrors on the new signatures). Fixed:
-
get_empty_sparse_vector/get_empty_sparse_matrixcapture thecache_groupthe builder now returns and hold it until the pairedfilled_*call.filled_empty_sparse_vector/filled_empty_sparse_matrixthread thatcache_groupto the Julia finalizer and release the data write lock the builder opened (the old_bbinding helpers a non-Julia wrapper used to rely on were removed in 0.3.0). -
get_empty_dense_vector/get_empty_dense_matrixunwrap the buffer from the new(buffer, cache_group)return tuple and release the write lock (dense buffers have no separate finalizer step).
The public R API (function names, arguments, return shapes) is unchanged. Full test suite passes against DataAxesFormats 0.3.0 on Julia 1.12.
dafrjulia 0.1.0
First CRAN release. Renamed from dafr — the dafr name has been freed for a native-R reimplementation in a separate repository. This package is the JuliaCall-based wrapper around DataAxesFormats.jl and has been renamed accordingly.
Migration from dafr
-
library(dafr)becomeslibrary(dafrjulia). -
options(dafr.JULIA_HOME = ...)becomesoptions(dafrjulia.JULIA_HOME = ...); same fordafr.julia_environmentand otherdafr.*options. - Public API (function names, arguments, return shapes) is unchanged.
New Features
AnnData-like facade
-
as_anndata(daf)returns aDafAnnDataR6 object exposing$X,$obs,$var,$layers,$uns,$obs_names,$var_names,$n_obs,$n_vars, and$shape. Read-only and live: accesses go through to the underlying Daf on demand, served by the R-side cache on hits.obs_axis/var_axisauto-detectcell/metacellandgene;x_nameis validated at construction.
R-side caching
-
get_vector,get_matrix, andaxis_vectornow cache results on the R side, keyed by Daf-level version counters so that modifications viaset_vector/set_matrix/add_axisinvalidate entries automatically. - The cache env is stored directly on each
Dafobject, so there is no global registry and no leak. Two R-level copies of the sameDaflist share the cache (reference semantics); two wrappers of the same Julia object get separate caches. -
empty_cache(daf, clear = ..., keep = ...)now always purges the R-side cache (regardless of selectors) and validates its arguments withmatch.arg.
Performance
- Consolidated
from_julia_arrayfrom 9 sequential Julia↔︎R bridge calls to 4 (5–6 for named arrays). The helper is re-entrant and uses structured Tuple return (no Main-level globals, no string delimiters). -
_prepare_for_reagerly materialises dense non-zero-copy types (Bool,String, etc.) in Julia, saving acollect()round-trip on the R side. - Version counters are now fetched as strings, preventing
UInt32overflow when converting to R integers.axis_version_counter,vector_version_counter, andmatrix_version_counterreturn character strings; compare withidentical()or==. -
_prepare_for_rflattens type dispatch to reduce cold-start JIT cost.
CRAN compliance
- DESCRIPTION: updated
Title,Description,URL,BugReports. -
cran-comments.mddocuments Julia dependency handling,\dontrun{}examples, vignette eval-off, and theJULIA_AVAILABLEtest guard. - Vignette chunks are explicitly
eval = FALSE, purl = FALSEso R CMD check’s tangle step does not try to initialise Julia. -
inst/WORDLISTupdated for spelling checks. - All Julia-dependent tests guarded with
skip_if(!JULIA_AVAILABLE).
Safety
-
jl_R_to_julia_type(internal) now validates string inputs against a whitelist regex and rejects anything that isn’t a plausible Julia type name. Prevents arbitrary Julia code execution via the type-conversion path. -
Daf(jl_obj)rejects non-JuliaObject inputs with a clear error instead of passing them through silently.
Breaking changes vs. dafr
- Package name. All the options and
library()calls above. -
get_vector/get_matrixreturn values for zero-copy types are now live views over Julia memory (viajlview/jlview_sparse). Copy explicitly (as.numeric(v),as.matrix(m)) if stability across subsequent Daf modifications is needed.