Skip to content

Commit

Permalink
Merge branch 'bug'
Browse files Browse the repository at this point in the history
  • Loading branch information
akrherz committed Jun 28, 2024
2 parents 6292830 + 2da6cb0 commit ce7a349
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
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.4.10"
rev: "v0.5.0"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
13 changes: 1 addition & 12 deletions htdocs/admin/siteprogress.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from io import StringIO

from pandas.io.sql import read_sql
from pyiem.util import get_dbconn
from pyiem.database import get_dbconn
from pyiem.webutil import iemapp

DBCONN = get_dbconn("sustainablecorn")
Expand Down Expand Up @@ -146,17 +146,6 @@ def application(environ, start_response):
if "site" in environ:
do_site(sio, environ.get("site"))
return
# mode = form.getfirst('mode', 'agronomic')
show_has = environ.get("has", "0") == "1"
show_period = environ.get("period", "0") == "1"
show_dnc = environ.get("dnc", "0") == "1"
show_no = environ.get("no", "0") == "1"
if environ.get("a") is None:
show_has = True
show_period = True
show_dnc = True
show_no = True
# Forget the above, we hard code things like so
show_has = True
show_period = True
show_dnc = True
Expand Down
16 changes: 9 additions & 7 deletions htdocs/cscap/dl/dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@

import numpy as np
import pandas as pd
from pyiem.database import get_dbconn, get_dbconnstr
from pyiem.exceptions import NoDataFound
from pyiem.util import get_dbconn, get_dbconnstr, logger
from pyiem.util import logger
from pyiem.webutil import ensure_list, iemapp
from pymemcache import Client
from sqlalchemy import text
Expand Down Expand Up @@ -660,14 +661,15 @@ def do_work(environ, start_response):
email = environ.get("email")
sites = ensure_list(environ, "sites[]")
# treatments = form.getlist('treatments[]')
agronomic = redup(list(environ.get("agronomic[]", [])))
soil = redup(list(environ.get("soil[]", [])))
ghg = redup(list(environ.get("ghg[]", [])))
ipm = redup(list(environ.get("ipm[]", [])))
years = [int(x) for x in list(environ.get("year[]", []))]
agronomic = redup(ensure_list(environ, "agronomic[]"))
print(environ["ghg[]"])
soil = redup(ensure_list(environ, "soil[]"))
ghg = redup(ensure_list(environ, "ghg[]"))
ipm = redup(ensure_list(environ, "ipm[]"))
years = [int(x) for x in ensure_list(environ, "year[]")]
if not years:
years = [2011, 2012, 2013, 2014, 2015]
shm = redup(list(environ.get("shm[]", [])))
shm = redup(ensure_list(environ, "shm[]"))
missing = environ.get("missing", "M")
if missing == "__custom__":
missing = environ.get("custom_missing", "M")
Expand Down
2 changes: 1 addition & 1 deletion scripts/cscap/drop_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def main():
"""Go Main Go."""
config = util.get_config()
config = util.get_config("cscap")

# Get me a client, stat
spr_client = util.get_spreadsheet_client(config)
Expand Down

0 comments on commit ce7a349

Please sign in to comment.