You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some drivers like the CSV source support parameters which can then be interpolated into the urlpath. This doesn't seem to work with the zarr_cat driver. E.g., I have a catalog like this, containing an entry snp_genotypes that uses a parameter, and for comparison an entry snp_genotypes_test that doesn't use parameters:
metadata:
version: 1sources:
snp_genotypes:
description: 'Test zarr data source, using parameters'driver: zarr_catparameters:
sample_set:
description: 'Sample set.'type: strargs:
urlpath: 'gcs://vo_agam_release/v3/snp_genotypes/all/{{sample_set}}/'consolidated: truesnp_genotypes_test:
description: 'Test zarr data source, not using parameters.'driver: zarr_catargs:
urlpath: 'gcs://vo_agam_release/v3/snp_genotypes/all/AG1000G-AO/'consolidated: true
I can access the snp_genotypes_test entry just fine, e.g.:
In [1]: importintakeIn [2]: intake.__version__Out[2]: '0.6.0'In [3]: cat=intake.open_catalog('test.yml')
In [4]: cat.snp_genotypes_testOut[4]: <Intakecatalog: snp_genotypes_test>In [5]: cat.snp_genotypes_test.to_zarr()
Out[5]: <zarr.hierarchy.Group'/'read-only>
However, when I try to access the snp_genotypes entry I get errors, which I suspect are due to the fact that the sample_set parameter is not getting applied to the urlpath:
The initial access snp_genotypes immediately instantiates the source, and since the parameter has no default, you get an empty string in place of the template. When you then call this source, you get a new version of the source with the given templating.
So a workaround is to have a default value for parameter sample_set which resolves to a real target. A better solution is not to have the driver class actually access the target until the user accesses them, i.e., have the catalogue members be lazily loaded.
Some drivers like the CSV source support parameters which can then be interpolated into the urlpath. This doesn't seem to work with the zarr_cat driver. E.g., I have a catalog like this, containing an entry
snp_genotypes
that uses a parameter, and for comparison an entrysnp_genotypes_test
that doesn't use parameters:I can access the
snp_genotypes_test
entry just fine, e.g.:However, when I try to access the
snp_genotypes
entry I get errors, which I suspect are due to the fact that thesample_set
parameter is not getting applied to theurlpath
:Is there something I need to do in the
ZarrGroupCatalog
class to make sure parameters are applied?The text was updated successfully, but these errors were encountered: