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

Helper function for SSObject, test improvements #94

Merged
merged 11 commits into from
Mar 28, 2024

Conversation

astronomerritt
Copy link
Collaborator

@astronomerritt astronomerritt commented Mar 28, 2024

Fixes #77.

The filter-dependent values on SSObject can now be very easily retrieved in exactly the same manner as filter-specific observations:

test_planetoid.SSObject_in_filter("r").H

You may note I have done this in a rather involved way: I have created a new dataclass just to store these values (FilterDependentSSO) and now SSObject stores a list of these, one per filter. This was to maintain consistency on the user end: observations_in_filter() and SSObject_in_filter() both return objects, which thus have their values accessed in exactly the same way. It's also consistent with how AdlerPlanetoid stores the Observations objects.

Also:

  • Unit test for new functionSSObject_in_filter()
  • Improved unit test for observations_in_filter() and AdlerPlanetoid.construct_from_SQL()
  • Fixed other unit tests to reflect slightly changed behaviour re: SSObject
  • Added some no-cover statements to lines which cannot be tested
  • Removed the dummy science function
  • Altered readme to reflect above removal
  • Banned adler.py from code coverage reports

Review Checklist for Source Code Changes

  • Does pip install still work?
  • Have you written a unit test for any new functions?
  • Do all the units tests run successfully?
  • Does adler run successfully on a test set of input files/databases?
  • Have you used black on the files you have updated to confirm python programming style guide enforcement?

@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.29%. Comparing base (7f0094b) to head (64adfba).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #94      +/-   ##
==========================================
+ Coverage   84.71%   93.29%   +8.57%     
==========================================
  Files          14       12       -2     
  Lines         373      343      -30     
==========================================
+ Hits          316      320       +4     
+ Misses         57       23      -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@astronomerritt astronomerritt changed the title Helper function for SSObject Helper function for SSObject, test improvements Mar 28, 2024
@astronomerritt astronomerritt marked this pull request as ready for review March 28, 2024 14:03
@astronomerritt astronomerritt requested a review from jrob93 March 28, 2024 14:03
Copy link
Collaborator

@jrob93 jrob93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this and it looks great. I appreciate you getting it working very similar to the other functions! My commit has updated the example notebook to use this (and also to roll loading data from local file/RSP into one nb)

@astronomerritt
Copy link
Collaborator Author

Awesome, thanks!

@astronomerritt astronomerritt merged commit 42e180d into main Mar 28, 2024
6 checks passed
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.

Retrieve SSObject models by filter
3 participants