{"id":47819699,"url":"https://github.com/ncsu-landscape-dynamics/pops-core","last_synced_at":"2026-04-03T19:05:00.191Z","repository":{"id":39970868,"uuid":"142505637","full_name":"ncsu-landscape-dynamics/pops-core","owner":"ncsu-landscape-dynamics","description":"PoPS Core: C++ library for the Pest or Pathogen Spread Model","archived":false,"fork":false,"pushed_at":"2025-06-26T19:00:01.000Z","size":6773,"stargazers_count":6,"open_issues_count":20,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-09-05T04:54:14.177Z","etag":null,"topics":["epidemiology","hacktoberfest","model","pathogen","pathogen-spread","pest","pests","pops","pops-library","simulation","spread"],"latest_commit_sha":null,"homepage":"https://ncsu-landscape-dynamics.github.io/pops-core","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ncsu-landscape-dynamics.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"contributing_docs/CODE_OF_CONDUCT.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-07-26T23:50:35.000Z","updated_at":"2025-06-26T19:00:03.000Z","dependencies_parsed_at":"2023-12-18T22:58:14.675Z","dependency_job_id":"52cf3e78-930c-447c-95ed-d09aa6fffc4d","html_url":"https://github.com/ncsu-landscape-dynamics/pops-core","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ncsu-landscape-dynamics/pops-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncsu-landscape-dynamics%2Fpops-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncsu-landscape-dynamics%2Fpops-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncsu-landscape-dynamics%2Fpops-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncsu-landscape-dynamics%2Fpops-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncsu-landscape-dynamics","download_url":"https://codeload.github.com/ncsu-landscape-dynamics/pops-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncsu-landscape-dynamics%2Fpops-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31371737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["epidemiology","hacktoberfest","model","pathogen","pathogen-spread","pest","pests","pops","pops-library","simulation","spread"],"created_at":"2026-04-03T19:03:51.946Z","updated_at":"2026-04-03T19:05:00.181Z","avatar_url":"https://github.com/ncsu-landscape-dynamics.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PoPS Core - Pest or Pathogen Spread Model Core\n\n[![Build Status](https://travis-ci.org/ncsu-landscape-dynamics/pops-core.svg?branch=master)](https://travis-ci.org/ncsu-landscape-dynamics/pops-core)\n[![DOI](https://zenodo.org/badge/142505637.svg)](https://zenodo.org/badge/latestdoi/142505637)\n\nPoPS Core is the core C++ library for the PoPS Model.\n\nPoPS (Pest or Pathogen Spread) is a stochastic spread model of pests\nand pathogens in forest and agricultural landscapes.\nIt is used for various pest, pathogens, and hosts.\nIt was originally developed for *Phytophthora ramorum* and the original\nversion of the model was written in R, later with Rcpp,\nand was based on Meentemeyer (2011) paper.\n\nPoPS Core is a header-only C++ library.\nIt is using templates for the main spatial data structures, i.e., rasters,\nto be universal and it makes use of C++11 features, so C++11 is the minimal\nrequired version.\n\n## How to cite\n\nIf you use this software or code, please cite the following papers:\n\n* Jones, C., Jones, S., Petrasova, A., Petras, V., Gaydos, D., \n  Skrip, M., Takeuchi, Y., Bigsby, K., and Meentemeyer, R., 2021.\n  Iteratively forecasting biological invasions with PoPS and a little help from \n  our friends.\n  *Frontiers in Ecology and the Environment* \n  [DOI: 10.1002/fee.2357](https://doi.org/10.1002/fee.2357)\n\nIn case you are using the automatic management feature in rpops or the\nsteering version of r.pops.spread (from the branch steering), please\ncite also:\n\n* Petrasova, A., Gaydos, D.A., Petras, V., Jones, C.M., Mitasova, H. and\n  Meentemeyer, R.K., 2020.\n  Geospatial simulation steering for adaptive management.\n  *Environmental Modelling \u0026 Software* 133: 104801.\n  [DOI: 10.1016/j.envsoft.2020.104801](https://doi.org/10.1016/j.envsoft.2020.104801)\n\nIn addition to citing the above paper, we also encourage you to\nreference, link, and/or acknowledge specific version of the software\nyou are using for example:\n\n* *We have used rpops R package version 1.0.0 from\n  \u003chttps://github.com/ncsu-landscape-dynamics/rpops\u003e*.\n\n## Contributing\n\nThis section is designed to clarify the branch structure and versioning of this repository (and interface repositories) and general naming of new features and bug fix branches, especially those that are take longer to develop.\n\n### Branch Structure\n\n1. **master** is the stable version of the model that is used for official releases. \n2. **fix-issuenumber** or **fix-bugdescription** are branched off of master then merged back via a pull request once bug is fixed.\n3. **new_feature** is where new features are developed before they are merged into Master via a pull request. For example, infect and vector are currently being developed and will be merged together prior to being merged to master for an official major version release.\n\n### Bug Fixes\n\nMost bugs/issues will be found in the **master** branch as it is the branch being used in the R package and Grass module. Thus bug fixes should be merged into **master** once tested on both R and Grass. Bug fixes should be released as minor versions (e.g. if major release is 1.0 then the first bug fix would be released as version 1.1 and both R and Grass would be updated to 1.1.0). If a bug is found in one of the interfaces (R package or Grass module) that doesn't require a change to PoPS Core then these repositories should be updated independently and maintain a patch release 1.0.x. For example, if the current version of the R package is 1.1.0 and Grass module is 1.1.0 and a bug is found in the R package then the R package version becomes 1.1.1 while the Grass version is 1.1.0. However, the version number is still shared for all the projects, so when a new version of the GRASS module is needed, it will be 1.1.2.\n\n### New Features\n\nWhen creating new features create a branch from **master** using the following syntax **new_feature**. For example, we want to add a transportation network model for human assisted dispersal, the branch created would be named transportation_network_model (or similar). New features will be merged into **master** once tested based on the priorities of our stakeholders first. Once new features are tested in R and Grass with the latest bug fixes and any other new features being included in the next major release we will merge them into **master** and create an official major release version (e.g. update from version 1.1 to version 2.0 and the R package and Grass module are updated to 2.0.0). When you are creating branches in your fork, we still recommend choosing informative names such as the one suggested above.\n\nIf you are interested in contributing to PoPS and are not a core developer on the model, please take a look at following\ndocuments to make the process as seamless as possible.\n\n1. [Contributor Code of Conduct](contributing_docs/CODE_OF_CONDUCT.md)\n1. [PoPS Core Style Guide](contributing_docs/STYLE_GUIDE.md)\n1. [Contributor Guide](contributing_docs/CONTRIBUTING.md)\n\n## C++ API\n\nThe stable API to be used in other projects includes the `pops::Model`\nand `pops::Config` classes and classes used in their API (for example,\n`pops::SpreadRate`).\nThis API is changed only between major versions or, if really needed,\nto fix serious issues in the released major version.\n\nOther classes and functions are part of the internal API and although\nyou can use them in your project, you will need to follow the changes\nin the library more closely and update your code more often.\n\nIf you are using the C++ API, we invite you to open an issue in this\nrepository to tell us about it and we can both acknowledge you in this\nrepo or elsewhere and discuss planned changes with you.\n\n## Core Functions\n\nIf you are interested in reviewing the code, you may want to focus at\nthe following core functions rather than the API.\n\nsimulation.remove : removes the pest or pathogen from the infested hosts based on some environmental threshold (currently only temperature is accounted for).\n\nsimulation.generate : generates dispersing individuals from all infested cells based as a function of local infected hosts and weather.\n\nsimulation.disperse : creates dispersal locations for the dispersing individuals from the generate function.\n\nsimulation.mortality : causes mortality in infested/infected hosts based on mortality rate\n\nThe custom date class is used to easily manage different time steps within the model and account for differences in the way frequently used weather data sets treat leap years (DAYMET drops December 31st from leap years, PRISM keeps all days even for leap years)\n\n## Using the model\n\nThe PoPS Core library can be used directly in a C++ program or through other\nprograms. It is used in R package called rpops and a GRASS GIS module\ncalled r.pops.spread.\n\n* https://github.com/ncsu-landscape-dynamics/r.pops.spread\n* https://github.com/ncsu-landscape-dynamics/rpops\n\n## Integrating the library into your own project\n\n### As a Git submodule\n\nThis is a convenient way, if you are using Git and you can use the C++\nheader files directly.\n\nGit supports inclusion of other repositories into your own code using\na mechanism called submodules. In your repository, run:\n\n```\ngit submodule add https://github.com/ncsu-landscape-dynamics/pops-core\n```\n\nIf you want a specific branch of PoPS Core, after adding the\nPoPS submodule, run the following commands (with branch-name being\nthe branch of the PoPS library you want to use):\n\n```\ncd pops-core\ngit checkout origin/branch-name\n```\n\nThe will create a directory called `pops-core` in your repository which\nwill now contain all the files from this repository. You can use the two\nfollowing commands to see the changes to your repository:\n\n```\ngit status\ngit diff --cached\n```\n\nGit added a file called `.gitmodules` with the link to this repository\nand linked a specific commit in this repository. The commit linked is\nthe currently latest commit to PoPS library.\n\nYou can now commit and push changes to your repository.\n\nWhen someone else clones our project, they need to run the two following\ncommands to get the content of the `pops-core` directory:\n\n```\ngit submodule init\ngit submodule update\n```\n\nAlternatively, the `pops-core` directory can be populated during cloning\nwhen `git clone` is used with the `--recurse-submodules` parameter.\n\nIf you want to update the specific PoPS commit your repository is using\nto the latest one, you the following command:\n\n```\ngit submodule update --remote\n```\n\n## Compile and test\n\nHere we are assuming that you use Linux command line or equivalent\nand you have CMake and C++ compiler installed.\nWe are testing with GNU GCC with (`g++`) and GNU make (`make`),\nbut many of other tools supported by CMake should work too.\nSee CMake documentation for different ways of compiling.\n\nFirst download the source code (as a ZIP file and unpack it or use Git\nto get it from the Git repository).\n\nConfigure the project and use directory called `build` for configure and\nbuild outputs:\n\n```\ncmake -S . -B build\n```\n\nBuild the project:\n\n```\ncmake --build build\n```\n\nThe library itself does not need compilation since it is header only\n(it is compiled later with your project), but this compiled several\ntest programs.\n\nTo run these tests:\n\n```\ncmake --build build --target test\n```\n\nIf something is wrong, this will generate error messages.\nNote that not all tests are not fully automatic, so in couple cases\nthis only testing if the code is running and not crashing\n(you will need to examine the source code to see the details).\n\nAdditionally, create documentation using the following (_Doxygen_ required):\n\n```\ncmake --build build --target docs\n```\n\nThe HTML documentation will appear in the `html` subdirectory of `build`\ndirectory. Open the file called `index.html` to access it in a web browser.\n\nOptionally, to remove the build directory when you are done, use:\n\n```\nrm -rf build\n```\n\n## Compiling as part of another project\n\nNote that if you are not using CMake, you can just add the headers to\nyour project since this a header-only library. However,\nif you are using CMake, you probably want to use the following approach.\n\nAssuming you added the directory as a submodule or a plain subdirectory\ncalled `pops-core` add these two following lines to your `CMakeLists.txt` file\n(assuming you already have target called `your_target`):\n\n```\nadd_subdirectory(pops-core)\ntarget_link_libraries(your_target PRIVATE pops-core)\n```\n\n## Authors and contributors\n\n### Authors\n\n_(ordered by number of commits)_\n\n* Vaclav Petras\n* Chris Jones\n* Anna Petrasova\n\n### Previous contributors\n\n_(ordered alphabetically)_\n\n* Zexi Chen\n* Devon Gaydos\n* Margaret Lawrimore\n* Francesco Tonini\n\nSee Git commit history, GitHub insights, or CHANGELOG.md file (if present)\nfor details about contributions.\n\n## License\n\nPermission to use, copy, modify, and distribute this software and\nits documentation under the terms of the GNU General Public License\nis hereby granted. No representations are made about the suitability\nof this software for any purpose. It is provided \"as is\" without express\nor implied warranty. See the\n[GNU General Public License](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)\nfor more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncsu-landscape-dynamics%2Fpops-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncsu-landscape-dynamics%2Fpops-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncsu-landscape-dynamics%2Fpops-core/lists"}