Skip to content

Commit

Permalink
Merge pull request dailyerosion#264 from akrherz/240812
Browse files Browse the repository at this point in the history
Support upcoming expansion
  • Loading branch information
akrherz authored Aug 19, 2024
2 parents 404f615 + 88a38a4 commit 5652336
Show file tree
Hide file tree
Showing 59 changed files with 444 additions and 354 deletions.
1 change: 1 addition & 0 deletions .github/setupdata.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
touch /i/0/cli/100x042/100.30x042.26.cli
8 changes: 8 additions & 0 deletions .github/setuppaths.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create necessary paths
mkdir -p _data/2/0
mkdir _data/data
sudo ln -s `pwd`/_data /mnt/idep2
sudo ln -s `pwd`/_data/2 /i
sudo ln -s `pwd` /opt/dep

mkdir -p /i/0/cli/100x042
18 changes: 10 additions & 8 deletions .github/workflows/pydep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
defaults:
run:
# Ensures environment gets sourced right
shell: bash -l {0}
shell: bash -e -l {0}
name: Build and Test
runs-on: ubuntu-latest
strategy:
Expand All @@ -26,12 +26,6 @@ jobs:
run: |
cat .github/workflows/etchosts.txt | sudo tee -a /etc/hosts
# daryl is a hack
- name: Create symlink
run: |
set -e
sudo ln -s `pwd` /opt/dep
# setup conda-forge with micromamba
- name: Setup Python
uses: mamba-org/setup-micromamba@v1
Expand All @@ -46,6 +40,15 @@ jobs:
environment-name: prod
cache-environment: true

- name: Install Python Dependencies via pip
run: python -m pip install -r pip_requirements.txt

- name: Setup paths
run: sh .github/setuppaths.sh

- name: Setup data
run: sh .github/setupdata.sh

- name: Setup Postgres
run: |
git clone --depth 1 https://github.com/akrherz/iem-database.git database
Expand All @@ -60,7 +63,6 @@ jobs:
- name: Build and test
run: |
set -e
python -m pip install . --upgrade --no-deps
python -m pytest --cov=pydep tests
python -m coverage xml
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.7"
rev: "v0.6.1"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
23 changes: 0 additions & 23 deletions conda_requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ dependencies:
# image work
- pillow
- psycopg
# my hacky
- pyiem
# Fast geojson reading
- pyogrio
# For testing
Expand Down
3 changes: 2 additions & 1 deletion pip_requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# none
# bad daryl
git+https://github.com/akrherz/pyIEM.git
5 changes: 3 additions & 2 deletions scripts/RT/env2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import numpy as np
import pandas as pd
from affine import Affine
from pydep.io.wepp import read_env
from pydep.util import load_scenarios
from pyiem.iemre import NORTH, WEST
from pyiem.util import get_dbconn, logger
from rasterstats import zonal_stats
from tqdm import tqdm

from pydep.io.wepp import read_env
from pydep.util import load_scenarios

LOG = logger()
PRECIP_AFF = Affine(0.01, 0.0, WEST, 0.0, -0.01, NORTH)
CONFIG = {"subset": False}
Expand Down
5 changes: 3 additions & 2 deletions scripts/RT/env2database.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
import numpy as np
import pandas as pd
from affine import Affine
from pydep.io.dep import read_env
from pydep.util import load_scenarios
from pyiem.grid.zs import CachingZonalStats
from pyiem.iemre import NORTH, WEST
from pyiem.util import get_dbconn, get_dbconnstr, logger
from tqdm import tqdm

from pydep.io.dep import read_env
from pydep.util import load_scenarios

LOG = logger()
PRECIP_AFF = Affine(0.01, 0.0, WEST, 0.0, -0.01, NORTH)
CONFIG = {"subset": False}
Expand Down
3 changes: 2 additions & 1 deletion scripts/RT/harvest2database.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

# third party
import pandas as pd
from pydep.io.wepp import read_yld
from pyiem.util import get_dbconn
from tqdm import tqdm

from pydep.io.wepp import read_yld


def readfile(huc12, filename):
"""Make me a df please"""
Expand Down
3 changes: 2 additions & 1 deletion scripts/RT/harvest_wb.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
import numpy as np
import pandas as pd
from affine import Affine
from pydep.io.dep import read_wb
from pyiem.iemre import NORTH, WEST
from pyiem.util import get_dbconn
from rasterstats import zonal_stats
from tqdm import tqdm

from pydep.io.dep import read_wb

PRECIP_AFF = Affine(0.01, 0.0, WEST, 0.0, -0.01, NORTH)


Expand Down
3 changes: 2 additions & 1 deletion scripts/RT/proctor_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
import numpy as np
import pandas as pd
import requests
from pydep.io.man import man2df, read_man
from pyiem.database import get_sqlalchemy_conn
from pyiem.util import logger
from sqlalchemy import text
from tqdm import tqdm

from pydep.io.man import man2df, read_man

HUC12S = ["090201081101", "090201081102", "090201060605"]
LOG = logger()
IEMRE = "http://mesonet.agron.iastate.edu/iemre/hourly"
Expand Down
3 changes: 2 additions & 1 deletion scripts/RT/scenario_compare_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import os

import pandas as pd
from pydep.io.wepp import read_env
from pyiem.plot.use_agg import plt

from pydep.io.wepp import read_env


def main():
"""Go Main Go."""
Expand Down
3 changes: 2 additions & 1 deletion scripts/cligen/add_clifile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

import pandas as pd
import requests
from pyiem.util import convert_value, logger

from pydep.io.wepp import read_cli
from pydep.util import get_cli_fname
from pyiem.util import convert_value, logger

LOG = logger()

Expand Down
3 changes: 2 additions & 1 deletion scripts/cligen/assign_climate_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import sys

from pydep.util import get_cli_fname
from pyiem.util import get_dbconn, logger

from pydep.util import get_cli_fname

LOG = logger()


Expand Down
Loading

0 comments on commit 5652336

Please sign in to comment.