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

MAINT: Various minor improvements to complement previous PR #2964

Merged

Conversation

oesteban
Copy link
Contributor

Complements #2962 with comments from @mgxd that were left out and some scraps from #2959.

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

Seems mostly fine. I assume that the make specs commit is just make specs. On the whole, I'd rather not add the metadata, but if it would be a lot more work not to, I'm not super concerned.

@@ -22,7 +22,10 @@ def test_ACompCor_inputs():
),
num_components=dict(xor=['variance_threshold'], ),
pre_filter=dict(usedefault=True, ),
realigned_file=dict(mandatory=True, ),
realigned_file=dict(
extensions=None,
Copy link
Member

Choose a reason for hiding this comment

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

In the spec tests, only explicitly specified metadata has gone in, previously. Why is extensions different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an oversight from the previous PR - 6c3858a#diff-07934241447dd5e65f51347e36fdd1ffR291

Copy link
Member

Choose a reason for hiding this comment

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

Right. But, for example, exists=False is not in all of these, even though that's the default. Why is extensions=<default> in here? Is this something we can fix in the trait, instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could (and it was like that before that commit) replicate the same behavior of exists. Namely, the metadata is not propagated up to the base classes. I'm clueless about the implications of this.

For exists I just kept the original behavior.

Copy link
Member

Choose a reason for hiding this comment

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

i think the intent was not so much to track the defaults of the class, but keywords that the user put in explicitly.

i do agree that these underlying metadata (if changed internally in traits_extension) will change the behavior of interfaces and it would be good to catch them. another side note, is how we deal with and improve pickled crashfile compatibility.

if we keep old behavior, then we must commit to not changing underlying defaults in traits_extension in the future.

Copy link
Member

Choose a reason for hiding this comment

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

@satra Just to clarify, adding extensions metadata to everything is preferable?

Copy link
Member

Choose a reason for hiding this comment

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

@effigies - if we do want to take note of underlying metadata changes, we either write a set of tests for each trait type that's used in nipype, and not add the defaults to these auto-tests.

or we simply pull every default into the auto test. more generally though, my hope is that we can move closer to the kind of testing we are planning to do with the afni folks. also start splitting interfaces into their own packages.

so for now, i think this ok. but we should think this through/generalize our goals a bit better.

@codecov-io
Copy link

codecov-io commented Jul 17, 2019

Codecov Report

Merging #2964 into master will decrease coverage by 3.71%.
The diff coverage is 47.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2964      +/-   ##
==========================================
- Coverage    67.6%   63.89%   -3.72%     
==========================================
  Files         344      342       -2     
  Lines       43797    43741      -56     
  Branches     5471     5468       -3     
==========================================
- Hits        29609    27947    -1662     
- Misses      13478    14678    +1200     
- Partials      710     1116     +406
Flag Coverage Δ
#smoketests ?
#unittests 63.89% <47.82%> (-1.14%) ⬇️
Impacted Files Coverage Δ
nipype/interfaces/afni/preprocess.py 81.78% <100%> (-0.24%) ⬇️
nipype/interfaces/afni/utils.py 81.89% <100%> (ø) ⬆️
nipype/interfaces/afni/svm.py 97.67% <100%> (ø) ⬆️
nipype/interfaces/afni/base.py 70.75% <100%> (+3.81%) ⬆️
nipype/interfaces/afni/model.py 81.95% <36.84%> (-4.98%) ⬇️
nipype/interfaces/nilearn.py 40% <0%> (-56.67%) ⬇️
nipype/utils/spm_docs.py 25.92% <0%> (-44.45%) ⬇️
nipype/interfaces/freesurfer/base.py 50% <0%> (-30.51%) ⬇️
nipype/utils/logger.py 59.7% <0%> (-29.86%) ⬇️
nipype/algorithms/rapidart.py 35% <0%> (-29.42%) ⬇️
... and 62 more

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 b1eb3ee...9257f75. Read the comment docs.

@oesteban
Copy link
Contributor Author

Tests from 0052814 are all green. 👍 This is ready to go.

@oesteban
Copy link
Contributor Author

I'll merge this before diving into addressing #2944

@oesteban oesteban merged commit bfbd0ab into nipy:master Jul 17, 2019
@oesteban oesteban deleted the enh/improved-File-Directory-traits-addendum branch July 17, 2019 21:54
@effigies effigies added this to the 1.2.1 milestone Aug 16, 2019
oesteban added a commit to oesteban/nipype that referenced this pull request Oct 7, 2019
In nipy#2964 I broke some interfaces (@tsalo identified `Allineate` as one
of those) by removing the ``_get_fname`` function from the base
``AFNICommand``.

The intent was to migrate to a ``name_source``-based management of
automatically generated names, but in the case of ``Allineate``, the use
of `_get_fname` was a bit different (modifying the user-provide input
value under certain conditions to follow ANFI's ``3dAllineate``
behavior).

This PR restores the missing function. Closes nipy#3070.
oesteban added a commit to oesteban/nipype that referenced this pull request Oct 7, 2019
In nipy#2964 I broke some interfaces (@tsalo identified `Allineate` as one
of those) by removing the ``_get_fname`` function from the base
``AFNICommand``.

The intent was to migrate to a ``name_source``-based management of
automatically generated names, but in the case of ``Allineate``, the use
of `_get_fname` was a bit different (modifying the user-provide input
value under certain conditions to follow ANFI's ``3dAllineate``
behavior).

Also remove a definition of the same function for ``Deconvolve``.

This PR restores the missing function. Closes nipy#3070.
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