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

Add fix for checking is_time_series() property based on data_type attr #881

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

tomvothecoder
Copy link
Collaborator

@tomvothecoder tomvothecoder commented Oct 29, 2024

Description

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

If applicable:

  • New and existing unit tests pass with my changes (locally and CI/CD build)
  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected)

- Now checks the `data_type` attr too
@tomvothecoder tomvothecoder changed the title Add fix for checking is_time_series() property Add fix for checking is_time_series() property based on data_type attr Oct 29, 2024
Comment on lines +166 to 171
if (self.data_type == "ref" and self.parameter.ref_timeseries_input) or (
self.data_type == "test" and self.parameter.test_timeseries_input
):
return True
else:
return False
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A more explicit version of the main code below:

def is_timeseries(self):
"""
Return True if this dataset is for timeseries data.
"""
if self.ref:
return getattr(self.parameters, "ref_timeseries_input", False)
else:
return getattr(self.parameters, "test_timeseries_input", False)

@tomvothecoder tomvothecoder marked this pull request as ready for review October 29, 2024 18:24
@tomvothecoder tomvothecoder merged commit 111d98b into cdat-migration-fy24 Oct 29, 2024
4 checks passed
@tomvothecoder
Copy link
Collaborator Author

tomvothecoder commented Oct 29, 2024

@chengzhuzhang This PR should fix the attribute error (tested with your run script). You can rebase your eamxx_1024 branch on the latest cdat-migration-fy24

EDIT: Actually let me address a few more of the open issues in #871 first so you don't have to keep rebasing.

@chengzhuzhang
Copy link
Contributor

@tomvothecoder thank you. I will keep modifying eamxx_1024, the changes are mostly contained within variable derivation, so it is easy to rebase.

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