Skip to content

Comments

Feature 556 copy base and common functionality#566

Merged
bikegeek merged 38 commits intofeature_555_replace_plotlyfrom
feature_556_copy_base_and_common_functionality
Feb 25, 2026
Merged

Feature 556 copy base and common functionality#566
bikegeek merged 38 commits intofeature_555_replace_plotlyfrom
feature_556_copy_base_and_common_functionality

Conversation

@bikegeek
Copy link
Collaborator

@bikegeek bikegeek commented Feb 9, 2026

Pull Request Testing

  • Describe testing already performed for these changes:

    manually ran tests in Python 3.13 environment
    made a Taylor Diagram with horizontal and vertical lines from base_plot.py

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:

  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes or No]

  • Do these changes include sufficient testing updates? [Yes or No]

  • Will this PR result in changes to the test suite? [Yes or No]

    If yes, describe the new output and/or changes to the existing output:

  • Do these changes introduce new SonarQube findings? [Yes or No]

    If yes, please describe:

  • Please complete this pull request review by [Fill in date].

Pull Request Checklist

See the METplus Workflow for details.

  • Add any new Python packages to the METplus Components Python Requirements table.
  • Review the source issue metadata (required labels, projects, and milestone).
  • Complete the PR definition above.
  • Ensure the PR title matches the feature or bugfix branch name.
  • Define the PR metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Milestone as the version that will include these changes
    Select: Coordinated METplus-X.Y Support project for bugfix releases or METplotpy-X.Y.Z Development project for official releases
  • After submitting the PR, select the ⚙️ icon in the Development section of the right hand sidebar. Search for the issue that this PR will close and select it, if it is not already selected.
  • After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
  • Close the linked issue and delete your feature or bugfix branch from GitHub.

bikegeek and others added 30 commits January 21, 2026 13:53
…g.py. Updated plots that use plotly to import from those versions so it is clear which plots still rely on plotly and need to be updated. This will also allow optional support of plotly for certain plots if we are not able to fully get rid of the plotly dependency in this development cycle. Also removed some unused imports. Replaced util.py function apply_weight_style with get_font_params since the existing version will not be able to be used with matplotlib
…y matplotlib. Instead set xaxis label weight similar to taylor_diagram logic
…feature_556_copy_base_and_common_functionality
…tring 9999 to integer 9999 and use np.nan instead of string 'NA'
…causes yaml configurations for lines to be ignored
…feature_556_copy_base_and_common_functionality
…feature_556_copy_base_and_common_functionality
…units. added helper function to reduce duplication for logic to convert units
…l and y-axis label style, weight, and font size. Moved the add_horizontal_line() and add_vertical_line() code from the util.py module to this module as this will be needed for all plot types. TODO comments are used to denote code that will need to be removed when all plot types have migratee to Matplotlib.
@bikegeek bikegeek marked this pull request as draft February 9, 2026 20:27
bikegeek and others added 4 commits February 10, 2026 09:24
…ame of the test file and creating a subdirectory if it does not match the test directory, e.g. bar/test_bar.py would write to test_output/bar but bar/test_other.py would write to test_output/bar/other. Previously multiple test files would wipe out the other tests' output. Also switched to using request.node.path because request.fspath is deprecated
…the default config was cm. This was unsupported in the Config.calculate_plot_dimension function, which resulted in the input width/height being used. Updates to the function added support for cm units, which broke the plots. The units listed in the default config file are in inches, so updating the plot_units value to inches (in) resolves the issue and allows performance diagram plots to be generated again
@georgemccabe
Copy link
Contributor

@bikegeek, I resolved the differences here except for 4 files.

The line plots differ with the horizontal line defined with the lines attribute from the config. The original was a solid line and the new output has a dotted line. The yaml files for these line plots have line_style: '--' set for the horizontal line. Should this correspond to a dashed line? If so, then I think the new output is more correct.

See the comment in commit 9d1d180 for details on the fix for the performance diagram files.

The hovmoeller diffs appear to be OK. The json file has added height and width attributes, which seems to be OK. The hovmoeller image has no visible differences and even sometimes is not flagged in the diffs running locally.

@bikegeek
Copy link
Collaborator Author

bikegeek commented Feb 24, 2026 via email

Copy link
Contributor

@georgemccabe georgemccabe left a comment

Choose a reason for hiding this comment

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

These changes create 2 copies of the base functionality -- one that supports matplotlib and one that supports plotly. The latter will be phased out eventually after all of the plots that use plotly have been switched over to using matplotlib.

Notable expected diffs in this PR that will show up when we merge into develop:

line/line_plot/env_fcst_var_stat_line.png - custom horizontal line changed to dashed line, which is what config file requests

line/line_plot/line_from_zero.png - custom horizontal line changed to dashed line, which is what config file requests

hovmoeller/hovmoeller_test.png - no visual differences (as far as I could tell)

hovmoeller/hovmoeller_test.json - added height and width attributes

@bikegeek bikegeek merged commit ef7167a into feature_555_replace_plotly Feb 25, 2026
13 of 15 checks passed
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.

Remove plotly: Create copy of base/common functionality using matplotlib -- base_plot, config, util, constants

2 participants