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

Absolute import instead of relative #479

Conversation

ahijevyc
Copy link
Contributor

@ahijevyc ahijevyc commented Dec 17, 2024

For 3 scripts in metplotpy/contributed/fv3_physics_tend...

Follow the style of metplotpy module importing that is used in metplotpy/contributed/stratosphere_diagnostics/stratosphere_diagnostics.py to avoid error about relative import.

In other words, replace from . import physics_tend
with import metplotpy.contributed.fv3_physics_tend.physics_tend

That should avoid the
ImportError: attempted relative import with no known parent package.

Pull Request Testing

  • Describe testing already performed for these changes:

It works in a conda environment with metplotpy 2.1.0

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:
setenv METPLOTPY_BASE <path>
setenv CONFIG $METPLOTPY_BASE/test/fv3_physics_tend/fv3_physics_tend_defaults.yaml
setenv WORKING_DIR $METPLOTPY_BASE/metplotpy/contributed/fv3_physics_tend
cd $WORKING_DIR
python planview_fv3.py -h
  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes]

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

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

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

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

    If yes, please describe:

  • Please complete this pull request review by [February 2025].

Pull Request Checklist

See the METplus Workflow for details.

  • [ x] Add any new Python packages to the METplus Components Python Requirements table.
  • [x ] Review the source issue metadata (required labels, projects, and milestone).
  • [x ] Complete the PR definition above.
  • [x ] Ensure the PR title matches the feature or bugfix branch name.
  • [ x] 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 August 1, 2023 15:43
set up for beta1 development
update dates for 3.0 release
Replace link from boxplot to series plot
set up for beta2 development
* Issue #391 utils for added fixed_vars_vals_input support

* Issue #391 tests for plot correctness. Includes data, config file, expected plot, and expected data points

* fix formatting

* Issue #391 add support to read in fixed_vars_vals_input setting

* Issue #391 perform filtering if fixed_vars_vals_input has any values defined

* issue #391 update to support the legacy format expected by METviewer when R was in use or a more simplified format for defining the fixed_vars_vals_input setting

* Issue #391 clean up tests, update config files

* issue #391 update the syntax for setting the fixed_vars_vals_input

* add issue to branch name to activate documentation workflow

* issue 391 updates to query, log when query returns an empty string

* issue #391 don't filter when the query string is an empty string

* Issue #391 remove call to non-existent logger in the create_query function

---------

Co-authored-by: Julie Prestopnik <[email protected]>
* Issue #391 utils for added fixed_vars_vals_input support

* Issue #391 tests for plot correctness. Includes data, config file, expected plot, and expected data points

* fix formatting

* Issue #391 add support to read in fixed_vars_vals_input setting

* Issue #391 perform filtering if fixed_vars_vals_input has any values defined

* issue #391 update to support the legacy format expected by METviewer when R was in use or a more simplified format for defining the fixed_vars_vals_input setting

* Issue #391 clean up tests, update config files

* issue #391 update the syntax for setting the fixed_vars_vals_input

* add issue to branch name to activate documentation workflow

* issue 391 updates to query, log when query returns an empty string

* issue #391 don't filter when the query string is an empty string

* Issue #391 remove call to non-existent logger in the create_query function

* Issue #391 invoke filter_by_fixed_vars in metplotpy.util to filter by fixed vars

* Issue #391 replace create_query() with filter_by_fixed_vars()

* Issue #391 replace tests for create_query with tests for filter_by_vars

* issue #391 data for filtering by fixed vals

* Issue #391 additional test for filtering by fixed values

* issue #391 fixed formatting that was causing unexpected results, updated comments

---------

Co-authored-by: Julie Prestopnik <[email protected]>
* Fix title to reflect the actual data used

* Change title to reflect the data used

* Issue #394 Suppress deprecation warning emanating from python-kaleido/plotly

* Remove save_to_file(), use version in base_plot

---------

Co-authored-by: Minna Win-Gildenmeister <[email protected]>
* Issue #401 replaced line_logger with logger in line 698

* issue #401 don't remove the nan.points1 plot as cleanup

* Issue #401 move this file from the intermediate files directory.  It doesn't belong there since it is not created during a test and is a file that is supposed to persist

* issue #401 refer to the nan.points1 in a new directory
* hide/show the legend entries line by line #355

* add show_legend parameter to the config files for testing #355

* commented show_in_browser #355
* Issue #403 updated release notes for beta2

* Issue #403 updated version for beta2 release

* Issue #403 fixed typo

* Issue #403 update date
update for beta3 development
update description of ArgumentParser to be more generic.
* data for testing ROC summary curve #399

* add a legend for ROC summary curve #399

* add ROC summary curve #399

* add ROC summary curve #399

* add ROC summary curve parameter #399

* add ROC summary curve #399

* add ROC summary curve test #399

* move methods for preparing ROC data to the common script for the ease of reuse #399
Fix typo.
* Adding stratosphere bias plot

* Added stratosphere Plots

* Added stratosphere plots for new use cases

* Added plotting documentation

* Updated toctree
* command line updates

* updating yaml files
scipy 1.9.3 no longer available in conda forge, use the same version as in requirements.txt
replace == with >= for scipy to allow flexibility
* updates to version and release notes

* Fix misspelling
forgot to update the header for beta3 (had copied and pasted from beta2)
update version for beta4 development
John-Sharples and others added 7 commits October 31, 2024 11:52
* Revert "Feature 461 make compare images configurable (#467)"

This reverts commit 5c189be.

* 461: keep CompareImages in conftest
…e tests when changes are pushed to main_vX.Y and develop branches
* fix version number for rc1

* get version number from verison file

* per #475, add default config files to python package

* prevent GPU failure running in containers by running kaleido with single process option
@ahijevyc ahijevyc added type: bug Fix something that is not working priority: low Low Priority labels Dec 17, 2024
@ahijevyc ahijevyc added this to the METplotpy-2.1.1 (bugfix) milestone Dec 17, 2024
@ahijevyc ahijevyc requested a review from bikegeek December 17, 2024 21:50
@ahijevyc ahijevyc linked an issue Dec 17, 2024 that may be closed by this pull request
14 tasks
@ahijevyc ahijevyc linked an issue Dec 17, 2024 that may be closed by this pull request
14 tasks
bikegeek and others added 5 commits December 18, 2024 16:04
* updates for coordinated release: version updates, dates, rotating authors

* Clean up text: fix typos, remove duplicates

* Update vulnerabilities.yaml

update gh-action-pip-audit from 1.0.5 to 1.1.0

* Apply suggestions from code review

Co-authored-by: Julie Prestopnik <[email protected]>

* Adding space

* Removing, superfluous since vulnerability checks are automatically done

---------

Co-authored-by: Julie Prestopnik <[email protected]>
added the version number
fixed version number
version number needs quotes
@michelleharrold michelleharrold added reporting: DTC NCAR Base NCAR Base DTC Project and removed reporting: DTC NCAR Base NCAR Base DTC Project labels Jan 8, 2025
@ahijevyc ahijevyc force-pushed the 478-import-metplotpycontributed-instead-of-relative-import branch from ae7d2ca to 7edf1ec Compare January 17, 2025 22:18
@ahijevyc ahijevyc closed this Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low Low Priority type: bug Fix something that is not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import metplotpy.contributed... instead of relative import