Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP type coverage for core modules #244

Merged
merged 24 commits into from
Dec 27, 2023
Merged

WIP type coverage for core modules #244

merged 24 commits into from
Dec 27, 2023

Conversation

iancze
Copy link
Collaborator

@iancze iancze commented Dec 26, 2023

  • Closes Getting started with type hints #54 Added type hints for core modules. This should improve stability of core routines and help users when writing code using MPoL in an IDE.
  • Closes Inconsistent documentation for classes with .from_image_properties class method #233. Removed convenience classmethods from_image_properties from across the code base. The recommended workflow is to create a :class:mpol.coordinates.GridCoords object and pass that to instantiate these objects as needed, rather than passing cell_size and npix separately. For nearly all but trivially short workflows, this simplifies the number of variables the user needs to keep track and pass around revealing the central role of the :class:mpol.coordinates.GridCoords object and its useful attributes for image extent, visibility extent, etc. Most importantly, this significantly reduces the size of the codebase and the burden to maintain, test, and document multiple entry points to key nn.modules. We removed from_image_properties from
    • :class:mpol.datasets.GriddedDataset
    • :class:mpol.datasets.Dartboard
    • :class:mpol.fourier.NuFFT
    • :class:mpol.fourier.NuFFTCached
    • :class:mpol.fourier.FourierCube
    • :class:mpol.gridding.GridderBase
    • :class:mpol.gridding.DataAverager
    • :class:mpol.gridding.DirtyImager
    • :class:mpol.images.BaseCube
    • :class:mpol.images.ImageCube
  • Closes Make images.ImageCube passthrough default, remove nn.Parameter from ImageCube #246 Make the passthrough behaviour of :class:mpol.images.ImageCube the default and removed this parameter entirely. Previously, it was possible to have :class:mpol.images.ImageCube act as a layer with nn.Parameters. This functionality has effectively been replaced since the introduction of :class:mpol.images.BaseCube which provides a more useful way to parameterize pixel values. If a one-to-one mapping (including negative pixels) from nn.Parameters to output tensor is desired, then one can specify pixel_mapping=lambda x : x when instantiating :class:mpol.images.BaseCube.
  • Removed unused routine mpol.utils.log_stretch.
  • Made some progress converting docstrings from "Google" style format to "NumPy" style format. Ian is now convinced that NumPy style format is more readable for the type of docstrings we write in MPoL. We usually require long type definitions and long argument descriptions, and the extra indentation required for Google makes these very scrunched.

@iancze iancze marked this pull request as ready for review December 27, 2023 22:27
@iancze iancze merged commit 7701e1a into WIP-v0.3 Dec 27, 2023
3 checks passed
@iancze iancze deleted the types branch December 27, 2023 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant