-
Notifications
You must be signed in to change notification settings - Fork 28
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
+^ look_in_catalog avoid unrelated keys for cat_type #1506
+^ look_in_catalog avoid unrelated keys for cat_type #1506
Conversation
Obviously need to run through the bug-fix checklist. Left it up to the reviewer to consider the style of the commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @radonnachie - thanks for catching this, nominally all entries inside of the phase center dictionaries are supposed to be present, although it's possible that's not actually documented in the appropriate places. Long-term there's a plan to move the catalog to an object, but for now we're trying to minimize changes to the existing stuff to make that transition easier. I think there's a much easier way to wrap the problem you've nominally come across (a 1-line replacement) which I've added below. Note that we normally also expect bug-fix PRs to include a test which fails with the older code, let me know if you need help putting that together.
@kartographer for the test, how should I include the data? I can include the traceback in a second |
Including the full error here:
|
I'll just setup a test with simple dicts that emulate the scenario. |
I'm thinking that instead of testing that |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1506 +/- ##
=======================================
Coverage 99.93% 99.93%
=======================================
Files 63 63
Lines 21834 21834
=======================================
Hits 21819 21819
Misses 15 15 ☔ View full report in Codecov by Sentry. |
I tried adding a test. Not sure how robust it is, hopefully serves as an indication of what we're struggling with. |
@radonnachie -- it looks like the test is actually failing for unrelated reasons here, but let me see if I can spin up a simple fix... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, this is a much more focused test that I've at least verified in an ipython shell fails with the old code and works with the new code.
@wfarah - just to clarify here, we usually just want to see a test that should fail in the old code. We don't necessarily need to see a traceback (though it is helpful sometimes!), but usually during review whoever is looking at the PR will at least make sure that the test appears to cover the nominal scenario. |
25ddde4
to
5911daf
Compare
Looks like it's failing the pre-commit linting check. (The warning test failure and hera_cal failures are unrelated known issues and are not required to pass). There are directions in the readme to install the pre-commit hook to prevent pushing code that will fail the CI. |
5911daf
to
6591b80
Compare
81d1984
to
6789974
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good -- just one thing missing: an entry in the change log =)
Right, I've added a somewhat verbose and cumbersome entry to the changelog. Trust it's good enough... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more minor fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done -- thanks @radonnachie!
c4a1f1d
into
RadioAstronomySoftwareGroup:main
Thank you for your help and patience. |
@radonnachie - can you put in an issue so that we can follow along (and potentially help)? |
Description
The
look_in_catalog
function never considered the cat_type when accessing keys, leading to keys unrelated to the cat_type being hard-accessed.Motivation and Context
When adding multiple UV objects, the
look_in_catalog
hit an error trying to access the "cat_times" key within the phase_catalog dict-entry. The entries are all of "sidereal" type though, which isn't expected to have a "cat_times" key.Types of changes
Checklist:
Bug fix checklist:
New feature checklist:
Breaking change checklist:
Documentation change checklist:
Version change checklist:
Build or continuous integration change checklist: