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

Address Warnings from pandas in METplotpy ROC diagram code #296

Closed
5 of 22 tasks
bikegeek opened this issue Dec 23, 2022 · 0 comments
Closed
5 of 22 tasks

Address Warnings from pandas in METplotpy ROC diagram code #296

bikegeek opened this issue Dec 23, 2022 · 0 comments
Assignees
Labels
component: external dependency External dependency issue priority: high High Priority reporting: DTC NOAA BASE NOAA Office of Atmospheric Research DTC Project reporting: DTC NOAA R2O NOAA Research to Operations DTC Project requestor: METplus Team METplus Development Team requestor: NOAA/other NOAA Laboratory, not otherwise specified type: bug Fix something that is not working

Comments

@bikegeek
Copy link
Collaborator

bikegeek commented Dec 23, 2022

Describe the Problem

Related to METcalcpy issue 249:
dtcenter/METcalcpy#249

This is observed with pandas 1.5 but not with 1.2.3

Expected Behavior

When generating a ROC diagram with PCT data, the FutureWarning is generated from the roc_diagram_series.py code in the _create_series_points() method:

    elif self.config.linetype_pct:
        roc_df = pstats._calc_pct_roc(subset_df)
        pody = roc_df['pody']
        pody = pd.Series([1]).append(pody, ignore_index=True)
        pody = pody.append(pd.Series([0]), ignore_index=True)
        pofd = roc_df['pofd']
        pofd = pd.Series([1]).append(pofd, ignore_index=True)
        pofd = pofd.append(pd.Series([0]), ignore_index=True)
        thresh = roc_df['thresh']
        thresh = pd.Series(['']).append(thresh, ignore_index=True)
        thresh = thresh.append(pd.Series(['']), ignore_index=True)
       
        return pofd, pody, thresh

Remedy:

Replace pody.append with pd.concat([pody, pd.Series([0])]) in above code block and in the code for the CTC line type.

Environment

Describe your runtime environment:
*1. Machine: mac laptop 'blenny'
*2. OS: MacOS
3. Software version number(s) v2.0

To Reproduce

Describe the steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Post relevant sample data following these instructions:
https://dtcenter.org/community-code/model-evaluation-tools-met/met-help-desk#ftp

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

2792542, 2773542

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select no scientist required

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Select Organization level Project for support of the current coordinated release
  • Select Repository level Project for development toward the next official release or add alert: NEED PROJECT ASSIGNMENT label
  • Select Milestone as the next bugfix version

Define Related Issue(s)

Consider the impact to the other METplus components.

Bugfix Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of main_<Version>.
    Branch name: bugfix_<Issue Number>_main_<Version>_<Description>
  • Fix the bug and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into main_<Version>.
    Pull request: bugfix <Issue Number> main_<Version> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Development issues
    Select: Organization level software support Project for the current coordinated release
    Select: Milestone as the next bugfix version
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Complete the steps above to fix the bug on the develop branch.
    Branch name: bugfix_<Issue Number>_develop_<Description>
    Pull request: bugfix <Issue Number> develop <Description>
    Select: Reviewer(s) and Development issues
    Select: Repository level development cycle Project for the next official release
    Select: Milestone as the next official version
  • Close this issue.
@bikegeek bikegeek added type: bug Fix something that is not working priority: high High Priority requestor: NOAA/other NOAA Laboratory, not otherwise specified alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED MORE DEFINITION Not yet actionable, additional definition required alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle component: external dependency External dependency issue requestor: METplus Team METplus Development Team labels Dec 23, 2022
@bikegeek bikegeek added this to the METplotpy-2.1 milestone Dec 23, 2022
@bikegeek bikegeek self-assigned this Dec 23, 2022
bikegeek added a commit that referenced this issue Dec 23, 2022
bikegeek added a commit that referenced this issue Dec 23, 2022
bikegeek added a commit that referenced this issue Dec 24, 2022
…oints to address FutureWarning with Series.append.

Replaced Series.append logic with pd.concat
@bikegeek bikegeek removed alert: NEED MORE DEFINITION Not yet actionable, additional definition required alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle labels Jan 17, 2023
bikegeek added a commit that referenced this issue Jan 17, 2023
bikegeek added a commit that referenced this issue Jan 17, 2023
bikegeek added a commit that referenced this issue Jan 18, 2023
* replace pd.append with pd.concat

* replace pd.append with pd.concat

* Issue #296 replace pd.append with pd.concat to address future deprecation in pandas

* Issue #296 updates to reflect changes made to address pandas future deprecation in roc_diagram_series

* Issue #296 add data and configuration to test future deprecation warnings
bikegeek added a commit that referenced this issue Jan 18, 2023
* Issue #296 Add yaml for testing PCT data

* Issue #296 PCT sample data

* Issue #296 for update to pandas 1.5.x modify code in _create_series_points to address FutureWarning with Series.append.
Replaced Series.append logic with pd.concat

* Issue #296 Didn't remove one of the replaced lines in the PCT linetype code block

* Issue #296 Added two more tests, using PCT linetype data

* replace pd.append with pd.concat

* replace pd.append with pd.concat
@bikegeek bikegeek moved this from 📋 Backlog to ✅ Done in METplus-Analysis-5.1.0 Development Jan 19, 2023
@bikegeek bikegeek removed the alert: NEED ACCOUNT KEY Need to assign an account key to this issue label Jan 19, 2023
@bikegeek bikegeek moved this from 📋 Backlog to ✅ Done in Coordinated METplus-5.0 Support Jan 25, 2023
@TaraJensen TaraJensen added reporting: DTC NOAA BASE NOAA Office of Atmospheric Research DTC Project reporting: DTC NOAA R2O NOAA Research to Operations DTC Project labels Jan 25, 2023
bikegeek added a commit that referenced this issue Jan 26, 2023
some words were cut off for #296, missing the ROC diagram code portion of the issue
@bikegeek bikegeek moved this from 📋 Backlog to ✅ Done in METplus-Analysis-5.1.0 Development Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: external dependency External dependency issue priority: high High Priority reporting: DTC NOAA BASE NOAA Office of Atmospheric Research DTC Project reporting: DTC NOAA R2O NOAA Research to Operations DTC Project requestor: METplus Team METplus Development Team requestor: NOAA/other NOAA Laboratory, not otherwise specified type: bug Fix something that is not working
Projects
Status: Done
Development

No branches or pull requests

2 participants