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

Bugfix: Fix missing config files from installed package #475

Closed
24 tasks
georgemccabe opened this issue Nov 18, 2024 · 3 comments · Fixed by #476 or #477
Closed
24 tasks

Bugfix: Fix missing config files from installed package #475

georgemccabe opened this issue Nov 18, 2024 · 3 comments · Fixed by #476 or #477
Assignees
Labels
type: bug Fix something that is not working

Comments

@georgemccabe
Copy link
Contributor

Describe the Problem

If METplotpy is installed as a python package, running line.py fails because the yaml default config files are not included in the package. Add these files are package data files.

Expected Behavior

Running /metplus/METplotpy/metplotpy/plots/line/line.py should run without producing this error:

File "/usr/local/lib/python3.10/site-packages/metplotpy/plots/base_plot.py", line 61, in init
with open(os.path.join(location, default_conf_filename), 'r') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.10/site-packages/metplotpy/plots/config/line_defaults.yaml'

Environment

Describe your runtime environment:
1. Machine: (e.g. HPC name, Linux Workstation, Mac Laptop)
2. OS: (e.g. RedHat Linux, MacOS)
3. Software version number(s)

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

Define the source of funding and account keys here or state NONE.

Define the Metadata

Assignee

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

Labels

  • Review default alert labels
  • Select component(s)
  • Select priority
  • Select requestor(s)

Milestone and Projects###

  • Select Milestone as the next bugfix version
  • Select Coordinated METplus-X.Y Support project for support of the current coordinated release
  • Select METplotpy-X.Y.Z Development project for development toward the next official release

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.
  • Add any new Python packages to the METplus Components Python Requirements table.
  • 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 issue
    Select: Milestone as the next bugfix version
    Select: Coordinated METplus-X.Y Support project for support of the current coordinated release
  • 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 issue
    Select: Milestone as the next official version
    Select: METplotpy-X.Y.Z Development project for development toward the next official release
  • Close this issue.
@georgemccabe georgemccabe added the type: bug Fix something that is not working label Nov 18, 2024
@georgemccabe georgemccabe added this to the METplotpy-3.0.0 milestone Nov 18, 2024
@georgemccabe georgemccabe self-assigned this Nov 18, 2024
@bikegeek
Copy link
Collaborator

add a init.py to the METplotpy/metplotpy/plots/config file

@georgemccabe
Copy link
Contributor Author

@bikegeek, I can do that, but I believe that only will add .py files to the package. I added a section to the pyproject.toml to specify files that are not python that should be included in the package:

[tool.setuptools.package-data]
metplotpy = [
  "plots/config/**",
]

I confirmed that this worked:

ls /Users/mccabe/.conda/envs/mpp_test/lib/python3.1/site-packages/metplotpy/plots/config

bar_defaults.yaml mpr_plot_defaults.yaml
box_defaults.yaml performance_diagram_defaults.yaml
contour_defaults.yaml reliability_defaults.yaml
eclv_defaults.yaml revision_box_defaults.yaml
ens_ss_defaults.yaml revision_series_defaults.yaml
equivalence_testing_bounds_defaults.yaml roc_diagram_defaults.yaml
hist_defaults.yaml scatter_defaults.yaml
histogram_2d_defaults.yaml taylor_diagram_defaults.yaml
histogram_defaults.yaml tcmpr_defaults.yaml
hovmoeller_defaults.yaml wind_rose_defaults.yaml
line_defaults.yaml

@bikegeek
Copy link
Collaborator

bikegeek commented Nov 18, 2024 via email

bikegeek pushed a commit that referenced this issue Nov 20, 2024
* merged commit to get verison number from version file in docs config file

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

* update version number for development towards beta1 of 3.1.0

* prevent GPU failure running in containers by running kaleido with single process option
bikegeek pushed a commit that referenced this issue Nov 20, 2024
* 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
@bikegeek bikegeek moved this from 🏗 In progress to 🏁 Done in METplus-Analysis-6.0.0 Development Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Fix something that is not working
Projects
Status: 🏁 Done
2 participants