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

refactor: scripts/VISS_Sample_Data.R #24

Merged
merged 8 commits into from
Nov 27, 2024

Conversation

IshikaKhandelwal
Copy link
Collaborator

@IshikaKhandelwal IshikaKhandelwal commented Nov 12, 2024

This pull request includes several significant updates to the project, primarily focusing on importing new dependencies, adding new functions for climate data analysis, and updating the documentation. Below is a summary of the most important changes:

Dependency Updates:

  • Added new dependencies in the DESCRIPTION file: dplyr, purrr, sf, tibble, terra, exactextractr, future, and furrr.
  • Updated the NAMESPACE file to import functions from the new dependencies.

Documentation Updates:

  • Added documentation for the new functions: exposure, exposure_times, extract_climate_data, get_niche_limits, and prepare_range. [1] [2] [3] [4] [5]

Miscellaneous:

  • Added global variables declaration to R/globals.R to avoid R CMD check warnings.- Modularized key functions (prepare_range, extract_climate_data, get_niche_limits, exposure, exposure_times) and moved them to the /R folder for better code reuse and maintainability.
  • Created a comprehensive driver script scripts/VISS_Sample_Data.R to orchestrate the workflow, including range preparation, climate data extraction, thermal niche limit computation, exposure calculation, and exposure times analysis.

Addressing: #22

Copy link
Member

@carlosgjs carlosgjs left a comment

Choose a reason for hiding this comment

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

this looks really good, mostly need to address the warnings and I have the question about exporting the core functions.

@@ -1,4 +1,25 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
importFrom(dplyr,across)
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we be also exporting the main package functions here? E.g. exposure, exposure_times, etc?

#' @return A tibble with exposure and de-exposure times
#' @importFrom dplyr filter pull
#' @importFrom tibble tibble
exposure_times <- function(data, original.state, consecutive.elements) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you look into all these warnings?

@uwcdc uwcdc added the enhancement New feature or request label Nov 19, 2024
@uwcdc uwcdc changed the title Refactor VISS_Sample_Data.R script refactor: scripts/VISS_Sample_Data.R Nov 19, 2024
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 123 lines in your changes missing coverage. Please review.

Project coverage is 0.80%. Comparing base (a8e3866) to head (6f97b21).

Files with missing lines Patch % Lines
R/exposure_times.R 0.00% 42 Missing ⚠️
R/get_niche_limits.R 0.00% 34 Missing ⚠️
R/prepare_range.R 0.00% 22 Missing ⚠️
R/exposure.R 0.00% 15 Missing ⚠️
R/extract_climate_data.R 0.00% 10 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (a8e3866) and HEAD (6f97b21). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (a8e3866) HEAD (6f97b21)
5 1
Additional details and impacted files
@@             Coverage Diff             @@
##              main     #24       +/-   ##
===========================================
- Coverage   100.00%   0.80%   -99.20%     
===========================================
  Files            1       6        +5     
  Lines            1     124      +123     
===========================================
  Hits             1       1               
- Misses           0     123      +123     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@IshikaKhandelwal
Copy link
Collaborator Author

I am currently facing an issue where no linting warnings appear when I test the package locally using lintr::lint_package() and after applying fixes like usethis::use_import_from(), adding proper imports in @importFrom directives, and ensuring the namespace is updated.

However, when I push the changes to GitHub, the CI workflow still reports linting warnings, particularly related to missing global function definitions (e.g., %>%, tibble, pull). Despite matching the local linter configuration to the one used in GitHub Actions, I am unable to reproduce these warnings locally, making it challenging to debug effectively.

Any insights on what might be causing this discrepancy or suggestions on how to proceed would be greatly appreciated!

Thanks!

@IshikaKhandelwal
Copy link
Collaborator Author

IshikaKhandelwal commented Nov 26, 2024

Added an issue for tracking the warnings issue here: #38

Copy link
Member

@carlosgjs carlosgjs left a comment

Choose a reason for hiding this comment

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

The warnings will be addressed in #38

@IshikaKhandelwal IshikaKhandelwal merged commit 69e9a4a into uw-ssec:main Nov 27, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants