Skip to content

Commit

Permalink
Merge branch 'zenodo_record_ref' of https://github.com/MPoL-dev/MPoL
Browse files Browse the repository at this point in the history
…into one_dim
  • Loading branch information
jeffjennings committed Nov 1, 2023
2 parents 611fee0 + 55aad3b commit 80fd113
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ jobs:
with:
python-version: 3.8
- name: Install dependencies needed to download files
# we're just installing mpol here to reference the zenodo record number
# in __init__. below we'll reinstall for the tests.
run: |
pip install astropy
pip install .
- name: Cache/Restore the .mpol folder cache
uses: actions/cache@v3
env:
Expand Down
5 changes: 3 additions & 2 deletions docs/ci-tutorials/crossvalidation.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ from mpol import (
losses,
precomposed,
)
from mpol.__init__ import zenodo_record
# load the mock dataset of the ALMA logo
fname = download_file(
"https://zenodo.org/record/10059491/files/logo_cube.noise.npz",
f"https://zenodo.org/record/{zenodo_record}/files/logo_cube.noise.npz",
cache=True,
show_progress=True,
pkgname="mpol",
Expand Down Expand Up @@ -361,7 +362,7 @@ For the purposes of comparison, here is the image produced by the tclean algorit

```{code-cell}
fname = download_file(
"https://zenodo.org/record/10059491/files/logo_cube.tclean.fits",
f"https://zenodo.org/record/{zenodo_record}/files/logo_cube.tclean.fits",
cache=True,
show_progress=True,
pkgname="mpol",
Expand Down
3 changes: 2 additions & 1 deletion docs/ci-tutorials/fakedata.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,11 @@ Therefore, we always recommend generating fake data using $u,v$ distributions fr

```{code-cell} ipython3
from astropy.utils.data import download_file
from mpol.__init__ import zenodo_record
# load the mock dataset of the ALMA logo
fname = download_file(
"https://zenodo.org/record/10059491/files/logo_cube.noise.npz",
f"https://zenodo.org/record/{zenodo_record}/files/logo_cube.noise.npz",
cache=True,
show_progress=True,
pkgname="mpol",
Expand Down
3 changes: 2 additions & 1 deletion docs/ci-tutorials/gridder.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ It's important to remember that MPoL follows the standard baseline convention as
import matplotlib.pyplot as plt
import numpy as np
from astropy.utils.data import download_file
from mpol.__init__ import zenodo_record
```

```{code-cell}
# load the mock dataset of the ALMA logo
fname = download_file(
"https://zenodo.org/record/10059491/files/logo_cube.noise.npz",
f"https://zenodo.org/record/{zenodo_record}/files/logo_cube.noise.npz",
cache=True,
show_progress=True,
pkgname="mpol",
Expand Down
3 changes: 2 additions & 1 deletion docs/ci-tutorials/initializedirtyimage.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ from astropy.utils.data import download_file

```{code-cell}
from mpol import coordinates, gridding, losses, precomposed, utils
from mpol.__init__ import zenodo_record
```

When saving and loading a model, it is important to make sure that ``cell_size``, ``nchan``, and ``npix`` remain the same. More info on coordinates can be found in {class}`mpol.coordinates.GridCoords`.

```{code-cell}
# load the mock dataset of the ALMA logo
fname = download_file(
"https://zenodo.org/record/10059491/files/logo_cube.noise.npz",
f"https://zenodo.org/record/{zenodo_record}/files/logo_cube.noise.npz",
cache=True,
show_progress=True,
pkgname="mpol",
Expand Down
3 changes: 2 additions & 1 deletion docs/ci-tutorials/loose-visibilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ and the relevant MPoL modules

```{code-cell}
from mpol import coordinates, gridding, losses, precomposed, utils, images, fourier
from mpol.__init__ import zenodo_record
```

and loading the dataset

```{code-cell}
# load the mock dataset of the ALMA logo
fname = download_file(
"https://zenodo.org/record/10059491/files/logo_cube.noise.npz",
f"https://zenodo.org/record/{zenodo_record}/files/logo_cube.noise.npz",
cache=True,
show_progress=True,
pkgname="mpol",
Expand Down
3 changes: 2 additions & 1 deletion docs/ci-tutorials/optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ from IPython.display import SVG, display

```{code-cell} ipython3
from mpol import coordinates, fourier, gridding, losses, precomposed, utils
from mpol.__init__ import zenodo_record
```

```{code-cell} ipython3
# load the mock dataset of the ALMA logo
fname = download_file(
"https://zenodo.org/record/10059491/files/logo_cube.noise.npz",
f"https://zenodo.org/record/{zenodo_record}/files/logo_cube.noise.npz",
cache=True,
show_progress=True,
pkgname="mpol",
Expand Down
4 changes: 2 additions & 2 deletions docs/download_external_files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from astropy.utils.data import download_file
from mpol.__init__ import zenodo_record

version = 10059491
slug = "https://zenodo.org/record/{:d}/files/{:}"

fnames = [
Expand All @@ -10,7 +10,7 @@
]

for fname in fnames:
url = slug.format(version, fname)
url = slug.format(zenodo_record, fname)
download_file(
url,
cache=True,
Expand Down
1 change: 1 addition & 0 deletions src/mpol/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__version__ = "0.1.13"
zenodo_record = 10064221
5 changes: 2 additions & 3 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from astropy.utils.data import download_file

from mpol import coordinates, gridding

zenodo_version = 10059491
from mpol.__init__ import zenodo_record

# We need a fixture which provides mock visibilities of the sort we'd
# expect from visread, but *without* the CASA dependency.
Expand All @@ -14,7 +13,7 @@
def mock_visibility_archive():
# use astropy routines to cache data
fname = download_file(
"https://zenodo.org/record/{:d}/files/logo_cube.noise.npz".format(zenodo_version),
f"https://zenodo.org/record/{zenodo_record}/files/logo_cube.noise.npz",
cache=True,
pkgname="mpol",
)
Expand Down

0 comments on commit 80fd113

Please sign in to comment.