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

FIX: Pass new variable args as kwargs in split() #386

Merged
merged 2 commits into from
Feb 11, 2019

Conversation

effigies
Copy link
Collaborator

SimpleVariable.__init__ does not take a run_info parameter, while SparseRunVariable.__init__ does. Further, the order of the other variables is inconsistent, so subclassing works poorly. The fix in #353 used positional arguments, which worked for SparseRunVariable, but failed for SimpleVariable. This fix uses kwargs to avoid the ordering problem. Because SparseRunVariable.__init__ accepts a **kwargs parameter and does nothing with it, this is safe.

Related to #352/#353. I think there was another issue where I ran into this, but I can't find it right now.

Cherry-picked from #376.

@codecov
Copy link

codecov bot commented Feb 11, 2019

Codecov Report

Merging #386 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #386      +/-   ##
==========================================
- Coverage   73.79%   73.78%   -0.02%     
==========================================
  Files          23       23              
  Lines        2492     2491       -1     
  Branches      621      621              
==========================================
- Hits         1839     1838       -1     
  Misses        471      471              
  Partials      182      182
Flag Coverage Δ
#unittests 73.78% <100%> (-0.02%) ⬇️
Impacted Files Coverage Δ
bids/variables/variables.py 88.39% <100%> (-0.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 13c857f...61e4480. Read the comment docs.

@codecov
Copy link

codecov bot commented Feb 11, 2019

Codecov Report

Merging #386 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #386      +/-   ##
==========================================
- Coverage   73.79%   73.78%   -0.02%     
==========================================
  Files          23       23              
  Lines        2492     2491       -1     
  Branches      621      621              
==========================================
- Hits         1839     1838       -1     
  Misses        471      471              
  Partials      182      182
Flag Coverage Δ
#unittests 73.78% <100%> (-0.02%) ⬇️
Impacted Files Coverage Δ
bids/variables/kollekshuns.py 83.57% <100%> (ø) ⬆️
bids/variables/io.py 75.12% <100%> (ø) ⬆️
bids/analysis/transformations/compute.py 86.66% <100%> (ø) ⬆️
bids/variables/variables.py 88.39% <100%> (-0.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 13c857f...687407a. Read the comment docs.

@tyarkoni
Copy link
Collaborator

LGTM, thanks!

@tyarkoni
Copy link
Collaborator

Oh, one other thought though: I recall there being other places where we pass positional arguments to variable inits rather than keyword args. I'm generally in favor of using keyword args throughout the codebase, so if you haven't already, it might be worth a quick sweep to see if there are other places the same changes make sense.

@effigies
Copy link
Collaborator Author

Just went ahead and mass-changed to kwarg-only calls.

@effigies effigies merged commit 45881ff into bids-standard:master Feb 11, 2019
@effigies effigies deleted the fix/split_info branch February 13, 2019 21:05
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