From 61661c5d6daa829ddbb94669c62af973ae82a495 Mon Sep 17 00:00:00 2001 From: Ian Czekala Date: Sun, 19 Feb 2023 13:11:37 -0500 Subject: [PATCH] removed GriddedResidualConnector from crossvalidation.md --- .pre-commit-config.yaml | 6 +++--- docs/changelog.md | 4 ++++ docs/ci-tutorials/crossvalidation.md | 29 ++++++++-------------------- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5091f4f8..ec5d18b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -12,11 +12,11 @@ repos: - id: detect-private-key - id: name-tests-test - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.1.0 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.8.0 + rev: 5.12.0 hooks: - id: isort args: [] diff --git a/docs/changelog.md b/docs/changelog.md index 95b9f32c..884c8dae 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,10 @@ # Changelog +## v0.1.4 + +- Removed the `GriddedResidualConnector` class and the `src/connectors.py` module. Moved `index_vis` to `datasets.py`. + ## v0.1.3 - Added the {func}`mpol.fourier.make_fake_data` routine and the [Mock Data tutorial](ci-tutorials/fakedata.md). diff --git a/docs/ci-tutorials/crossvalidation.md b/docs/ci-tutorials/crossvalidation.md index c6866f2e..9cf17416 100644 --- a/docs/ci-tutorials/crossvalidation.md +++ b/docs/ci-tutorials/crossvalidation.md @@ -39,7 +39,6 @@ from astropy.utils.data import download_file from torch.utils.tensorboard import SummaryWriter from mpol import ( - connectors, coordinates, crossval, datasets, @@ -184,43 +183,31 @@ flayer.forward(torch.zeros(dset.nchan, coords.npix, coords.npix)) The following plots visualize how we've split up the data. For each $K$-fold, we have the "training" visibilities, the dirty image corresponding to those training visibilities, and the "test" visibilities which will be used to evaluate the predictive ability of the model. ```{code-cell} -fig, ax = plt.subplots(nrows=k, ncols=3, figsize=(6, 10)) +fig, ax = plt.subplots(nrows=k, ncols=2, figsize=(4, 10)) for i, (train_subset, test_subset) in enumerate(k_fold_datasets): - rtrain = connectors.GriddedResidualConnector(flayer, train_subset) - rtrain.forward() - rtest = connectors.GriddedResidualConnector(flayer, test_subset) - rtest.forward() + # train_subset and test_subset are `GriddedDataset`s - vis_ext = rtrain.coords.vis_ext - img_ext = rtrain.coords.img_ext - - train_mask = rtrain.ground_mask[0] - train_chan = rtrain.sky_cube[0] - - test_mask = rtest.ground_mask[0] - test_chan = rtest.sky_cube[0] + train_mask = train_subset.ground_mask[0] + test_mask = test_subset.ground_mask[0] ax[i, 0].imshow( train_mask.detach().numpy(), interpolation="none", origin="lower", - extent=vis_ext, + extent=coords.vis_ext, cmap="GnBu", ) - ax[i, 1].imshow(train_chan.detach().numpy(), origin="lower", extent=img_ext) - - ax[i, 2].imshow( - test_mask.detach().numpy(), origin="lower", extent=vis_ext, cmap="GnBu" + ax[i, 1].imshow( + test_mask.detach().numpy(), origin="lower", extent=coords.vis_ext, cmap="GnBu" ) ax[i, 0].set_ylabel("k-fold {:}".format(i)) ax[0, 0].set_title("train mask") -ax[0, 1].set_title("train dirty img.") -ax[0, 2].set_title("test mask") +ax[0, 1].set_title("test mask") for a in ax.flatten(): a.xaxis.set_ticklabels([])