Skip to content

Verify infer_freq() already used for non-daily input validation#477

Closed
Copilot wants to merge 21 commits intofix-numpy-and-pandas-compatibilityfrom
copilot/consider-warning-for-non-daily-inputs
Closed

Verify infer_freq() already used for non-daily input validation#477
Copilot wants to merge 21 commits intofix-numpy-and-pandas-compatibilityfrom
copilot/consider-warning-for-non-daily-inputs

Conversation

Copy link

Copilot AI commented Feb 4, 2026

Description

Issue #112 requested SRRAnalysis.__init__() use pd.infer_freq() to validate truly daily data instead of rejecting series without explicit frequency attributes.

Investigation confirms this is already implemented. Current code at lines 69-80 of soiling.py:

if pd.infer_freq(self.pm.index) != 'D':
    raise ValueError('Daily performance metric series must have daily frequency')

pd.infer_freq() returns 'D' for daily data even when .freq=None, allowing implicit daily series to proceed while rejecting truly non-daily data.

Verified by:

  • Existing test test_soiling_srr_non_daily_inputs validates implicit daily series pass
  • All 35 soiling tests pass
  • Manual testing confirms correct behavior for explicit freq, implicit freq, and non-daily cases

No code changes required.

Checklist

  • 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
Original prompt

This section details on the original issue you should resolve

<issue_title>Consider warning for non-daily inputs to srr_analysis.init()</issue_title>
<issue_description>@GregoryKimball raised the question in PR #112 whether soiling.srr_analysis.__init__() should raise warnings instead of the current behavior to raise aValueError when called with Pandas series that don't have the frequency set.

(At time of entry, this issue does not apply to master) </issue_description>

<agent_instructions>has this issue been addressed since it was raised?</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@mdeceglie Let's use `infer_freq()` to check wether it is truly daily and allow the code to proceed

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

mdeceglie and others added 20 commits January 22, 2025 17:42
Bumps [notebook](https://github.com/jupyter/notebook) from 7.2.1 to 7.2.2.
- [Release notes](https://github.com/jupyter/notebook/releases)
- [Changelog](https://github.com/jupyter/notebook/blob/@jupyter-notebook/tree@7.2.2/CHANGELOG.md)
- [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/tree@7.2.1...@jupyter-notebook/tree@7.2.2)

---
updated-dependencies:
- dependency-name: notebook
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bump notebook from 7.2.1 to 7.2.2 in /docs
Bumps [tornado](https://github.com/tornadoweb/tornado) from 6.4.2 to 6.5.1.
- [Changelog](https://github.com/tornadoweb/tornado/blob/master/docs/releases.rst)
- [Commits](tornadoweb/tornado@v6.4.2...v6.5.1)

---
updated-dependencies:
- dependency-name: tornado
  dependency-version: 6.5.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
statsmodels 0.14.4 is not able to handle the latest scipy.
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.5 to 3.1.6.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](pallets/jinja@3.1.5...3.1.6)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-version: 3.1.6
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [requests](https://github.com/psf/requests) from 2.32.3 to 2.32.4.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.32.3...v2.32.4)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.32.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.2 to 2.5.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.2.2...2.5.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.5.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bump jinja2 from 3.1.5 to 3.1.6 in /docs
remove scipy restrictions in setup.py now that statsmodels has a new release.
Bump tornado from 6.4.2 to 6.5.1 in /docs
Copilot AI changed the title [WIP] Add warning for non-daily inputs to srr_analysis.__init__() Verify infer_freq() already used for non-daily input validation Feb 4, 2026
Copilot AI requested a review from martin-springer February 4, 2026 18:37
@martin-springer martin-springer changed the base branch from master to development February 4, 2026 18:50
@codecov-commenter
Copy link

codecov-commenter commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.19%. Comparing base (e107469) to head (c4ce7d0).

Additional details and impacted files
@@                          Coverage Diff                           @@
##           fix-numpy-and-pandas-compatibility     #477      +/-   ##
======================================================================
+ Coverage                               96.10%   96.19%   +0.08%     
======================================================================
  Files                                      12       12              
  Lines                                    2287     2287              
======================================================================
+ Hits                                     2198     2200       +2     
+ Misses                                     89       87       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…ty' into copilot/consider-warning-for-non-daily-inputs
@martin-springer martin-springer changed the base branch from development to fix-numpy-and-pandas-compatibility February 4, 2026 18:55
@martin-springer martin-springer deleted the copilot/consider-warning-for-non-daily-inputs branch February 4, 2026 19:07
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.

Consider warning for non-daily inputs to srr_analysis.__init__()

5 participants