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

BF: AnnotatePaths #1881

Merged
merged 1 commit into from
Oct 13, 2017
Merged

BF: AnnotatePaths #1881

merged 1 commit into from
Oct 13, 2017

Conversation

bpoldrack
Copy link
Member

@bpoldrack bpoldrack commented Oct 6, 2017

This pull request fixes #1880.

To be more specific:
If 'modified' was set, AnnotatePaths failed to report on unavailable paths.

Please have a look @mih . You might want to say something about the approach and the comments I left in the code.

# TODO: That `path` in following line seems to be incorrect;
# we are operating on `r` or `p` respectively. Guess it
# should be `r`.
# Figure out, whether or not to report on the resolved one:
Copy link
Member

Choose a reason for hiding this comment

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

Agree. But also cannot tell immediately what is the correct fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I'll go for the unresolved one for now, since we probably want to report on the original input. If that turns out to be wrong, we'll notice, I guess. :-)

for r in requested_paths:
if not lexists(r['path'] if isinstance(r, dict) else r):
preserved_paths.append(r)

Copy link
Member

Choose a reason for hiding this comment

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

I aggree with the approach, but this should be a simple list comprehension, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Will change.

from itertools import chain
# re-append the preserved paths:
requested_paths = chain(requested_paths, iter(preserved_paths))

Copy link
Member

Choose a reason for hiding this comment

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

Aren't these two plain (non-nested) lists? If so, why not just requested_paths.extend(preserved_paths)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope. After modification detection requested_paths is a generator.

Copy link
Member

Choose a reason for hiding this comment

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

I knew there would be something. ACK.

@codecov-io
Copy link

codecov-io commented Oct 6, 2017

Codecov Report

Merging #1881 into master will increase coverage by 36.89%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1881       +/-   ##
===========================================
+ Coverage   48.83%   85.72%   +36.89%     
===========================================
  Files         263      265        +2     
  Lines       29660    31630     +1970     
===========================================
+ Hits        14484    27115    +12631     
+ Misses      15176     4515    -10661
Impacted Files Coverage Δ
datalad/interface/annotate_paths.py 92.04% <100%> (+6.71%) ⬆️
tools/coverage-bin/git-annex-remote-datalad 100% <0%> (ø)
benchmarks/core.py 18.89% <0%> (ø)
datalad/crawler/dbs/base.py 88.23% <0%> (+0.84%) ⬆️
datalad/tests/utils_testrepos.py 93.96% <0%> (+0.86%) ⬆️
datalad/crawler/pipelines/tests/test_openfmri.py 90.72% <0%> (+2.01%) ⬆️
datalad/support/s3.py 27.45% <0%> (+2.94%) ⬆️
datalad/metadata/__init__.py 91.89% <0%> (+3.37%) ⬆️
datalad/interface/results.py 97.41% <0%> (+3.44%) ⬆️
datalad/support/param.py 100% <0%> (+3.84%) ⬆️
... and 210 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 572a0b3...08718be. Read the comment docs.

@bpoldrack
Copy link
Member Author

I guess those buildbots have some trouble again, @yarikoptic ?

@yarikoptic
Copy link
Member

Crap sorry... I did restart firewall, but then did restart buildbots, thought it is all ok, will check

@mih
Copy link
Member

mih commented Oct 11, 2017

@bpoldrack can you trigger the buildbot tests please?

@bpoldrack
Copy link
Member Author

Just amended empty to trigger them, but ...
What the hell? Now a lot of shit fails to clone from datasets.datalad.org.
Travis passed before, so I doubt there's anything wrong with that PR.
@yarikoptic : Help, please.

@bpoldrack
Copy link
Member Author

FTR: Happens in other branches, too.

@yarikoptic
Copy link
Member

Fwiw the datasets.datalad.org was fixed, so now it should be genuine failures

@bpoldrack
Copy link
Member Author

Nope. The only failure in Travis is a "connection broken" when trying to download PyGithub ;-)

@bpoldrack bpoldrack merged commit 10d1010 into datalad:master Oct 13, 2017
@yarikoptic yarikoptic added this to the Release 0.9.2 milestone Jan 25, 2018
@bpoldrack bpoldrack deleted the bf-annotate-paths branch September 2, 2020 10:20
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.

add doesn't error out if asked to add some bogus path
4 participants