Add OBIS EOV notebook & update env#219
Add OBIS EOV notebook & update env#219laurabrenskelle wants to merge 1573 commits intoioos:gh-pagesfrom
Conversation
step 2 to fix 132
updates: - [github.com/psf/black: 23.1.0 → 23.3.0](psf/black@23.1.0...23.3.0) - [github.com/charliermarsh/ruff-pre-commit: v0.0.257 → v0.0.260](astral-sh/ruff-pre-commit@v0.0.257...v0.0.260) - [github.com/nbQA-dev/nbQA: 1.6.4 → 1.7.0](nbQA-dev/nbQA@1.6.4...1.7.0)
[pre-commit.ci] pre-commit autoupdate
updates: - [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.6 → v3.0.0-alpha.9-for-vscode](pre-commit/mirrors-prettier@v3.0.0-alpha.6...v3.0.0-alpha.9-for-vscode) - [github.com/charliermarsh/ruff-pre-commit: v0.0.260 → v0.0.263](astral-sh/ruff-pre-commit@v0.0.260...v0.0.263)
[pre-commit.ci] pre-commit autoupdate
Bumps [mamba-org/provision-with-micromamba](https://github.com/mamba-org/provision-with-micromamba) from 15 to 16. - [Release notes](https://github.com/mamba-org/provision-with-micromamba/releases) - [Commits](mamba-org/provision-with-micromamba@v15...v16) --- updated-dependencies: - dependency-name: mamba-org/provision-with-micromamba dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…-org/provision-with-micromamba-16 Bump mamba-org/provision-with-micromamba from 15 to 16
Update umamba gha
fix download confusion
update lockfile
updates: - [github.com/asottile/add-trailing-comma: v2.4.0 → v3.0.0](asottile/add-trailing-comma@v2.4.0...v3.0.0) - https://github.com/charliermarsh/ruff-pre-commit → https://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.0.270 → v0.0.276](astral-sh/ruff-pre-commit@v0.0.270...v0.0.276)
[pre-commit.ci] pre-commit autoupdate
updates: - [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.9-for-vscode → v3.0.0](pre-commit/mirrors-prettier@v3.0.0-alpha.9-for-vscode...v3.0.0) - [github.com/psf/black: 23.3.0 → 23.7.0](psf/black@23.3.0...23.7.0) - [github.com/asottile/add-trailing-comma: v3.0.0 → v3.0.1](asottile/add-trailing-comma@v3.0.0...v3.0.1) - [github.com/astral-sh/ruff-pre-commit: v0.0.276 → v0.0.281](astral-sh/ruff-pre-commit@v0.0.276...v0.0.281)
[pre-commit.ci] pre-commit autoupdate
Co-authored-by: Filipe <ocefpaf@gmail.com>
fixing issue template for new guidance
fixing template
…b-actions-0bd1363a87 Bump actions/checkout from 4.1.6 to 4.1.7 in the github-actions group
…ater_temp fix broken link
Fix data URL
updates: - [github.com/psf/black: 24.4.2 → 24.8.0](psf/black@24.4.2...24.8.0) - [github.com/astral-sh/ruff-pre-commit: v0.4.8 → v0.5.6](astral-sh/ruff-pre-commit@v0.4.8...v0.5.6) - [github.com/nbQA-dev/nbQA: 1.8.5 → 1.8.7](nbQA-dev/nbQA@1.8.5...1.8.7)
[pre-commit.ci] pre-commit autoupdate
add preview page
updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.6 → v0.6.3](astral-sh/ruff-pre-commit@v0.5.6...v0.6.3)
[pre-commit.ci] pre-commit autoupdate
Adding dplyr and gh R packages
|
This could be submitted with the new notebook to make it a little clearer as to why we're adding new packages (related to #218). It's also fine as a separate PR. |
|
closes #218 |
|
Folks will need to update their >conda list | grep vctrs
r-vctrs 0.6.1 r41ha856d6a_0 conda-forge
>conda install r-vctrs
added / updated specs:
- r-vctrs
The following packages will be downloaded:
package | build
---------------------------|-----------------
r-vctrs-0.6.5 | r41ha856d6a_0 1.2 MB conda-forge
------------------------------------------------------------
Total: 1.2 MB
The following packages will be UPDATED:
r-vctrs 0.6.1-r41ha856d6a_0 --> 0.6.5-r41ha856d6a_0
Proceed ([y]/n)? y
Downloading and Extracting Packages
Preparing transaction: done
Verifying transaction: done
Executing transaction: doneNot sure if that's something to specify in the environment file or not. |
|
Interesting. I guess I didn't run into that because I had to uninstall and reinstall the environment with the new added packages so I think that automatically updated the other packages in the process. |
|
For some reason, library(htmlwidgets)
# use the built in leaflet capability from robis to map the occurrences
m <- map_leaflet(mangrove_occ,
provider_tiles = "Esri.WorldGrayCanvas",
popup = function(x) { x["scientificName"] },
)
saveWidget(m, file="test.html") |
|
I've been playing around with this notebook and was thinking it would be cool to couple it with the Here is the snippet of code that should make the heatmap: h3_indicators <- function(occ, resolution = 9) {
## Compute all indicators on the grid resolution of interest for the points in the identified polygons
occ <- occ %>%
group_by(decimalLongitude, decimalLatitude, species, date_year) %>% # remove duplicate rows
filter(!is.na(species)) %>%
summarize(records = n(), .groups = "drop") %>%
collect()
# return h3 cell index for occurrences in polygon
occ_h3 <- occ %>%
mutate(cell = h3::geo_to_h3(data.frame(decimalLatitude, decimalLongitude), res = RES))
# group by cell index and compute indicators
idx <- obisindicators::calc_indicators(occ_h3)
# convert hexagon ids to spatial features
# NOTE: DATELINEOFFSET is inv proportional to hex_res b/c we need to look
# further from the dateline as hex sizes get bigger.
dl_offset <- 60 # 60 is enough for hex_res >= 1. res 0 is weird; don't use it.
hex_sf <- purrr::map_df(idx$cell, h3::h3_to_geo_boundary_sf) %>%
sf::st_wrap_dateline(c(
"WRAPDATELINE=YES",
glue::glue("DATELINEOFFSET={dl_offset}")
)) %>%
dplyr::mutate(hexid = idx$cell)
# merge geometry into indicator table
grid <- hex_sf %>%
inner_join(idx, by = c("hexid" = "cell"))
return(grid)
}
# Compute indicators at some resolution
grid <- h3_indicators(mangrove_occ, res=4)
# Number of records, log10 scale, Geographic projection
gmap_indicator(grid, "n", label = "# of records", trans = "log10", crs=4326) |
|
I messed this up. I somehow changed the base branch in this PR, which then closed the request. I'm working on figuring out what went wrong. |
|
and it wont let me reopen the PR. I think I can start it over again from your |
Adding dplyr and gh R packages