zarr-developers / VirtualiZarr

Create virtual Zarr stores from archival data files using xarray syntax
https://virtualizarr.readthedocs.io/en/stable/api.html
Apache License 2.0
120 stars 23 forks source link

A better name for the ".virtualize" accessor? #241

Open TomNicholas opened 1 month ago

TomNicholas commented 1 month ago

I'm not super happy with the vds.virtualize.to_<format> accessor name. It's confusing - really the "virtualize" accessor doesn't "virtualize" anything, the references are already virtual, it just allows you to write them out somewhere.

A better name might be .serialize.to_<format> or even just .write.to_<format> (as these methods correspond to virtualizarr "writers"). The problem with those names is that they don't really indicate that you're about to enter a virtualizarr-specific namespace. But then again if you attempt to call ds.virtualize.to_<format>() on a non-virtual dataset you will get a clear error anyway.

See also #239. This is also a manifestation of #171.

keewis commented 1 month ago

I wonder whether we should try to instead find a summarizing name (virtualizarr, for example) instead of more specific ones like serialize or write? That way, we don't have to try to describe what is in the namespace (you probably won't find a name for the writers that, at the same time, fits the rename_paths method).

TomNicholas commented 1 month ago

That's a very good point @keewis - I forgot about the rename_paths method. Yeah having virtualizarr instead of virtualize would be a minor improvement, as the verb virtualize is misleading and unneccessary here.