PecanProject / pecan

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

write.configs.ed should error if revision not specified #3142

Closed infotroph closed 1 year ago

infotroph commented 1 year ago

I understand the logic of this bit, and I know you didn't add the line @Aariq, but I wonder if it would be better for the code to throw an error if the revision isn't specified. In general we're trying to reduce/isolate the dependency of pecan modules and functions on the database -- by fixing this one error-checking line we're making users of the ED2 module install the database.

_Originally posted by @mdietze in https://github.com/PecanProject/pecan/pull/3135#discussion_r1142050704_

☝️ In reference to the following line of code in models/ed/write_configs.ed.R:

 model <- PEcAn.DB::db.query(paste("SELECT * FROM models WHERE id =", settings$model$id), params = settings$database$bety)