OpenAgua
  • What is OpenAgua?
  • How to use
    • User Guide
      • Key concepts
      • Sharing & collaboration
      • Configuration
        • Model engines & cloud computing
        • Network templates
      • Setting up a model
        • First steps
        • Viewing/editing a network
        • Viewing/editing scenarios
        • View/edit data
      • Running a model
      • Viewing & saving results
        • Visualize results
        • Results dashboard
        • Exporting results
      • Advanced
        • OpenAgua data specifications
        • Advanced data tools
    • WaterLP
      • Getting started
      • Built-in variables
      • Functions reference
    • Where to get help
    • Frequently Asked Questions
    • Web API
      • networks
  • Learn more
    • Publications
    • The Team
    • Development
      • Open source software
      • Contributing
Powered by GitBook
On this page
  • timestep
  • date
  • periodic_timestep
  • water_year
  • start_date
  1. How to use
  2. WaterLP

Built-in variables

PreviousGetting startedNextFunctions reference

Last updated 6 years ago

OpenAgua includes a growing list of built-in variables available for use in functions. As of writing, these include the following:

timestep

An ordinal integer representing the current timestep (i.e., 1, 2, 3, ..., N).

date

A the current timestep's date as a date object, which has numerous useful (e.g., date.month, etc.).

periodic_timestep

An ordinal integer representing the timestep in the current water year. For example, a monthly time step model starting in October would have periodic_timestep of 1, 2, 3, ..., 12, with 1 in October and 12 the following September. A daily time step model would similarly range from 1 to 365 (or 366 if leap years are considered).

water_year

The current water year, which is defined by the calendar year of the last month in the water year. If it helps, here is the specific equation for water_year:

water_year = date.year + (0 if date.month < start_date.month else 1)

where start_date is the start date of the model. Speaking of start date...

start_date

This is a date object representing (you guessed it!) the start date of the model.

This list is preliminary, and we would happily accommodate additional variable needs.

Pendulum
attributes and properties
Pendulum