RMI-PACTA / pacta.data.preparation

The goal of {pacta.data.preparation} is to prepare and format all input datasets required to run the PACTA for investors tools.
https://rmi-pacta.github.io/pacta.data.preparation/
Other
1 stars 0 forks source link

add checks for crucial inputs to relevant functions #13

Open cjyetman opened 7 months ago

cjyetman commented 7 months ago

A fair and valid point. I would think in that case that having good initial checks in every relevant function is a suitable alternative. These errors (and warnings I guess, if applicable) should have informative and clear messages when crucial data is lacking.

I don't know if that already exists sufficiently? If it does then happy to close this, otherwise I would suggest we open a new issue in pacta.data.preparation to ensure something like "input data in every exported data processing function in pacta.data.preparation is checked for crucial inputs".

NIT: Effective logging would help this further (i know i know) to be able to quickly ascertain where hiccups are happening for those that DON'T run this in RStudio.

Originally posted by @jdhoffa in https://github.com/RMI-PACTA/workflow.data.preparation/issues/11#issuecomment-1931942087

Some of the functions in this repo have a data argument as well as additional arguments specifying specific values to be used in the data input. It would be advantageous for functions like this to first check if the desired options can be achieved by verifying that they are available in the input data, and if not, providing an informative error about why it cannot work as expected.

jdhoffa commented 7 months ago

Exactly what I had in mind, thanks