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

Spectrum refactoring, Spectrum2DCollection #305

Merged
merged 37 commits into from
Sep 26, 2024
Merged

Commits on Sep 18, 2024

  1. Create a Mixin for some Spectrum1DCollection methods, rewrite select()

    - This version of select() should be more robust in dealing with
      parameters that exist in "top level" of metadata dict
    - I hope it is also easier to understand
    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    136fca5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e825e69 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    067339a View commit details
    Browse the repository at this point in the history
  4. Update Spectrum methods to use Quantity rather than *ureg.

    Some of this was done in another branch, and this one rebased
    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    28a5b1e View commit details
    Browse the repository at this point in the history
  5. Pylinting

    Pylint doesn't like the call to ._set_spectrum_data on another class
    instance because it doesn't understand that this instance was just
    created with the current class. I think that means the warning is ok
    to suppress.
    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    a47778f View commit details
    Browse the repository at this point in the history
  6. Reimplement spectrum group_by with toolz, FP style

    This adds toolz as a dependency to the main package. We don't
    anticipate that causing a lot of problems; it is a small, stable,
    pure-python library also available on conda-forge.
    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    f98c053 View commit details
    Browse the repository at this point in the history
  7. Tidy up a bit

    Linters hate the named lambdas. I think they are quite nice because
    they are compact and immediately draw attention to the "one-liner"
    they attach a name to...
    
    but maybe the more explicit form with type hints will make it easier
    for someone to understand in future.
    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    5b29747 View commit details
    Browse the repository at this point in the history
  8. Standardise import order

    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    1159b5c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    e4b4626 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    01469f8 View commit details
    Browse the repository at this point in the history
  11. Drop unused import

    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    44ed62b View commit details
    Browse the repository at this point in the history
  12. Refactor __getitem__ and move into SpectrumCollectionMixin

    This structure seems a bit more legible and should reduce redundancy
    in Spectrum2DCollection
    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    a7ce9db View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    0e05e0e View commit details
    Browse the repository at this point in the history
  14. More linting

    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    79ff127 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    a041d72 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    35544a1 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    c445fb9 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    e9bff3d View commit details
    Browse the repository at this point in the history
  19. Linting

    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    ae3648b View commit details
    Browse the repository at this point in the history
  20. More linting

    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    4659cad View commit details
    Browse the repository at this point in the history
  21. Refactor spectrum item data access to methods

    Collect the axis-twiddling code in one place to improve readability.
    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    e32aa45 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    fb87b7d View commit details
    Browse the repository at this point in the history
  23. Spectrum2DCollection; more testing, fix sum()

    - Refactor re-used data import to use pytest fixture
    - Remove initial from_spectra test; new one covers it all
    - Test from_spectra with inconsistent input
    - Test mixin-supplied methods
    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    6235aab View commit details
    Browse the repository at this point in the history
  24. Fix numpy/pint warnings

    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    e5c9756 View commit details
    Browse the repository at this point in the history
  25. Linting

    ajjackson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    56dfcb9 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2024

  1. Apply suggestions from code review

    Make things a little cleaner and more idiomatic
    
    Co-authored-by: Jacob Wilkins <[email protected]>
    ajjackson and oerc0122 authored Sep 19, 2024
    Configuration menu
    Copy the full SHA
    ade79e1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3ecad2c View commit details
    Browse the repository at this point in the history
  3. Numpy style docstring

    ajjackson committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    8631bc4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    eb808ba View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    19f36ab View commit details
    Browse the repository at this point in the history
  6. Remove unnecessary parens

    ajjackson committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    5dda596 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b647cb7 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2024

  1. Use keyfilter from toolz

    - This avoids some of the repetition in dict comprehensions to remove
      an element
    - Here we also slightly rework _combine_metadata so it is clearer what
      each variable represents.
    ajjackson committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    aaaa25a View commit details
    Browse the repository at this point in the history
  2. Simplify _get_item_metadata

    list comprehension is little clunky but avoids the 1-length special
    case: cleaner overall
    ajjackson committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    87f32a0 View commit details
    Browse the repository at this point in the history
  3. Drop unused import

    ajjackson committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    b682432 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2024

  1. More tidying for legibility

    Via discussion / pair-programming with @oerc0122
    
    - Use native dict comprehension over keyfilter in iter_metadata: it's
      a bit ugly but no more complicated, and should be easier to read
      "casually"
    
    - Clearer comment re: value-pair combination
    
    - Replace a lambda with named partial function and toolz complement
    ajjackson committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    0f7ec81 View commit details
    Browse the repository at this point in the history
  2. Remove redundant .keys() when iterating over dict

    Co-authored-by: Jacob Wilkins <[email protected]>
    ajjackson and oerc0122 authored Sep 26, 2024
    Configuration menu
    Copy the full SHA
    ef314a0 View commit details
    Browse the repository at this point in the history