Please check if your PR fulfills the following requirements:
[x] Tests for the changes have been added (for bug fixes / features)
[ ] Docs have been reviewed and added / updated if needed (for bug fixes / features)
Some docs updates need to be made in the COAsT-site repo, in a separate PR. See contributing to documentation for details.
[ ] Build (./build.sh) was run locally and no errors reported. NB not sure about this requirement: GitActions test this
[ ] Lint (pylint .) has passed locally and any fixes were made for failures. NB not sure about this requirement: GitActions test this with black
Pull request type
Please check the type of change your PR introduces:
- [X] Bugfix
- [ ] Feature
- [] Code style update (formatting, renaming)
- [X] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):
## What is the current behavior?
Issue URL: #608
What is the new behavior?
nan masking of bad salinity point was misapplied using temperature mask locations:
Also, though data points with bad values were masked with NaN, and profiles with both bad salinity and temperature were removed, profiles with bad temperature or salinity were not masked.
On inspection, other minor issues:
Method name change
calculate_all_en4_qc_flags() only represents calculate_en4_qc_flags_levels(), and not profiles.
Hence a name change/refactor
Duplicated methods in profile.py
calculate_all_en4_qc_flags() appears twice
process_en4() appears twice
In calculate_en4_qc_flags_levels():
Different versions of EN dataset have a slightly different justitifcation of why some points are removed. This is inconsequential to the implementation of which points/profiles get masked but the code is updated to reflect this knowledge - perhaps making it more readable.
double mapping:
Within profile.py (insitu) temperature was being mapped to both temperature and potential temperature. The variable should be preserved in this code and mappings happen exclusively in the json files
Add profile.mask_stats()
Checklist
[x] Code compiles correctly
[ ] Created tests which fail without the change (if possible)
Pull request checklist
Please check if your PR fulfills the following requirements:
COAsT-site
repo, in a separate PR. See contributing to documentation for details../build.sh
) was run locally and no errors reported. NB not sure about this requirement: GitActions test thispylint .
) has passed locally and any fixes were made for failures. NB not sure about this requirement: GitActions test this withblack
Pull request type
Please check the type of change your PR introduces: - [X] Bugfix - [ ] Feature - [] Code style update (formatting, renaming) - [X] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] Documentation content changes - [ ] Other (please describe): ## What is the current behavior?Issue URL: #608
What is the new behavior?
nan masking of bad salinity point was misapplied using temperature mask locations:
should read
Also, though data points with bad values were masked with NaN, and profiles with both bad salinity and temperature were removed, profiles with bad temperature or salinity were not masked.
On inspection, other minor issues:
Method name change
calculate_all_en4_qc_flags()
only representscalculate_en4_qc_flags_levels()
, and not profiles. Hence a name change/refactorDuplicated methods in profile.py
calculate_all_en4_qc_flags()
appears twiceprocess_en4()
appears twiceIn
calculate_en4_qc_flags_levels()
: Different versions of EN dataset have a slightly different justitifcation of why some points are removed. This is inconsequential to the implementation of which points/profiles get masked but the code is updated to reflect this knowledge - perhaps making it more readable.double mapping: Within profile.py (insitu)
temperature
was being mapped to bothtemperature
andpotential temperature
. The variable should be preserved in this code and mappings happen exclusively in the json filesAdd profile.mask_stats()
Checklist
pip install . && pytest unit_testing/unit_test.py -s
)Does this introduce a breaking change?
Other information