Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of updating Livneh weather DB extraction #331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CaitlinA
Copy link
Member

  • Created new branch
  • Changed demo/ and TestPrj4/ description files so user can choose
    between versions
  • Updated extract_daily_weather_from_livneh with version argument and
    pertinent if ... statement
  • Other arguments within WeatherDB.R for additional data source including
    finding ids and paths.

* Created new branch
* Changed demo/ and TestPrj4/ description files so user can choose
  between versions
* Updated extract_daily_weather_from_livneh with version argument and
  pertinent if ... statement
* Other arguments within WeatherDB.R for additional data source including
  finding ids and paths.
@CaitlinA CaitlinA requested a review from dschlaep August 21, 2018 00:15
@codecov
Copy link

codecov bot commented Aug 21, 2018

Codecov Report

Merging #331 into master will decrease coverage by 0.13%.
The diff coverage is 3.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #331      +/-   ##
==========================================
- Coverage   48.01%   47.87%   -0.14%     
==========================================
  Files          40       40              
  Lines       16627    16679      +52     
==========================================
+ Hits         7983     7985       +2     
- Misses       8644     8694      +50
Impacted Files Coverage Δ
R/WeatherDB.R 6.71% <3.22%> (-0.14%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45ef6ab...fc48d42. Read the comment docs.

Copy link
Member

@dschlaep dschlaep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output from lintr checks test_file("tests/testthat/test_rSFSW2_StyleSpelllingPractices.R"):

test_rSFSW2_StyleSpelllingPractices.R:29: failure: Package code style
Not lint free
R/WeatherDB.R:281:24: style: Only use double-quotes.
        version      = 'v2013',
                       ^~~~~~~
R/WeatherDB.R:300:24: style: Only use double-quotes.
        version      = 'v2016',
                       ^~~~~~~
R/WeatherDB.R:1451:5: style: Place a space before left parenthesis, except in a function call.
  if(version == 'v2013') {
    ^
R/WeatherDB.R:1451:17: style: Only use double-quotes.
  if(version == 'v2013') {
                ^~~~~~~
R/WeatherDB.R:1452:21: style: Use <-, not =, for assignment.
    end_year_livneh = 2011
                    ^
R/WeatherDB.R:1457:5: style: Place a space before left parenthesis, except in a function call.
  if(version == 'v2016') {
    ^
R/WeatherDB.R:1457:17: style: Only use double-quotes.
  if(version == 'v2016') {
                ^~~~~~~
R/WeatherDB.R:1458:21: style: Use <-, not =, for assignment.
    end_year_livneh = 2015
                    ^
R/WeatherDB.R:1464:1: style: Lines should not be more than 80 characters.
    has_start_year = 1915, has_end_year = end_year_livneh, temp_call = temp_call,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/WeatherDB.R:1500:22: style: Only use double-quotes.
      if (version == 'v2013') {
                     ^~~~~~~
R/WeatherDB.R:1507:22: style: Only use double-quotes.
      if (version == 'v2016') {
                     ^~~~~~~
tests/test_data/TestPrj4/SFSW2_project_descriptions.R:160:13: style: Commented code should be removed.
      #     file.path(project_paths[["dir_ex_weather"]], "Livneh_NA_2016")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

temp <- unlist(lapply(temp, function(x)
if (length(x) == 3 && x[3] == "nc") x[2]))

db_months <- formatC(SFSW2_glovars[["st_mo"]], width = 2, flag = "0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is exact repeat from line 1504. Move after if (version == ...) {}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants