openghg / openghg

A cloud platform for greenhouse gas (GHG) data analysis and collaboration.
https://www.openghg.org
Apache License 2.0
30 stars 4 forks source link

Inside get_obs_surface change conditional statements to more scalable option #1141

Open SutarPrasad opened 1 month ago

SutarPrasad commented 1 month ago

We should employ pattern matching here, instead of conditional statements. for e.g variable_patterns = {"repeatability":"mf_repeatability", "variability":"mf_variability", ...} and loop and break for match. This will ensure we are increasing readability and scalability in future if required, whilst not repeating.

_Originally posted by @SutarPrasad in https://github.com/openghg/openghg/pull/1130#discussion_r1778363830_