Giter VIP home page Giter VIP logo

rphosfate's Introduction

An enhanced version of the semi-empirical, spatially distributed emission and transport model PhosFate implemented in R and C++. It currently supports suspended solids (SS) and particulate phosphorus (PP). A major feature is the allocation of substance loads entering surface waters to their sources of origin, which is a basic requirement for the identification of critical source areas and in consequence a cost-effective implementation of mitigation measures.

Copyright (C) 2021 RPhosFate authors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Installation

Install the latest release from CRAN:

install.packages("RPhosFate")

CRAN Version CRAN Checks

Install the development version from GitHub (requires Rtools on Windows and the remotes package):

remotes::install_github("gisler/RPhosFate")

R build status GitHub Super-Linter

Semantic versioning

Releases of this project are versioned following the rules of SemVer.

rphosfate's People

Contributors

gisler avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

rphosfate's Issues

Test concept and data

Define test concept and prepare data

  • Test concept (tinytest)
    • Add tests for low level interface
    • Add tests for high level interface
    • Add tests for getters and setters
  • Test data (HOAL catchment)
    • Use open government data were possible (DEM, channels, roads, fields)
    • Add data to "inst" folder
    • Make plausible assumptions about soil and related data as well as loads (update test data and parameters in examples etc.)
    • Manually check test data

Revise interface

Efficient interface for SS and PP

  • Add inheritance for substance classes
  • Revise relevant functions using PP as default substance for backward compatibility
    • emission()
    • transport()
    • firstRun()
    • calibrationQuality()
    • subsequentRun()

Sanity checks

Implement function argument sanity checks utilising checkmate

  • autoCalibrate()
  • calibrationQuality()
  • DEMrelatedInput()
  • emission()
  • firstRun()
  • subsequentRun()
  • transport()

YAML file for parameters

Write and read parameters from a YAML instead of RDS file

  • Test functionality from yaml package: test successful
  • Replace parameters.rds with parameters.yaml
    • Write YAML file
    • Read YAML file and allow for overrides via arguments
  • Check for existence of parameters.rds and add parameters.yaml on catchment initialisation for backward compatibility if only the RDS file exists

Model handbook

Write best practice model handbook

  • Decide on language(s): en_GB
  • Decide on platform: website utilising GitHub Pages
  • pkgdown + bookdown
  • Write handbook

Please remove dependencies on **rgdal**, **rgeos**, and/or **maptools**

This package depends on (depends, imports or suggests) raster and one or more of the retiring packages rgdal, rgeos or maptools (https://r-spatial.org/r/2022/04/12/evolution.html). Since raster 3.6.3, all use of external FOSS library functionality has been transferred to terra, making the retiring packages very likely redundant. It would help greatly if you could remove dependencies on the retiring packages as soon as possible.

Getters and setters

Implememt getters and setters

  • getLayer()
  • getParameter()
  • setParameter()
    • Add prototype list to the RPhosFateParameters2 class
    • Add class sanity checks (setValidity() and validObject())

Help files

Write help files utilising roxygen2

  • Document RPhosFate class
  • Document constructors
  • Document methods
  • Document DEMrelatedInput()
  • Add demoProject() function providing training data
  • Document demonstration project data
  • Add examples utilising \dontrun{}
  • Add "example.R" script, which allows for checking if examples are working

Automatic model calibration

Concept for and implementation of automatic model calibration

  • Prepare calibrationQuality() for use with optimisation algorithm
  • Choose approach and optimisation algorithm
    • Two-stage calibration: first ns_dep_ovl (overland deposition rate) for SS and then nv_enr_rto (enrichment ratio) for all other substances (no calibration of ns_dep_cha (channel deposition rate))
    • Algorithm for one dimensional optimisation without derivatives as implemented in stats::optimize() (combination of golden section search and successive parabolic interpolation)
    • Allow for manual override of the default calibration parameter so that ns_dep_cha alternatively can be used for SS or, for example, ns_dep_ovl for PP
  • Implement feature

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.