home / github / commits

Menu
  • GraphQL API
  • Search all tables

commits: aeb00f9da90e4485d2e94f6796c7dd96a2cb1278

This data as json

sha message author_date committer_date raw_author raw_committer repo author committer
aeb00f9da90e4485d2e94f6796c7dd96a2cb1278 _season_from_months can now handle np.nan (#5876) * _season_from_months can now handle np.nan _season_from_months can now handle np.nan and values outside of [1,12] I passed these tests: def test_season(): months = np.array([ 1, 2, 3, 4, 5, np.nan]) assert ( _season_from_months(months) == np.array(['DJF', 'DJF', 'MAM', 'MAM', 'MAM', 'na']) ).all() months = np.array([ 1, 100, 3, 13, 0, -5]) assert ( _season_from_months(months) == np.array(['DJF', 'na', 'MAM', 'na', 'na', 'na']) ).all() months = np.array(range(1, 13)) assert ( _season_from_months(months) == np.array(['DJF', 'DJF', 'MAM', 'MAM', 'MAM', 'JJA', 'JJA', 'JJA', 'SON', 'SON', 'SON', 'DJF']) ).all() test_season() * Run black * Remove duplicated import * returns np.nan and removed the useless attribution returns np.nan and removed the useless attribution when month is not in [1,12] * added test * applied black recommendations * Apply suggestions from code review finally, NaT is output as a "nan" string Co-authored-by: Spencer Clark <spencerkclark@gmail.com> * update whatsnew * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correction on the credits Co-authored-by: Spencer Clark <spencerkclark@gmail.com> Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com> Co-authored-by: Spencer Clark <spencerkclark@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 2022-01-11T16:06:18Z 2022-01-11T16:06:18Z acde3fb723d93dd977944e567526dca54f64ec7d cd792325681cbad9f663f2879d8b69f1edbb678f 13221727 8809578 19864447
Powered by Datasette · Queries took 76.132ms · About: xarray-datasette