Skip to content

Latest commit

 

History

History
66 lines (40 loc) · 1.9 KB

development.md

File metadata and controls

66 lines (40 loc) · 1.9 KB

countland Development

All development should be on a feature or development branch. Do not merge back into master until devtools::check() is passing for R code and XXX is passing for python code.

Development in python

To install from local source:

conda create -n countland -c conda-forge python==3.10
conda activate countland
cd countland-py
pip install .[dev]
pip install jupyter

This will reload countland functions (e.g. after an edit)

import importlib
importlib.reload(countland)

To run tests for countland-py/:

conda activate countland
python -m pytest

Our automated code review draws on this strategy.

To manually run it, cd to countland\countland-py\countland and run:

black .
flake8 .

Development in R

Loading and packaging

This package is built with the excellent devtools. Extensive explanations on using devtools to create R packages is available in the book R Packages.

Development typically involves cding to the package directory countland-R/, launching R, and running some combination of the following:

options(error=traceback) # Get line numbers for errors
library(devtools)
devtools::load_all()
devtools::test()
devtools::document()
devtools::check() # A wrapper for R CMD check, see http://r-pkgs.had.co.nz/check.html#check
devtools::build() # Create package bundle, including executed vignettes

To regenerate the pdf manual, run the following shell command in the package directory:

R CMD Rd2pdf . --force --output=countland-manual.pdf

Vignettes

Construction of vignettes follows https://r-pkgs.org/vignettes.html .

Container development

This works nicely for developing countland R code.