Skip to content

Commit 566f74c

Browse files
committed
wrap long code lines
1 parent 9ebaccb commit 566f74c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tutorials/cloud_access/cloud-access-intro.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ seip_results["cloud_access"][:5]
187187
```{code-cell} ipython3
188188
# find the first mosaic file in the results
189189
# use json to convert the string containing the cloud info to a dictionary
190-
seip_mosaic_cloud_info = json.loads([i for i in seip_results["cloud_access"] if ".mosaic.fits" in i][0])
190+
mosaics = [i for i in seip_results["cloud_access"] if ".mosaic.fits" in i]
191+
seip_mosaic_cloud_info = json.loads(mosaics[0])
191192
192193
# extract
193194
BUCKET_NAME = seip_mosaic_cloud_info["aws"]["bucket_name"]
@@ -218,7 +219,8 @@ In addition, use the HDU `section` method in place of the usual `data` to avoid
218219
(See [Obtaining subsets from cloud-hosted FITS files](https://docs.astropy.org/en/stable/io/fits/usage/cloud.html#fits-io-cloud).)
219220

220221
```{code-cell} ipython3
221-
with astropy.io.fits.open(f"s3://{BUCKET_NAME}/{image_key}", fsspec_kwargs={"anon": True}) as hdul:
222+
s3_image_path = f"s3://{BUCKET_NAME}/{image_key}"
223+
with astropy.io.fits.open(s3_image_path, fsspec_kwargs={"anon": True}) as hdul:
222224
cutout = Cutout2D(hdul[0].section, position=coords, size=size, wcs=WCS(hdul[0].header))
223225
```
224226

@@ -261,7 +263,8 @@ fs = pyarrow.fs.S3FileSystem(region=BUCKET_REGION, anonymous=True)
261263

262264
```{code-cell} ipython3
263265
# load the schema from the "_common_metadata" file
264-
schema = pyarrow.dataset.parquet_dataset(f"{parquet_root}/_common_metadata", filesystem=fs).schema
266+
s3_schema_path = f"{parquet_root}/_common_metadata"
267+
schema = pyarrow.dataset.parquet_dataset(s3_schema_path, filesystem=fs).schema
265268
266269
# the full schema can be quite large since catalogs often have hundreds of columns
267270
# but if you do want to look at the entire schema, uncomment the next line
@@ -304,7 +307,9 @@ Find the partitions (HEALPix pixel indexes) that overlap the polygon:
304307

305308
```{code-cell} ipython3
306309
k = 5
307-
polygon_pixels = hpgeom.query_polygon(a=corners[0], b=corners[1], nside=hpgeom.order_to_nside(k), inclusive=True)
310+
polygon_pixels = hpgeom.query_polygon(
311+
a=corners[0], b=corners[1], nside=hpgeom.order_to_nside(k), inclusive=True
312+
)
308313
```
309314

310315
Query:

0 commit comments

Comments
 (0)