Skip to content

Migration v2 ‐ v3

Raphaël edited this page Sep 23, 2024 · 9 revisions

This is a guide to migrate your code from GeoPressureR v2 to v3

Guiding principles

  • Name more general than SOI sensors (e.g., use tag instead of pam)
  • Focus the workflow on pressure sensor (but still allows for acceleration or light data)
  • Update the notion of graph into State-Space Model notations (e.g. probability -> likelihood)
  • More memory efficient (store minimum graph info) while minimizing computational expense of the "slow" functions
  • Shorter workflow #69
  • Ease of labeling #67
  • Reproducibility and long-term storage with param.
  • Use of S3 class object with print and plot generic function.
  • Compatible with pipe |> or %>%
  • Use of cli for message and progress bar.

Varibles and functions name changes

⚠️ See #55 for details on the functions named change

Update your package

GeoPressureTemplate

It is probably better to start from the new exisitng folder structure and delete the old one. Most of the script and functions have changed.

Data

You can keep the raw data and move them in their new folder

  • data/0_PAM -> data/raw-tag
  • data/1_pressure/labels -> data/tag-label
  • data/2_light/labels -> data/twilight-label

Convert tag labels

Here is a script to convert label file https://gist.github.com/Rafnuss/caffd26b01d87faee2783cea8fc0d4ac

Edit config.yml

config.yml essentially replace data/gpr_settings.xlsx. It is now located in the project folder. Here is the start of a code to extract the information. A manual editing is required after https://gist.github.com/Rafnuss/5203851b463d7d13c7f36e08587c83bc

Analysis

It is probably better to start from the new analysis file and delete the old R script. In the new structure, we seperate script to edit the label and config file from a script that runs the code and produce the results: geopressure.R.

Keep v2

To use v2, you need to install the branch v2

remotes::install_github("Rafnuss/[email protected]")