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

CHG: Capture explicit default settings if also in cfg #284

Merged
merged 2 commits into from
May 25, 2022
Merged

Conversation

tensionhead
Copy link
Contributor

@tensionhead tensionhead commented May 23, 2022

  • if the user sets a default value explicitly, e.i. keeptrials=True,
    but keeptrials also appears in a provided cfg structure, raise a
    SPYValueError
  • both cfg and explicit keywords are allowed, as long as they are
    mutually exclusive, e.i. func(data, cfg={'pad' : 3}, keeptrials=False) is valid
  • minor fix: 'pad' kw added to valid kws for MultiTaperFFT

On branch issue-278
Your branch is up to date with 'origin/dev'.

Changes to be committed:
modified: syncopy/shared/kwarg_decorators.py
modified: syncopy/specest/compRoutines.py

closes #278

Author Guidelines

  • Is the change set < 400 lines?
  • Was the code checked for memory leaks/performance bottlenecks?
  • Is the code running locally and on the ESI cluster?
  • Is the code running on all supported platforms?

Reviewer Checklist

  • Are testing routines present?
  • Do parallel loops have a set length and correct termination conditions?
  • Do objects in the global package namespace perform proper parsing of their input?
  • Do code-blocks provide novel functionality, i.e., no re-factoring using builtin/external packages possible?
  • Code layout
    • Is the code PEP8 compliant?
    • Does the code adhere to agreed-upon naming conventions?
    • Are keywords clearly named and easy to understand?
    • No commented-out code?
  • Are all docstrings complete and accurate?

- if the user sets a default value explicitly, e.i. `keeptrials=True`,
but `keeptrials` also appears in a provided `cfg` structure, raise a
`SPYValueError`
- both `cfg` and explicit keywords are allowed, as long as they are
mutually exclusive, e.i. `func(data, cfg={'pad' : 3},
keeptrials=False)` is valid
- minor fix: `'pad'` kw added to valid kws for MultiTaperFFT

On branch issue-278
Your branch is up to date with 'origin/dev'.

Changes to be committed:
	modified:   syncopy/shared/kwarg_decorators.py
	modified:   syncopy/specest/compRoutines.py
@tensionhead tensionhead requested a review from pantaray May 23, 2022 09:32
- the general check for duplicated parameter settings cfg/kw is not needed
for 'data'/'dataset' as those get special treatment anyways

On branch issue-278
Your branch is ahead of 'origin/dev' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
	modified:   syncopy/shared/kwarg_decorators.py
	modified:   syncopy/tests/test_decorators.py
@codecov
Copy link

codecov bot commented May 23, 2022

Codecov Report

Merging #284 (133aa8f) into dev (4f43014) will increase coverage by 0.23%.
The diff coverage is 77.77%.

@@            Coverage Diff             @@
##              dev     #284      +/-   ##
==========================================
+ Coverage   68.19%   68.43%   +0.23%     
==========================================
  Files          67       67              
  Lines        7630     7634       +4     
  Branches     1581     1582       +1     
==========================================
+ Hits         5203     5224      +21     
+ Misses       2067     2054      -13     
+ Partials      360      356       -4     
Impacted Files Coverage Δ
syncopy/shared/kwarg_decorators.py 80.91% <75.00%> (-0.53%) ⬇️
syncopy/specest/compRoutines.py 77.02% <100.00%> (+2.12%) ⬆️
syncopy/shared/computational_routine.py 78.70% <0.00%> (+0.51%) ⬆️
syncopy/specest/freqanalysis.py 63.38% <0.00%> (+4.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f43014...133aa8f. Read the comment docs.

Copy link
Member

@pantaray pantaray left a comment

Choose a reason for hiding this comment

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

Nice and clean - looks good to me!

@pantaray pantaray self-assigned this May 25, 2022
@pantaray pantaray merged commit 34f5b5a into dev May 25, 2022
@tensionhead tensionhead deleted the issue-278 branch June 3, 2022 12:08
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.

2 participants