Skip to content

Extra keywords and frequency differencing#91

Open
no-lex wants to merge 40 commits intomainfrom
extra_keywords
Open

Extra keywords and frequency differencing#91
no-lex wants to merge 40 commits intomainfrom
extra_keywords

Conversation

@no-lex
Copy link
Copy Markdown
Collaborator

@no-lex no-lex commented Feb 22, 2021

This pull request adds a dif_freq keyword and frequency differencing mode (the natural compliment to the time differencing mode defaulted to), and this mode is properly represented between INS and SS objects. For backwards compatibility, the time differencing is kept as diff while the diff_freq is indicated for frequency differencing.

@no-lex no-lex marked this pull request as ready for review March 5, 2021 21:07
Comment thread SSINS/sky_subtract.py Outdated
@codecov-io

This comment has been minimized.

Comment thread SSINS/sky_subtract.py Outdated
Comment thread SSINS/sky_subtract.py
Comment thread SSINS/sky_subtract.py Outdated
Comment thread SSINS/sky_subtract.py Outdated
no-lex added 26 commits October 28, 2021 23:35
to indicate when diff_freq on load has been done
singletons should be compared with is, not ==
no implementation yet--test driven development
@no-lex
Copy link
Copy Markdown
Collaborator Author

no-lex commented Oct 29, 2021

Rebased over master at 289ba2a.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 12, 2021

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (289ba2a) to head (1cfb820).
⚠️ Report is 161 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #91   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          857       904   +47     
=========================================
+ Hits           857       904   +47     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread SSINS/tests/test_INS.py
# Check that the weights summed correctly
assert np.all(test_weights == ins.weights_array), "Weights did not sum properly"

def test_extra_keywords():
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This test doesn't appear to check whether diff_freq is set, etc.

Comment thread SSINS/tests/test_INS.py
ins.metric_ms = ins.mean_subtract()
assert np.all(ins.metric_ms.mask), "The metric_ms array was not all masked"

def test_flag_uvf_freq():
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This test checks the error handling, but I don't see that it ever checks that the answer is right when the right calls are made.

Comment thread SSINS/tests/test_INS.py
assert np.all(combo_ins.metric_array.data == truth_ins.metric_array.data)
assert np.all(combo_ins.metric_array.mask == truth_ins.metric_array.mask)

def test_mask_to_flags_2():
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This test also does not check anything other than that the code runs through. I think the smaller test files should support a "gets the correct answer" test. If not, you can use "select-on-read" functionality to make a testable object where it is not too hard to calculate the answer ahead of time through alternate means (you could even modify the starting data array to make this easy).

Comment thread SSINS/tests/test_SS.py
ss.read(testfile, read_data=True, diff=False, diff_freq=False)
ss.apply_flags(flag_choice='original')
assert ss.flag_array is not None
temp_array = np.logical_or(ss.flag_array, ss.flag_array)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This line and those below confuse me. This line should just return a copy of ss.flag_array, since ORing an array with itself will just return an array with 1 everywhere that the original array was nonzero and 0 otherwise, and the flag array is already boolean. Due to this, the next two lines are guaranteed to satisfy the assertion, since ss.flag_array[::2] is now just a subarray of temp_array. Maybe you meant to index the ss.flag_array's being fed into the np.logical_or call, e.g. `np.logical_or(ss.flag_array[:, :-1], ss.flag_array[:, 1:])?

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.

4 participants