Skip to content

Conversation

matthew-brett
Copy link
Member

Add 'caching='fill'|'unchanged' keyword to get_data method.

Add in_memory property to tell user whether image already has an in-memory copy of the data.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling c781c41 on matthew-brett:in-memory into 1ca2da4 on nipy:master.

`in_memory` property is True if image has an array as its data object,
or if a proxy image has been cached.
Caching flag can take values 'fill' and 'unchanged'.
@matthew-brett matthew-brett changed the title WIP: implementation of in_memory property MRG: implementation of in_memory property Nov 25, 2014
@matthew-brett matthew-brett changed the title MRG: implementation of in_memory property MRG: API to help modify image caching Nov 25, 2014
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling a8e5b82 on matthew-brett:in-memory into 7e522a2 on nipy:master.

@matthew-brett
Copy link
Member Author

Guys - I would really appreciate a review here. Any takers?

Copy link
Contributor

Choose a reason for hiding this comment

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

caching not in :)

@larsoner
Copy link
Contributor

Other than my minor comments LGTM, but I haven't followed the related issues too closely.

Suggested by Eric L from PR review.
@matthew-brett
Copy link
Member Author

Rewrite clearer for docstring?

@larsoner
Copy link
Contributor

Yep, thanks!

matthew-brett added a commit that referenced this pull request Nov 27, 2014
MRG: API to help modify image caching

Add 'caching='fill'|'unchanged' keyword to get_data method.

Add in_memory property to tell user whether image already has an in-memory copy of the data.
@matthew-brett matthew-brett merged commit 0cfd094 into nipy:master Nov 27, 2014
@matthew-brett matthew-brett deleted the in-memory branch November 27, 2014 07:06
Copy link

Choose a reason for hiding this comment

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

@matthew-brett Reading this explanatory paragraph, I think we failed to converge on the optimal API.

Copy link
Member Author

Choose a reason for hiding this comment

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

Aha - could you say more? What were you thinking would be different?

Copy link

Choose a reason for hiding this comment

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

I guess I could just be a very naive user, but I cannot figure out what this paragraph is telling me--it seems terribly complicated! I have no idea how I would go about using this flag correctly.

@matthew-brett
Copy link
Member Author

Can you give any help as to what the paragraph should say?

Did I explain the idea of in-memory and proxy images well enough in the docs I posted and the list?

@GaelVaroquaux - would you mind taking a look at this docstring?

@stefanv
Copy link

stefanv commented Nov 28, 2014

Just ask a few random people to read this, and see what they say (quoted from the current docstring):

Once the data has been cached and returned from a proxy array, the
cached array can be modified by modifying the returned array, because
the returned array is a reference to the array in the cache.

@matthew-brett
Copy link
Member Author

Is this any better? #287

grlee77 pushed a commit to grlee77/nibabel that referenced this pull request Mar 15, 2016
MRG: API to help modify image caching

Add 'caching='fill'|'unchanged' keyword to get_data method.

Add in_memory property to tell user whether image already has an in-memory copy of the data.
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