Skip to content

Commit fcf4b49

Browse files
committed
Merge branch 'main' into requirements
2 parents 5e36fab + fd4d29b commit fcf4b49

File tree

6 files changed

+31
-18
lines changed

6 files changed

+31
-18
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
name: "Execute and convert the notebooks to HTML"
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
1818

1919
- name: Set up Python
20-
uses: actions/setup-python@v5
20+
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
2121
with:
2222
python-version: 3.12
2323

@@ -40,13 +40,13 @@ jobs:
4040
run: |
4141
echo "::set-output name=artifactName::rendered-tutorials"
4242
43-
- uses: actions/upload-artifact@v4
43+
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
4444
with:
4545
name: ${{ steps.nameartifact.outputs.artifactName }}
4646
path: _build
4747

4848
- name: Dispatch Learn Astropy deployment
49-
uses: peter-evans/repository-dispatch@26b39ed245ab8f31526069329e112ab2fb224588
49+
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
5050
if: ${{ (github.event_name == 'push') && (github.ref == 'refs/heads/main') && (github.repository == 'astropy/astropy-tutorials')}}
5151
with:
5252
token: ${{ secrets.DISPATCH_GITHUB_TOKEN }}

.github/workflows/prs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
name: "Execute and convert the notebooks to HTML"
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
2020
with:
2121
fetch-depth: 0
2222

2323
- name: Set up Python
24-
uses: actions/setup-python@v5
24+
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
2525
with:
2626
python-version: 3.12
2727

@@ -52,7 +52,7 @@ jobs:
5252
run: |
5353
echo "::set-output name=artifactName::rendered-tutorials"
5454
55-
- uses: actions/upload-artifact@v4
55+
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
5656
with:
5757
name: ${{ steps.nameartifact.outputs.artifactName }}
5858
path: _build

.github/workflows/test-scripts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
runs-on: ubuntu-latest
2020
if: contains(github.event.pull_request.labels.*.name, 'infrastructure')
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
2323
with:
2424
fetch-depth: 0
2525

2626
- name: Set up Python
27-
uses: actions/setup-python@v4.6.0
27+
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
2828
with:
2929
python-version: 3.9
3030

tutorials/color-excess/color-excess.ipynb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"outputs": [],
202202
"source": [
203203
"download_dir = pathlib.Path('~/.astropy/cache/astroquery/Mast').expanduser()\n",
204-
"download_dir.mkdir(exist_ok=True)\n",
204+
"download_dir.mkdir(exist_ok=True, parents=True)\n",
205205
"\n",
206206
"obsTable = Observations.query_object(\"HD 147933\", radius=\"1 arcsec\")\n",
207207
"obsTable_spec = obsTable[obsTable['dataproduct_type'] == 'spectrum']\n",
@@ -214,7 +214,10 @@
214214
"metadata": {},
215215
"outputs": [],
216216
"source": [
217-
"obsids = obsTable_spec[39]['obsid']\n",
217+
"# retrieve a specific 'obs_id' corresponding to the IUE spectrum\n",
218+
"obsTable_spec.add_index('obs_id')\n",
219+
"obsids = obsTable_spec.loc['lwr05639']['obsid']\n",
220+
"\n",
218221
"dataProductsByID = Observations.get_product_list(obsids)\n",
219222
"manifest = Observations.download_products(dataProductsByID, \n",
220223
" download_dir=str(download_dir))"
@@ -268,11 +271,11 @@
268271
"outputs": [],
269272
"source": [
270273
"custom_query = Simbad()\n",
271-
"custom_query.add_votable_fields('fluxdata(U)','fluxdata(B)','fluxdata(V)')\n",
274+
"custom_query.add_votable_fields('U','B','V')\n",
272275
"phot_table=custom_query.query_object('HD 147933')\n",
273-
"Umag=phot_table['FLUX_U']\n",
274-
"Bmag=phot_table['FLUX_B']\n",
275-
"Vmag=phot_table['FLUX_V']"
276+
"Umag=phot_table['U']\n",
277+
"Bmag=phot_table['B']\n",
278+
"Vmag=phot_table['V']"
276279
]
277280
},
278281
{

tutorials/spectral-cube-reprojection/SpectralCubeReprojectExample.ipynb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,14 @@
533533
"metadata": {},
534534
"outputs": [],
535535
"source": [
536-
"cube2vel_reproj = cube2vel_spatialspectralsmooth.reproject(cube1vel.header)\n",
536+
"# first we make a copy of the target (cube1vel) header and set its rest frequency \n",
537+
"# to that of the cube we're reprojecting (cube2vel_spatialspectralsmooth)\n",
538+
"# (see https://github.com/radio-astro-tools/spectral-cube/issues/874)\n",
539+
"tgthdr = cube1vel.header\n",
540+
"tgthdr['RESTFRQ'] = cube2vel_spatialspectralsmooth.header['RESTFRQ']\n",
541+
"\n",
542+
"# now we continue with the reprojection\n",
543+
"cube2vel_reproj = cube2vel_spatialspectralsmooth.reproject(tgthdr)\n",
537544
"cube2vel_reproj"
538545
]
539546
},
@@ -625,7 +632,7 @@
625632
" cube2daskvel_spectralresample = cube2daskvel_smooth.spectral_interpolate(cube1vel.spectral_axis,\n",
626633
" suppress_smooth_warning=True)\n",
627634
" cube2daskvel_spatialspectralsmooth = cube2daskvel_spectralresample.convolve_to(common_beam)\n",
628-
" cube2daskvel_reproj = cube2daskvel_spatialspectralsmooth.reproject(cube1vel.header)\n",
635+
" cube2daskvel_reproj = cube2daskvel_spatialspectralsmooth.reproject(tgthdr) # as above, tgthdr is altered cube1vel header\n",
629636
"cube2daskvel_reproj"
630637
]
631638
},

tutorials/vo/conesearch.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,10 @@
253253
"outputs": [],
254254
"source": [
255255
"my_db = vos_catalog.get_remote_catalog_db(conf.conesearch_dbname)\n",
256-
"my_cat = my_db.get_catalog_by_url(result.url + '&')\n",
256+
"try:\n",
257+
" my_cat = my_db.get_catalog_by_url(result.url)\n",
258+
"except AttributeError:\n",
259+
" my_cat = my_db.get_catalog_by_url(result.url + '&')\n",
257260
"print(my_cat.dumps())"
258261
]
259262
},

0 commit comments

Comments
 (0)