PecanProject / pecan

The Predictive Ecosystem Analyzer (PEcAn) is an integrated ecological bioinformatics toolbox.
www.pecanproject.org
Other
202 stars 230 forks source link

Allow HTML comments in pecan.xml and warn when named .xml doesn't exist #3051

Closed Aariq closed 1 year ago

Aariq commented 1 year ago

Closes #2950 and #2969.

Description

Uses a recursive function to strip any list elements named "comment" from a parsed pecan.xml. This allows the use of HTML style comments (<!-- a comment -->) in the pecan.xml so annotated version can be used without breaking runs. It also adds a warning to read.settings() when defaulting to "pecan.xml" when a named inputfile is provided and not found.

Another minor addition is that logger.setLevel() now returns (invisibly) the previous level. This behavior is similar to how par() works and is useful for temporarily changing the logger level and then changing it back.

Motivation and Context

I think adding comments in a pecan.xml file is a great way to give myself reminders about what needs to be changed and what needs to stay the same when preparing a series of runs based on a template. This way, I can leave those comments in for others to see and don't have to remember to delete them all.

Review Time Estimate

Types of changes

Checklist: