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

#510 #511

Merged
merged 5 commits into from
May 1, 2024
Merged

#510 #511

merged 5 commits into from
May 1, 2024

Conversation

kennethshsu
Copy link
Collaborator

Addressed #510

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

Attention: Patch coverage is 41.66667% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 80.60%. Comparing base (71a6ced) to head (f30f353).

Files Patch % Lines
chainladder/core/correlation.py 22.22% 14 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #511   +/-   ##
=======================================
  Coverage   80.60%   80.60%           
=======================================
  Files          80       80           
  Lines        4732     4733    +1     
  Branches      809      809           
=======================================
+ Hits         3814     3815    +1     
  Misses        641      641           
  Partials      277      277           
Flag Coverage Δ
unittests 80.60% <41.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kennethshsu
Copy link
Collaborator Author

@jbogaardt can you review this PR?

@jbogaardt
Copy link
Collaborator

@jbogaardt can you review this PR?

I thought I did. Did you not see my comments? Pandas is deprecating "Y" and moving towards "A" for 2.2 and later. Refer to their release note. It looks like you're code change says to use the deprecated "Y" value for newer versions of pandas which seems wrong.

There is also a new conditional which doesn't actually compare against a version number:

"Y" if version.Version(pd.__version__) else "A"

Everything is "truthy" in python so this will always return "Y" regardless of the pandas version.

@kennethshsu
Copy link
Collaborator Author

I probably missed it. Sorry! Looks like I made a mistake and did the opposite.

Also, there are some codecov issues, do you think we need new tests for these couple of new lines? I actually don't know how to handle it when we need to use different versions of packages.

grain = "Y" if float('.'.join(pd.__version__.split('.')[:-1])) < 2.2 else "A"
grain = (
"Y"
if version.Version(pd.__version__) >= version.Version("2.2.0")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be <= not >=?

self.origin_grain, self.origin_grain
)
freq = {
"Y": "Y" if version.Version(pd.__version__) else "A",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the conditional be completed?

@jbogaardt jbogaardt merged commit 0d0716e into master May 1, 2024
7 of 8 checks passed
@kennethshsu
Copy link
Collaborator Author

I never saw those comments, but thanks for the feedback and approving the PR. :)

I think I'll keep the equal sign the way it is in the PR, since 2.2 and later means >= 2.2.

@kennethshsu kennethshsu deleted the #510 branch May 1, 2024 20:35
@kennethshsu
Copy link
Collaborator Author

@jbogaardt, can you double-check that A is preferred and that Y is being deprecated by pandas? I just checked the doc you linked and I don't see it.

In fact, I am still getting the warning:

FutureWarning: 'A-DEC' is deprecated and will be removed in a future version, please use 'Y-DEC' instead.

@jbogaardt
Copy link
Collaborator

@jbogaardt, can you double-check that A is preferred and that Y is being deprecated by pandas? I just checked the doc you linked and I don't see it.

In fact, I am still getting the warning:

FutureWarning: 'A-DEC' is deprecated and will be removed in a future version, please use 'Y-DEC' instead.

Thanks @kennethshsu , you're right. My brain is backwards. 'A' is being deprecated in favor of 'Y'.

kennethshsu added a commit that referenced this pull request May 6, 2024
@kennethshsu kennethshsu mentioned this pull request May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants