{"action":"created","issue":{"url":"https://api.github.com/repos/USGS-R/streamMetabolizer/issues/141","labels_url":"https://api.github.com/repos/USGS-R/streamMetabolizer/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/USGS-R/streamMetabolizer/issues/141/comments","events_url":"https://api.github.com/repos/USGS-R/streamMetabolizer/issues/141/events","html_url":"https://github.com/USGS-R/streamMetabolizer/issues/141","id":128228442,"number":141,"title":"time conversion on travis","user":{"login":"aappling-usgs","id":12039957,"avatar_url":"https://avatars.githubusercontent.com/u/12039957?v=3","gravatar_id":"","url":"https://api.github.com/users/aappling-usgs","html_url":"https://github.com/aappling-usgs","followers_url":"https://api.github.com/users/aappling-usgs/followers","following_url":"https://api.github.com/users/aappling-usgs/following{/other_user}","gists_url":"https://api.github.com/users/aappling-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/aappling-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aappling-usgs/subscriptions","organizations_url":"https://api.github.com/users/aappling-usgs/orgs","repos_url":"https://api.github.com/users/aappling-usgs/repos","events_url":"https://api.github.com/users/aappling-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/aappling-usgs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/USGS-R/streamMetabolizer/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/USGS-R/streamMetabolizer/labels/ready","name":"ready","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-22T19:39:22Z","updated_at":"2016-02-01T23:38:21Z","closed_at":null,"body":"New and interesting failure on Travis today (https://travis-ci.org/USGS-R/streamMetabolizer/builds/104157263): \r\n```\r\n> test_check('streamMetabolizer')\r\nLoading required package: streamMetabolizer\r\nThis information is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The information has not received final approval by the U.S. Geological Survey (USGS) and is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the information. Although this software program has been used by the USGS, no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.\r\n1. Failure (at test-convert.R#35): converting between date and DOY works -------\r\nconvert_date_to_doyhr(as.POSIXct(\"2016-05-29 01:00:00\", tz = \"CST6CDT\")) not equal to 150\r\n150 - 150 == 0.0417\r\ntreat numbers as true time since jan 1, ignoring daylight time\r\n\r\n2. Failure (at test-convert.R#42): converting between date and DOY works -------\r\nconvert_date_to_doyhr(convert_doyhr_to_date(120, year = 1998, tz = \"CST6CDT\")) not equal to 120\r\n120 - 120 == 0.0417\r\nshould preserve DOY in there&back even during daylight savings\r\n\r\n3. Failure (at test-convert.R#43): converting between date and DOY works -------\r\nconvert_doyhr_to_date(convert_date_to_doyhr(as.POSIXct(\"2007-06-15 12:00:00\", tz = \"MST7MDT\")), 2007, tz = \"MST7MDT\") not equal to as.POSIXct(\"2007-06-15 12:00:00\", tz = \"MST7MDT\")\r\nMean absolute difference: 3600\r\npreserve date in there&back\r\n\r\nCalling 2 simulations using the parallel method...\r\nAll chains have finished\r\nSimulation complete.  Reading coda files...\r\nCoda files loaded successfully\r\nFinished running the simulation\r\nCalling 2 simulations using the parallel method...\r\nAll chains have finished\r\nSimulation complete.  Reading coda files...\r\nCoda files loaded successfully\r\nFinished running the simulation\r\ntestthat results ================================================================\r\nOK: 289 SKIPPED: 0 FAILED: 3\r\n1. Failure (at test-convert.R#35): converting between date and DOY works \r\n2. Failure (at test-convert.R#42): converting between date and DOY works \r\n3. Failure (at test-convert.R#43): converting between date and DOY works \r\n\r\nError: testthat unit tests failed\r\nIn addition: Warning messages:\r\n1: In getSchmidt(temperature, gas) : temperature out of range\r\n2: In getSchmidt(temperature, gas) : temperature out of range\r\n3: In getSchmidt(temperature, gas) : temperature out of range\r\n4: In getSchmidt(temperature, gas) : temperature out of range\r\n5: In getSchmidt(temperature, gas) : temperature out of range\r\n6: In getSchmidt(temperature, gas) : temperature out of range\r\n7: In getSchmidt(temperature, gas) : temperature out of range\r\n8: In getSchmidt(temperature, gas) : temperature out of range\r\n9: In getSchmidt(temperature, gas) : temperature out of range\r\nExecution halted\r\n\r\ntravis_time:end:01faefe6:start=1453490012280903437,finish=1453490012287478155,duration=6574718\r\n\u001B[0KR CMD check failed\r\n```"},"comment":{"url":"https://api.github.com/repos/USGS-R/streamMetabolizer/issues/comments/178257497","html_url":"https://github.com/USGS-R/streamMetabolizer/issues/141#issuecomment-178257497","issue_url":"https://api.github.com/repos/USGS-R/streamMetabolizer/issues/141","id":178257497,"user":{"login":"aappling-usgs","id":12039957,"avatar_url":"https://avatars.githubusercontent.com/u/12039957?v=3","gravatar_id":"","url":"https://api.github.com/users/aappling-usgs","html_url":"https://github.com/aappling-usgs","followers_url":"https://api.github.com/users/aappling-usgs/followers","following_url":"https://api.github.com/users/aappling-usgs/following{/other_user}","gists_url":"https://api.github.com/users/aappling-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/aappling-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aappling-usgs/subscriptions","organizations_url":"https://api.github.com/users/aappling-usgs/orgs","repos_url":"https://api.github.com/users/aappling-usgs/repos","events_url":"https://api.github.com/users/aappling-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/aappling-usgs/received_events","type":"User","site_admin":false},"created_at":"2016-02-01T23:38:21Z","updated_at":"2016-02-01T23:38:21Z","body":"Here's the whole testthat block:\r\n```r\r\ntest_that(\"converting between date and DOY works\", {\r\n  # date to doyhr\r\n  expect_equal(convert_date_to_doyhr(as.POSIXct(\"2020-01-01 00:00:00\", tz=\"GMT\")), 1, tol=0.000001, info=\"Jan 1 should be 1\")\r\n  expect_equal(convert_date_to_doyhr(as.POSIXct(\"2020-01-01 00:00:00\", tz=\"CST6CDT\")), 1, tol=0.000001, info=\"use the same timezone as the arg date\")\r\n  expect_equal(convert_date_to_doyhr(as.POSIXct(\"2020-01-01 00:00:00\")), 1, tol=0.000001, info=\"should work in any tester's default tz\")\r\n  expect_equal(convert_date_to_doyhr(as.POSIXct(\"2020-01-01 01:00:00\")), 1+1/24, tol=0.000001, info=\"decimal should include hours\")\r\n  expect_equal(convert_date_to_doyhr(as.POSIXct(\"2020-01-01 01:03:58\")), 1+(60+3+58/60)/(24*60), tol=0.000001, info=\"decimal should include minutes and seconds\")\r\n  expect_equal(convert_date_to_doyhr(as.POSIXct(\"2004-12-01 00:00:00\")), 1+convert_date_to_doyhr(as.POSIXct(\"2019-12-01 00:00:00\")), tol=0.000001, info=\"should catch leap days\")\r\n  expect_equal(convert_date_to_doyhr(as.POSIXct(\"2016-05-29 01:00:00\", tz=\"CST6CDT\")), 150, info=\"treat numbers as true time since jan 1, ignoring daylight time\")\r\n  # doyhr to date\r\n  expect_equal(convert_doyhr_to_date(1, year=1920), as.POSIXct(\"1920-01-01 00:00:00\", tz=\"GMT\"), info=\"1 should be Jan 1, default GMT\")\r\n  expect_equal(convert_doyhr_to_date(3, year=2016, tz=\"CST6CDT\"), as.POSIXct(\"2016-01-03 00:00:00\", tz=\"CST6CDT\"), info=\"tz should stay as indicated\")\r\n  expect_equal(convert_doyhr_to_date(150, year=2016, tz=\"CST6CDT\"), as.POSIXct(\"2016-05-29 01:00:00\", tz=\"CST6CDT\"), info=\"treat numbers as true time since jan 1, ignoring daylight time\")\r\n  # there and back\r\n  expect_equal(convert_date_to_doyhr(convert_doyhr_to_date(12, year=2024, tz=\"CST6CDT\")), 12, info=\"should preserve DOY in there&back\")\r\n  expect_equal(convert_date_to_doyhr(convert_doyhr_to_date(120, year=1998, tz=\"CST6CDT\")), 120, info=\"should preserve DOY in there&back even during daylight savings\")\r\n  expect_equal(convert_doyhr_to_date(convert_date_to_doyhr(as.POSIXct(\"2007-06-15 12:00:00\", tz=\"MST7MDT\")), 2007, tz=\"MST7MDT\"), \r\n               as.POSIXct(\"2007-06-15 12:00:00\", tz=\"MST7MDT\"), info=\"preserve date in there&back\") \r\n})\r\n```\r\nand here are the lines that fail:\r\n```r\r\nexpect_equal(convert_date_to_doyhr(as.POSIXct(\"2016-05-29 01:00:00\", tz=\"CST6CDT\")), 150, info=\"treat numbers as true time since jan 1, ignoring daylight time\")\r\nexpect_equal(convert_date_to_doyhr(convert_doyhr_to_date(120, year=1998, tz=\"CST6CDT\")), 120, info=\"should preserve DOY in there&back even during daylight savings\")\r\nexpect_equal(convert_doyhr_to_date(convert_date_to_doyhr(as.POSIXct(\"2007-06-15 12:00:00\", tz=\"MST7MDT\")), 2007, tz=\"MST7MDT\"), \r\n             as.POSIXct(\"2007-06-15 12:00:00\", tz=\"MST7MDT\"), info=\"preserve date in there&back\") \r\n```\r\n\r\nlooks to me like the failure is happening only when daylight savings time is on (summer). this is consistent with the numerical differences in the error messages - 0.0417 is 1/24 day is 1 hour, and 3600 seconds is also 1 hour. so there's something about the (new?) Travis environment that's failing to understand time zones as we're communicating them."}}