Cambridge-ICCS / ONEFlux

Open Network-Enabled Flux processing pipeline
Other
0 stars 0 forks source link

None vs NaN #48

Open dorchard opened 2 weeks ago

dorchard commented 2 weeks ago

We had a discussion earlier about how to deal with NaN values. In the JSON encoding, NaN is getting turned into None. We then have code that converts these back to NaN (https://github.com/Cambridge-ICCS/ONEFlux/blob/27-generate-unit-tests-for-cpdassignustar/tests/conftest.py#L73) however we still have some places, e.g., here: https://github.com/Cambridge-ICCS/ONEFlux/blob/27-generate-unit-tests-for-cpdassignustar/tests/unit_tests/test_ustar_cp/test_cpdBootstrapUStarTh4Season20100901.py#L302 where None is used. Are there any others?

My opinion is that we should preserve NaN where they appear, but we also need to remember that standard equality says that NaN == NaN is false so we need specialise equality routines if we expect NaNs...