Skip to content

Commit

Permalink
Use #-space-% to allow writing PEP8-compliant Python code (synced fro…
Browse files Browse the repository at this point in the history
…m addons)
  • Loading branch information
petrasovaa committed Mar 15, 2022
1 parent 6d1baa2 commit 1bbc355
Show file tree
Hide file tree
Showing 8 changed files with 829 additions and 829 deletions.
522 changes: 261 additions & 261 deletions r.futures/r.futures.calib/r.futures.calib.py

Large diffs are not rendered by default.

122 changes: 61 additions & 61 deletions r.futures/r.futures.demand/r.futures.demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,67 +16,67 @@
#
##############################################################################

#%module
#% description: Script for creating demand table which determines the quantity of land change expected.
#% keyword: raster
#% keyword: demand
#%end
#%option G_OPT_R_INPUTS
#% key: development
#% description: Names of input binary raster maps representing development
#% guisection: Input maps
#%end
#%option G_OPT_R_INPUT
#% key: subregions
#% description: Raster map of subregions
#% guisection: Input maps
#%end
#%option G_OPT_F_INPUT
#% key: observed_population
#% description: CSV file with observed population in subregions at certain times
#% guisection: Input population
#%end
#%option G_OPT_F_INPUT
#% key: projected_population
#% description: CSV file with projected population in subregions at certain times
#% guisection: Input population
#%end
#%option
#% type: integer
#% key: simulation_times
#% multiple: yes
#% required: yes
#% description: For which times demand is projected
#% guisection: Output
#%end
#%option
#% type: string
#% key: method
#% multiple: yes
#% required: yes
#% description: Relationship between developed cells (dependent) and population (explanatory)
#% options: linear, logarithmic, exponential, exp_approach, logarithmic2
#% descriptions:linear;y = A + Bx;logarithmic;y = A + Bln(x);exponential;y = Ae^(BX);exp_approach;y = (1 - e^(-A(x - B))) + C (SciPy);logarithmic2;y = A + B * ln(x - C) (SciPy)
#% answer: linear,logarithmic
#% guisection: Optional
#%end
#%option G_OPT_F_OUTPUT
#% key: plot
#% required: no
#% label: Save plotted relationship between developed cells and population into a file
#% description: File type is given by extension (.pdf, .png, .svg)
#% guisection: Output
#%end
#%option G_OPT_F_OUTPUT
#% key: demand
#% description: Output CSV file with demand (times as rows, regions as columns)
#% guisection: Output
#%end
#%option G_OPT_F_SEP
#% label: Separator used in CSV files
#% guisection: Optional
#% answer: comma
#%end
# %module
# % description: Script for creating demand table which determines the quantity of land change expected.
# % keyword: raster
# % keyword: demand
# %end
# %option G_OPT_R_INPUTS
# % key: development
# % description: Names of input binary raster maps representing development
# % guisection: Input maps
# %end
# %option G_OPT_R_INPUT
# % key: subregions
# % description: Raster map of subregions
# % guisection: Input maps
# %end
# %option G_OPT_F_INPUT
# % key: observed_population
# % description: CSV file with observed population in subregions at certain times
# % guisection: Input population
# %end
# %option G_OPT_F_INPUT
# % key: projected_population
# % description: CSV file with projected population in subregions at certain times
# % guisection: Input population
# %end
# %option
# % type: integer
# % key: simulation_times
# % multiple: yes
# % required: yes
# % description: For which times demand is projected
# % guisection: Output
# %end
# %option
# % type: string
# % key: method
# % multiple: yes
# % required: yes
# % description: Relationship between developed cells (dependent) and population (explanatory)
# % options: linear, logarithmic, exponential, exp_approach, logarithmic2
# % descriptions:linear;y = A + Bx;logarithmic;y = A + Bln(x);exponential;y = Ae^(BX);exp_approach;y = (1 - e^(-A(x - B))) + C (SciPy);logarithmic2;y = A + B * ln(x - C) (SciPy)
# % answer: linear,logarithmic
# % guisection: Optional
# %end
# %option G_OPT_F_OUTPUT
# % key: plot
# % required: no
# % label: Save plotted relationship between developed cells and population into a file
# % description: File type is given by extension (.pdf, .png, .svg)
# % guisection: Output
# %end
# %option G_OPT_F_OUTPUT
# % key: demand
# % description: Output CSV file with demand (times as rows, regions as columns)
# % guisection: Output
# %end
# %option G_OPT_F_SEP
# % label: Separator used in CSV files
# % guisection: Optional
# % answer: comma
# %end


import sys
Expand Down
96 changes: 48 additions & 48 deletions r.futures/r.futures.devpressure/r.futures.devpressure.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,54 +17,54 @@
#
##############################################################################

#%module
#% description: Module for computing development pressure
#% keyword: raster
#% keyword: filter
#% keyword: statistics
#%end
#%option G_OPT_R_INPUT
#% description: Name of input binary raster map representing development
#%end
#%option G_OPT_R_OUTPUT
#% description: Name of the output development pressure raster
#%end
#%option
#% key: method
#% type: string
#% description: Method for computing development pressure
#% required: yes
#% answer: gravity
#% options: occurrence,gravity,kernel
#% descriptions: occurrence;number of developed cells in window;gravity;scaling_factor / pow(distance, gamma);kernel;scaling_factor * exp (-2*distance / gamma)
#%end
#%option
#% key: size
#% type: integer
#% description: Half of neighborhood size
#% required: yes
#% answer: 8
#%end
#%option
#% key: gamma
#% type: double
#% description: Coefficient controlling the influence of distance, needed for method gravity and kernel
#% required: no
#% answer: 1.5
#%end
#%option
#% key: scaling_factor
#% type: double
#% description: Scaling factor needed for method gravity and kernel
#% required: no
#% answer: 1
#%end
#%option G_OPT_M_NPROCS
#%end
#%flag
#% key: n
#% description: Do not propagate nulls
#%end
# %module
# % description: Module for computing development pressure
# % keyword: raster
# % keyword: filter
# % keyword: statistics
# %end
# %option G_OPT_R_INPUT
# % description: Name of input binary raster map representing development
# %end
# %option G_OPT_R_OUTPUT
# % description: Name of the output development pressure raster
# %end
# %option
# % key: method
# % type: string
# % description: Method for computing development pressure
# % required: yes
# % answer: gravity
# % options: occurrence,gravity,kernel
# % descriptions: occurrence;number of developed cells in window;gravity;scaling_factor / pow(distance, gamma);kernel;scaling_factor * exp (-2*distance / gamma)
# %end
# %option
# % key: size
# % type: integer
# % description: Half of neighborhood size
# % required: yes
# % answer: 8
# %end
# %option
# % key: gamma
# % type: double
# % description: Coefficient controlling the influence of distance, needed for method gravity and kernel
# % required: no
# % answer: 1.5
# %end
# %option
# % key: scaling_factor
# % type: double
# % description: Scaling factor needed for method gravity and kernel
# % required: no
# % answer: 1
# %end
# %option G_OPT_M_NPROCS
# %end
# %flag
# % key: n
# % description: Do not propagate nulls
# %end


import os
Expand Down
138 changes: 69 additions & 69 deletions r.futures/r.futures.gridvalidation/r.futures.gridvalidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,75 +17,75 @@
#
##############################################################################

#%module
#% description: Module for validating land change simulation on a grid
#% keyword: raster
#% keyword: statistics
#% keyword: accuracy
#% keyword: validation
#%end
#%option G_OPT_R_INPUT
#% key: simulated
#% description: Simulated land use raster
#% required: yes
#%end
#%option G_OPT_R_INPUT
#% key: reference
#% description: Reference land use raster
#% required: yes
#%end
#%option G_OPT_R_INPUT
#% key: original
#% label: Original land use raster
#% description: Required for kappa simulation
#% required: no
#%end
#%option G_OPT_R_OUTPUT
#% key: allocation_disagreement
#% required: no
#% description: Output total allocation disagreement raster
#%end
#%option G_OPT_R_BASENAME_OUTPUT
#% key: allocation_disagreement_basename
#% description: Basename for per class allocation disagreement raster
#% required: no
#%end
#%option G_OPT_R_OUTPUT
#% key: quantity_disagreement
#% description: Output total quantity disagreement raster
#% required: no
#%end
#%option G_OPT_R_BASENAME_OUTPUT
#% key: quantity_disagreement_basename
#% description: Basename for per class quantity disagreement raster
#% required: no
#%end
#%option G_OPT_R_OUTPUT
#% key: kappa
#% description: Output Cohen's kappa raster
#% required: no
#%end
#%option G_OPT_R_OUTPUT
#% key: kappasimulation
#% description: Output kappa simulation raster
#% required: no
#%end
#%option G_OPT_M_REGION
#% required: yes
#%end
#%option
#% key: nprocs
#% type: integer
#% description: Number of parallel processes
#% required: yes
#% answer: 1
#%end
#%rules
#% required: allocation_disagreement, quantity_disagreement, kappasimulation
#%end
#%rules
#% requires: kappasimulation, original
#%end
# %module
# % description: Module for validating land change simulation on a grid
# % keyword: raster
# % keyword: statistics
# % keyword: accuracy
# % keyword: validation
# %end
# %option G_OPT_R_INPUT
# % key: simulated
# % description: Simulated land use raster
# % required: yes
# %end
# %option G_OPT_R_INPUT
# % key: reference
# % description: Reference land use raster
# % required: yes
# %end
# %option G_OPT_R_INPUT
# % key: original
# % label: Original land use raster
# % description: Required for kappa simulation
# % required: no
# %end
# %option G_OPT_R_OUTPUT
# % key: allocation_disagreement
# % required: no
# % description: Output total allocation disagreement raster
# %end
# %option G_OPT_R_BASENAME_OUTPUT
# % key: allocation_disagreement_basename
# % description: Basename for per class allocation disagreement raster
# % required: no
# %end
# %option G_OPT_R_OUTPUT
# % key: quantity_disagreement
# % description: Output total quantity disagreement raster
# % required: no
# %end
# %option G_OPT_R_BASENAME_OUTPUT
# % key: quantity_disagreement_basename
# % description: Basename for per class quantity disagreement raster
# % required: no
# %end
# %option G_OPT_R_OUTPUT
# % key: kappa
# % description: Output Cohen's kappa raster
# % required: no
# %end
# %option G_OPT_R_OUTPUT
# % key: kappasimulation
# % description: Output kappa simulation raster
# % required: no
# %end
# %option G_OPT_M_REGION
# % required: yes
# %end
# %option
# % key: nprocs
# % type: integer
# % description: Number of parallel processes
# % required: yes
# % answer: 1
# %end
# %rules
# % required: allocation_disagreement, quantity_disagreement, kappasimulation
# %end
# %rules
# % requires: kappasimulation, original
# %end


import os
Expand Down
Loading

0 comments on commit 1bbc355

Please sign in to comment.