8000 Allow environment variables in Rainforests config by nivnac · Pull Request #2052 · metoppv/improver · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow environment variables in Rainforests config #2052

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

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

nivnac
Copy link
Contributor
@nivnac nivnac commented Nov 18, 2024

Addresses #2046

Rainforests config files contain a list of paths to the individual Treelite or LightGBM files.
This change adds parsing of these strings for environment variables using os.path.expandvars.

Testing:

  • Ran tests and they passed OK

Copy link
codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.38%. Comparing base (84a8944) to head (8c4e7ca).
Report is 41 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2052      +/-   ##
==========================================
- Coverage   98.39%   98.38%   -0.02%     
==========================================
  Files         124      133       +9     
  Lines       12212    13063     +851     
==========================================
+ Hits        12016    12852     +836     
- Misses        196      211      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Contributor
@dmentipl dmentipl left a comment

Choose a reason for hiding this comment

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

Thanks @nivnac, these changes make sense in light of #2052. However, I see that you need to resolve merge conflicts.

Copy link
Contributor
@dmentipl dmentipl left a comment

Choose a reason for hiding this comment

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

There seems to be a possible missing os.path.expandvars on line 199.

@nivnac
Copy link
Contributor Author
nivnac commented Nov 20, 2024

There seems to be a possible missing os.path.expandvars on line 199.

That is in check_filenames. That line also does not have the expanduser() part. I think that contrary to the docstring, this function is just checking that filenames are defined in the json dict rather than trying to parse it and confirm that files actually exist. And therefore a change isn't needed here. Maybe @benowen-bom or @btrotta-bom can confirm?

@dmentipl
Copy link
Contributor

That is in check_filenames. That line also does not have the expanduser() part. I think that contrary to the docstring, this function is just checking that filenames are defined in the json dict rather than trying to parse it and confirm that files actually exist. And therefore a change isn't needed here. Maybe @benowen-bom or @btrotta-bom can confirm?

Yes, that seems to be the case. Thanks for explaining.

@nivnac nivnac merged commit 245cf18 into metoppv:master Nov 20, 2024
10 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.

2 participants
0