dtcenter / MET

Model Evaluation Tools
https://dtcenter.org/community-code/model-evaluation-tools-met
Apache License 2.0
74 stars 22 forks source link

Suggested Improvements to Python Embedding across MET #2414

Open DanielAdriaansen opened 1 year ago

DanielAdriaansen commented 1 year ago

Describe the Enhancement

This is a general issue with no due date to document suggested changes and/or improvements to how Python Embedding works within MET, with the primary goal of improving the user experience and ability to communicate and teach Python Embedding to users.

Time Estimate

TBD

Sub-Issues

Consider breaking the enhancement down into sub-issues.

Completed Items

Relevant Deadlines

NONE

Funding Source

NONE

Assignee

Labels

Projects and Milestone

Define Related Issue(s)

Consider the impact to the other METplus components.

Enhancement Checklist

See the METplus Workflow for details.

georgemccabe commented 1 year ago

os.path.abspath can be used to get the full path from a relative path. This could be used to add the directory containing the python embedding script if the user does not specify the full path. See: https://github.com/dtcenter/METplus/blob/aa9d7b3451bad720dd8a9928a735b3bf12318585/ush/run_metplus.py#L24

A potential fix (untested) would be to change this line from: pyembed_module_name = sys.argv[2] to: pyembed_module_name = os.path.abspath(sys.argv[2])