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 python 3.11 and 3.12 versions to testing matrix #428

Conversation

martin-springer
Copy link
Collaborator

@martin-springer martin-springer commented Aug 21, 2024

  • Code changes are covered by tests
  • Code changes have been evaluated for compatibility/integration with TrendAnalysis
  • New functions added to __init__.py
  • API.rst is up to date, along with other sphinx docs pages
  • Example notebooks are rerun and differences in results scrutinized
  • Updated changelog

@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.10%. Comparing base (c37ca59) to head (a92032c).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           aggregated_filters_for_trials     #428      +/-   ##
=================================================================
+ Coverage                          96.09%   96.10%   +0.01%     
=================================================================
  Files                                 11       11              
  Lines                               2200     2209       +9     
=================================================================
+ Hits                                2114     2123       +9     
  Misses                                86       86              

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

Base automatically changed from new_default_behavior to aggregated_filters_for_trials August 21, 2024 15:11
@martin-springer
Copy link
Collaborator Author

@mdeceglie - Regarding numpy > 2. We would need pandas 2.2.2 (https://pandas.pydata.org/docs/whatsnew/v2.2.2.html). However, the bug you found in pandas is still persistent in 2.2.2 (pandas-dev/pandas#55794).

Not sure, how to proceed...

Copy link
Collaborator

@mdeceglie mdeceglie 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, a few minor comments to address, then it should be ready to go. Thanks!

@@ -531,6 +536,11 @@ def _combine_losses(self, rollup_period='M'):
The period on which to roll up losses and calculate availability.
"""

# Allow pandas < 2.0 to use 'M' as an alias for MonthEnd
# https://pandas.pydata.org/docs/whatsnew/v2.2.0.html#deprecate-aliases-m-q-y-etc-in-favour-of-me-qe-ye-etc-for-offsets
if rollup_period == "ME":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's update the docstrings for _combine_losses and run to explain the situation. Maybe something like "Default value "ME" triggers monthly rollup period. For other aliases, be sure they are compatible with your version of Pandas"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call. I've updated the docstrings.

@@ -521,4 +519,4 @@ def test_hour_angle_filter():

# Check that the result is the correct boolean Series
expected_result = pd.Series([False, False, True, True, True], index=index)
pd.testing.assert_series_equal(result, expected_result)
pd.testing.assert_series_equal(result, expected_result, check_names=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What caused the need for this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the newest pvlib version 0.11.1 there was a bug fix for the hour_angle() function (https://pvlib-python.readthedocs.io/en/stable/whatsnew.html).

The series that's returned does have a new argument Name: equation_of_time.
image

In order to make the test run for older pvlib versions in which the name attribute is not present, I decided to not add the name to the expected result series but rather don't check for series names.

setup.py Outdated
"h5py >= 3.7.0",
"plotly>=4.0.0",
"xgboost >= 1.3.3",
"pvlib >= 0.9.0, <0.12.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

requirments_min specifies 0.11. We should change the minimum here too right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Absolutely right, I overlooked that. I've bumped it to 0.11 now.

@mdeceglie mdeceglie merged commit 841cbec into aggregated_filters_for_trials Oct 14, 2024
18 checks passed
@mdeceglie mdeceglie deleted the add-new-python-versions-to-testing-matrix branch October 14, 2024 19:38
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.

3 participants