You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It goes without saying that this is low priority, for now.
Some functions, such as update_salinity mapping, are doing far too much leg work for a single function. Because of this, they require numerous local variable definitions, and require a huge amount branches (nested for and if statements).
Not only does this make them somewhat difficult to test (as the testing suite to hit all possible branches would be huge), it makes them difficult to maintain for anyone approaching the code without a huge amount of background knowledge.
I propose a reasonably simple, but potentially time consuming refactor whereby we split these routines into even smaller chunks, separating out data manipulation areas (ie converting from 0 < x < 360 latitude to -180 < x < 180) and sections after "if" and "for" statements into their own easily testable functions, if they aren't already.
This will
Allow testing to be even more thorough and effective
Make code reading and navigating far simpler
Make changes easier to implement in the long term
Allow for more accurate and precise documentation
The text was updated successfully, but these errors were encountered:
The update_salinity_mapping has been refactored to improve the redability of this code.
The refactoring includes:
-moving some of the code out into smaller functions
-reduce the number of variables beeing passed using the dictionaries
More refactoring of other codes associated with update salinity mapping still beed to be done.
It goes without saying that this is low priority, for now.
Some functions, such as update_salinity mapping, are doing far too much leg work for a single function. Because of this, they require numerous local variable definitions, and require a huge amount branches (nested for and if statements).
Not only does this make them somewhat difficult to test (as the testing suite to hit all possible branches would be huge), it makes them difficult to maintain for anyone approaching the code without a huge amount of background knowledge.
I propose a reasonably simple, but potentially time consuming refactor whereby we split these routines into even smaller chunks, separating out data manipulation areas (ie converting from 0 < x < 360 latitude to -180 < x < 180) and sections after "if" and "for" statements into their own easily testable functions, if they aren't already.
This will
The text was updated successfully, but these errors were encountered: