paleolimbot / tidyphreeqc

Tidy geochemical modeling using PHREEQC
22 stars 3 forks source link

phr_input_section number constrain #6

Open Ignimbrit opened 5 years ago

Ignimbrit commented 5 years ago

Good evening,

in Phreeqc, input blocks often (but not always) come with a numeric identifier. In fact, a sequence of numbers akin to 1:x can be assigned to a single input block, e.g. of a solution, to effectively make it "many identical solutions". I like to think of it as several beakers containing the same stuff. PHREEQC_numbers

This functionality is crucial for some more advanced operations in phreeqc such as the (nonetheless heartwarming simple) transport modelling mechanism, where the number of a block determines the chemical setup of a region. Unfortunately, as far as I can tell, tidyphreeqc does currently not allow for a single phreeqc_input_section to have a number that is not a numeric vector of length 1. tidyphreeqc_numbers

One could try to make tidyphreeqc create the same phreeqc_input_section n times, attaching a different number each, but for models with reasonable complexity this is impractical.

It would be nice to be able to just state a starting number and an optional end number like in the original phreeqc GUI. Assigning numbers to a phreeqc_input_section is tied to some deep fried S3 magic I do not dare touching, so I'm filing this issue instead of providing a pull request.

paleolimbot commented 5 years ago

When I get back in September I will tackle this... Probably by setting the default to NA and auto numbering/naming them.