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

dask: Data memory/disk #387

Merged
merged 14 commits into from
Apr 28, 2022

Conversation

davidhassell
Copy link
Collaborator

No description provided.

@davidhassell
Copy link
Collaborator Author

See new docs in __init__ for context.

Copy link
Member

@sadielbartholomew sadielbartholomew left a comment

Choose a reason for hiding this comment

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

Perhaps I am missing something here, but the deprecation doesn't seem to be manifesting for in_memory, though it is working absolutely fine for the other methods and properties deprecated here, as indicated for one example below (and I have double checked the install of this branch is OK to be sure)? E.g:

>>> d.to_disk()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sadie/cf-python/cf/data/mixin/deprecations.py", line 436, in to_disk
    _DEPRECATION_ERROR_METHOD(
  File "/home/sadie/cf-python/cf/functions.py", line 3197, in _DEPRECATION_ERROR_METHOD
    raise DeprecationError(
cf.functions.DeprecationError: Data method 'to_disk' has been deprecated at version TODODASK and is no longer available and will be removed at version 5.0.0. 
>>>
>>> d.to_memory()
Traceback (most recent call last):
  File "/home/sadie/cfdm/cfdm/core/abstract/container.py", line 262, in _get_component
    return self._components[component]
KeyError: 'array'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sadie/cfdm/cfdm/decorators.py", line 44, in inplace_wrapper
    processed_copy = operation_method(self, *args, **kwargs)
  File "/home/sadie/cfdm/cfdm/data/data.py", line 2700, in to_memory
    d._set_Array(self.source().to_memory())
  File "/home/sadie/cfdm/cfdm/core/data/data.py", line 909, in source
    return self._get_component("array", default=default)
  File "/home/sadie/cfdm/cfdm/core/abstract/container.py", line 267, in _get_component
    return self._default(
  File "/home/sadie/cfdm/cfdm/core/abstract/container.py", line 144, in _default
    raise default
ValueError: Data has no 'array' component

cf/data/data.py Outdated Show resolved Hide resolved
cf/data/mixin/deprecations.py Outdated Show resolved Hide resolved
cf/data/mixin/deprecations.py Show resolved Hide resolved
cf/data/mixin/deprecations.py Outdated Show resolved Hide resolved
davidhassell and others added 5 commits April 22, 2022 08:34
Co-authored-by: Sadie L. Bartholomew <sadie.bartholomew@ncas.ac.uk>
Co-authored-by: Sadie L. Bartholomew <sadie.bartholomew@ncas.ac.uk>
Co-authored-by: Sadie L. Bartholomew <sadie.bartholomew@ncas.ac.uk>
Co-authored-by: Sadie L. Bartholomew <sadie.bartholomew@ncas.ac.uk>
@davidhassell
Copy link
Collaborator Author

Hi Sadie - look like the deprecation error wasn't working for any attributes . 99cffd4 should fix this:

>>> cf.Data(9).in_memory
Traceback
    ...
DeprecationError: Data attribute 'in_memory' has been deprecated at version TODODASK and will be removed at version 5.0.0. 

@sadielbartholomew
Copy link
Member

look like the deprecation error wasn't working for any attributes . 99cffd4 should fix this

Nice, and it indeed does. What about to_memory though (as opposed to in_)? I think that's still not playing ball.

@davidhassell
Copy link
Collaborator Author

What about to_memory though (as opposed to in_)? I think that's still not playing ball.

Ah. I see that that's inherited from cfdm. How about 48e20fa?

@sadielbartholomew
Copy link
Member

Ah. I see that that's inherited from cfdm.

I raised it since you have added such a method to cf/data/mixin/deprecations.py, which had me a little confused. Not sure if that can just be removed now?

@davidhassell
Copy link
Collaborator Author

I raised it since you have added such a method to cf/data/mixin/deprecations.py

Doh! 7aecaca

Copy link
Member

@sadielbartholomew sadielbartholomew left a comment

Choose a reason for hiding this comment

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

This fell off my radar after my latest feedback comment, apologies. Your new commit is fine, so all good to merge! Thanks.

@davidhassell davidhassell merged commit 03bad1e into NCAS-CMS:lama-to-dask Apr 28, 2022
@davidhassell davidhassell deleted the dask-memory-disk branch November 15, 2022 09:20
@davidhassell davidhassell added this to the 3.14.0 milestone Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dask Relating to the use of Dask
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants