Skip to content

Add Google Cloud Storage example#1713

Closed
dstansby wants to merge 1 commit into
zarr-developers:mainfrom
dstansby:gcs-example
Closed

Add Google Cloud Storage example#1713
dstansby wants to merge 1 commit into
zarr-developers:mainfrom
dstansby:gcs-example

Conversation

@dstansby

Copy link
Copy Markdown
Contributor

This adds an example of how to open an array that's in Google Cloud Storage. Fixes zarr-developers/n5py#14

I've added a new section to the docs, "Examples", for short, self-contained examples, that achieve a specific goal. This is distinct from existing sections of the docs, and should complement the existing tutorial and reference sections. For those familiar with Diataxis, this is essentially the "how-to guides" quadrant.

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/tutorial.rst
  • Changes documented in docs/release.rst
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@d-v-b

d-v-b commented Mar 18, 2024

Copy link
Copy Markdown
Contributor

Your example uses N5FSStore, perhaps an example for a wide audience should just use FSStore?

Comment thread docs/examples/google_cloud.rst Outdated
Comment thread docs/examples/google_cloud.rst Outdated
path_to_array = "a/b/c"

fs = gcsfs.GCSFileSystem(project=bucket, token='anon', access='read_only')
store = zarr.FSStore(url=bucket, fs=fs)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line throws an error:

AttributeError: module 'zarr' has no attribute 'FSStore'

@sanketverma1704

Copy link
Copy Markdown
Member

Hi @dstansby, thanks for sending the PR.

I wonder if this example should be listed here along with S3 and Azure examples?

@jhamman jhamman added the V2 Affects the v2 branch label Oct 11, 2024
@codecov

codecov Bot commented Oct 11, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.99%. Comparing base (6fe553d) to head (ad3206f).
Report is 497 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1713   +/-   ##
=======================================
  Coverage   99.99%   99.99%           
=======================================
  Files          38       38           
  Lines       14580    14580           
=======================================
  Hits        14579    14579           
  Misses          1        1           

@dstansby dstansby closed this Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

V2 Affects the v2 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't open a read-only Google Cloud Storage store

4 participants