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

Ticket/PSB-207: #2726

Merged
merged 1 commit into from
Oct 12, 2023
Merged

Ticket/PSB-207: #2726

merged 1 commit into from
Oct 12, 2023

Conversation

morriscb
Copy link
Contributor

@morriscb morriscb commented Oct 5, 2023

No description provided.

@morriscb morriscb marked this pull request as ready for review October 9, 2023 17:38
Copy link
Contributor

@aamster aamster left a comment

Choose a reason for hiding this comment

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

Looks good. Only concern is, is it possible to test any of this functionality?

Return a list of all of the file names of the manifests associated
with this dataset
"""
return None
Copy link
Contributor

Choose a reason for hiding this comment

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

should this raise NotImplementedError 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.

Nope. This is a function that gets called in the base class so some value needs to be there. I'll change up the comment.

@morriscb
Copy link
Contributor Author

Looks good. Only concern is, is it possible to test any of this functionality?

I can look into getting something mocked up with moto.

"""
return None

def download_data(self) -> pathlib.Path:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this functionality different than the download_data in the base class?

Copy link
Contributor Author

@morriscb morriscb Oct 10, 2023

Choose a reason for hiding this comment

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

Slightly, the ordering is different in that things not used because the file metadata is set and doesn't need to be retrieved. So it's basically as simpler version of what is already in S3CloudCache.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that you instead want to override data_path and then the download_data of the superclass will just work? Want to try to get rid of the bit of boilerplate code duplication here.

@morriscb morriscb requested a review from aamster October 10, 2023 19:48
RuntimeError
If the file cannot be downloaded
"""
file_attributes = self._file_attributes
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be improved further since there is still too much code duplication with superclass data_path

It looks like what needs to be done is in S3CloudCache, you can add

@property
def file_attributes(self):
    return self._manifest.data_file_attributes(file_id)

then in NaturalMovieOneCache you can override with

@property
def file_attributes(self):
    return self._file_attributes

and then get rid of data_path

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@morriscb morriscb requested a review from aamster October 11, 2023 16:36
Copy link
Contributor

@aamster aamster left a comment

Choose a reason for hiding this comment

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

Looks good, aside from comment

@@ -339,6 +350,29 @@ def data_path(self, file_id) -> dict:

return output

def get_file_attributes(self, file_id):
Copy link
Contributor

Choose a reason for hiding this comment

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

pretty sure it returns CacheFileAttributes and not dict ? Can you add return type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, was looking at my natural movie cache and saw what looked like a dict at first glace. Fixed.

"""
return None

def get_file_attributes(self, file_id):
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this returns CacheFileAttributes and not dict ? Can you add return type?

Add file attribute for download.
Hook up natural movie into cache.
Add natural movie processing.
Add natural movie test.

Add get_file_attributes method.

Change return type.
@morriscb morriscb merged commit ecae373 into rc/2.16.0 Oct 12, 2023
15 checks passed
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