ices-taf / conjoin

Contaminants Joint Assessment for OSPAR, HELCOM and AMAP
MIT License
3 stars 0 forks source link

I want to add additional items to existing variable lists without changing the R functions #17

Open neil-ices-dk opened 2 years ago

neil-ices-dk commented 2 years ago

From Rob: Many of the checks are ‘soft-wired’ in the sense that they are embodied in user-modifiable R functions. They don’t need modifying often – but it is quite a bit of work when an assessment is extended to include e.g. new species groups (mammals) or biological effects. (Adding a new chemical determinand usually requires no intervention.) Can this process be streamlined / simplified?

RobFryer commented 2 years ago

Two different threads here.

There are already ways of modifying determinand, species, and threshold lists without going into R functions (although these could probably be set up better and could certainly be documented better).

However, things get more complicated when you start considering e.g. the target basis of analysis. For example, for OSPAR, we assess PCB concentrations in shellfish on a dry weight basis, but in fish, they are assessed on a lipid weight basis if the typical lipid content of the species / tissue is > 3% and on a wet weight basis otherwise. HELCOM have slightly different choices. At present, there is a convention-specific function that is called to implement this. So not part of the core routines, and each convention can do what they want, but still and R-function.

Another example: the automatic way of specifying thresholds works most of the time. But gets messy for some biological effects where it depends on the species and the method of analysis. Again, there are user-supplied functions that allow users to override the default mechanism.

What I am hoping for is direction on how to implement / streamline this with good design principles, not just the ways I have found / made up to do this. I have to say that throughout I have tried to make things as modular as I can, with user-supplied functions or configuration files where possible. But it is now so vast that I need another pair of eyes to look over it, pull it apart, and tell me (or others) how to rebuild it again. Not a hack of the code, but some guiding principles about how we are going to set this for the medium / long term.

neil-ices-dk commented 2 years ago

What I am hoping for is direction on how to implement / streamline this with good design principles, not just the ways I have found / made up to do this. I have to say that throughout I have tried to make things as modular as I can, with user-supplied functions or configuration files where possible. But it is now so vast that I need another pair of eyes to look over it, pull it apart, and tell me (or others) how to rebuild it again. Not a hack of the code, but some guiding principles about how we are going to set this for the medium / long term.

yes, get your point, the challenge here is time to get that wider/deeper view. We can look more systematically at this and consult more widely with our DevOps colleagues but this will not be ready for tomorrow.