Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2

updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
61 changes: 61 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Gradle CI

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
build:
name: Build and test
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build and test
run: ./gradlew clean build

dependency-submission:
name: Submit Gradle dependencies
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Submit Gradle dependencies
uses: gradle/actions/dependency-submission@v6

74 changes: 73 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,75 @@
# REGI-Headless

This is a temporary readme file and will be updated in the future.
> [!IMPORTANT]
> **Notice: Project Refactor in Progress**
> This project is undergoing a large refactor for [CWMS Data API](https://github.com/USACE/cwms-data-api) support.
> It will transition from a Java project consuming Jython scripts to a **Python project** that
> utilizes **JPype** to call underlying REGI Java libraries.

`REGI-Headless` is a Java-based command-line tool and library designed to run
**REGI** calculations in a headless environment.
It allows users to execute complex hydrological calculations and manage gate settings via Jython
scripts without the need for a graphical interface.

## Features

- **Headless Execution**: Run REGI calculations as part of automated workflows or on servers.
- **Database Integration**: Connects to CWMS data retrieval and storage.
- **Modular Calculations**: Includes support for:
- Inflow calculations (Clone, Compute, Auto-Adjust, Balance All, etc.)
- Flow Group and gate settings calculations.

## Project Structure

- `regi-headless/`: Core Java implementation, including `RegiCLI`.
- `district-scripts/`: Example scripts and district-specific configurations.
- `docs/`: Additional documentation.

## Getting Started

### Prerequisites

- Java JDK 21 or higher.
Comment thread
rma-psmorris marked this conversation as resolved.

### CWMS Data API Configuration

The library reads the following environment variables when establishing the CWMS Data API data source:

- `CDA_URL`: Base URL for the CWMS Data API endpoint.
- `API_KEY`: API key used for CWMS Data API authentication and authorization.
- `OFFICE_ID`: CWMS office identifier used to scope the session.

The factory uses these values to authenticate, resolve the current user, and persist the connected office and time zone into the REGI project.

### Building


```powershell
./gradlew build
```

Details TBD.

## Usage

TBD

### Command Line Options

TBD

### Example

TBD

## Testing

TBD

## Maintainers

See [MAINTAINERS.md](MAINTAINERS.md) for a list of project maintainers.

## License

See [LICENSE](LICENSE) for licensing information.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "com.palantir.git-version" version "3.0.0"
id "org.sonarqube" version "4.0.0.2929"
id "com.palantir.git-version" version "5.0.0"
id "org.sonarqube" version "7.3.1.8318"
}

def versionLabel(gitInfo) {
Expand Down
18 changes: 0 additions & 18 deletions buildSrc/src/main/groovy/regi-headless.deps-conventions.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@

def checkForNexusCredentials() {
if(!project.hasProperty('nexusUser')) {
println ('Please set the nexusUser property in the GRADLE_USER_HOME ($userHome/.gradle/gradle.properties) file or via -PnexusUser= .')
}
if(!project.hasProperty('nexusPassword')) {
println ('Please set the nexusPassword property in the GRADLE_USER_HOME ($userHome/.gradle/gradle.properties) file or via -PnexusPassword= .')
}
}

repositories {
maven {
url 'https://www.hec.usace.army.mil/nexus/repository/maven-public'
}
maven {
url 'https://www.hec.usace.army.mil/nexus/repository/hec-internal'
credentials {
checkForNexusCredentials()
username "$nexusUser"
password "$nexusPassword"
}
}
mavenCentral()
}
Loading
Loading